3d printer octoprint domoticz monitoring

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by DAVIZINHO »

finally im trying to configure MQTT in domoticz :-)
now i need to create the node-red flow. im in progres!!! :-P

edit:
I install MQTT and node. but im very lost with this.
Im really noobs with this and i dont know how to create the node flow and link the octoprint plugin (mqtt) to send the info to node and domoticz :-(
some help?
thanksssss

EDIT2:
works! this not so easy but fine
bjacobse
Posts: 85
Joined: Tuesday 06 September 2016 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sorø, DK
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by bjacobse »

@DAVIZINHO
I did describe exactly how to paste in the node flow - maybe you didn't read this... anyway I will then post the link:
viewtopic.php?f=21&t=14021#p162935my guide?
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by DAVIZINHO »

bjacobse wrote: Thursday 29 November 2018 22:52 @DAVIZINHO
I did describe exactly how to paste in the node flow - maybe you didn't read this... anyway I will then post the link:
viewtopic.php?f=21&t=14021#p162935my guide?
yes I read but only apears the "orange box" not the others.
This was the first time i use node, maybe my fault but like I said, i can solve the problem and now it works perfect! :-)
thanks
chatainsim
Posts: 101
Joined: Wednesday 25 March 2015 10:46
Target OS: Linux
Domoticz version: v4.11307
Location: France
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by chatainsim »

Hello,
I've made a lua script to get data from Octoprint through the API.
It's still a work in progress and when the printer is off you will have errors in Domoticz logs.
But I will try to improve it later.
if anyone want to work on it, please do. :)

https://github.com/chatainsim/scripts_d ... oprint.lua

Thanks
chatainsim
Posts: 101
Joined: Wednesday 25 March 2015 10:46
Target OS: Linux
Domoticz version: v4.11307
Location: France
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by chatainsim »

chatainsim wrote: Thursday 03 October 2019 23:23 Hello,
I've made a lua script to get data from Octoprint through the API.
It's still a work in progress and when the printer is off you will have errors in Domoticz logs.
But I will try to improve it later.
if anyone want to work on it, please do. :)

https://github.com/chatainsim/scripts_d ... oprint.lua

Thanks
I've updated the script, so now when the printer is turn off, no error is throw.
Same when printer is turn on but not currently printing.
Kiefdelicious
Posts: 5
Joined: Tuesday 10 December 2019 23:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by Kiefdelicious »

chatainsim wrote: Friday 04 October 2019 9:47
chatainsim wrote: Thursday 03 October 2019 23:23 Hello,
I've made a lua script to get data from Octoprint through the API.
It's still a work in progress and when the printer is off you will have errors in Domoticz logs.
But I will try to improve it later.
if anyone want to work on it, please do. :)

https://github.com/chatainsim/scripts_d ... oprint.lua

Thanks
I've updated the script, so now when the printer is turn off, no error is throw.
Same when printer is turn on but not currently printing.
Whow, thanks, looks like it works good, except for one thing. Only when I shutdown Octoprint (the whole raspberryPi) I get the following error in the domoticz log:

2019-12-10 23:34:06.437 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_octoprint.lua: /home/pi/domoticz/scripts/lua/script_time_octoprint.lua:58: attempt to index global 'JsonOctoTemp' (a nil value)

I tried the Event editor in Domoticz, and also just the plain scipt in the script folder, both gave the same error.
chatainsim
Posts: 101
Joined: Wednesday 25 March 2015 10:46
Target OS: Linux
Domoticz version: v4.11307
Location: France
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by chatainsim »

Kiefdelicious wrote: Tuesday 10 December 2019 23:41
chatainsim wrote: Friday 04 October 2019 9:47
chatainsim wrote: Thursday 03 October 2019 23:23 Hello,
I've made a lua script to get data from Octoprint through the API.
It's still a work in progress and when the printer is off you will have errors in Domoticz logs.
But I will try to improve it later.
if anyone want to work on it, please do. :)

https://github.com/chatainsim/scripts_d ... oprint.lua

Thanks
I've updated the script, so now when the printer is turn off, no error is throw.
Same when printer is turn on but not currently printing.
Whow, thanks, looks like it works good, except for one thing. Only when I shutdown Octoprint (the whole raspberryPi) I get the following error in the domoticz log:

2019-12-10 23:34:06.437 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_octoprint.lua: /home/pi/domoticz/scripts/lua/script_time_octoprint.lua:58: attempt to index global 'JsonOctoTemp' (a nil value)

I tried the Event editor in Domoticz, and also just the plain scipt in the script folder, both gave the same error.
That's strange, I have no error on my side.
Are you sure you are running the lastest version ?

When my printer is off, I only have this in Domoticz logs :

Code: Select all

2019-12-11 14:40:00.645 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:41:01.145 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:42:00.124 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:43:00.137 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:44:00.161 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:45:00.168 Status: EventSystem: Script event triggered: Octoprint 
Do you have the Json.lua in the right place:
json = (loadfile "/home/pi/domoticz/scripts/lua/JSON.lua")() ?
Kiefdelicious
Posts: 5
Joined: Tuesday 10 December 2019 23:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by Kiefdelicious »

chatainsim wrote: Wednesday 11 December 2019 14:46
Kiefdelicious wrote: Tuesday 10 December 2019 23:41
chatainsim wrote: Friday 04 October 2019 9:47
I've updated the script, so now when the printer is turn off, no error is throw.
Same when printer is turn on but not currently printing.
Whow, thanks, looks like it works good, except for one thing. Only when I shutdown Octoprint (the whole raspberryPi) I get the following error in the domoticz log:

2019-12-10 23:34:06.437 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_octoprint.lua: /home/pi/domoticz/scripts/lua/script_time_octoprint.lua:58: attempt to index global 'JsonOctoTemp' (a nil value)

I tried the Event editor in Domoticz, and also just the plain scipt in the script folder, both gave the same error.
That's strange, I have no error on my side.
Are you sure you are running the lastest version ?

When my printer is off, I only have this in Domoticz logs :

Code: Select all

2019-12-11 14:40:00.645 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:41:01.145 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:42:00.124 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:43:00.137 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:44:00.161 Status: EventSystem: Script event triggered: Octoprint
2019-12-11 14:45:00.168 Status: EventSystem: Script event triggered: Octoprint 
Do you have the Json.lua in the right place:
json = (loadfile "/home/pi/domoticz/scripts/lua/JSON.lua")() ?
Yes I copied the code from the Github, And I do have the JSON.lua in the right folder. All data is coming in Domoticz fine, but I only get this message when I shutdown octprint. I've got Domoticz V4.10717
chatainsim
Posts: 101
Joined: Wednesday 25 March 2015 10:46
Target OS: Linux
Domoticz version: v4.11307
Location: France
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by chatainsim »

Ok, I've misreading it.
It's when you shutdown Octoprint not the printer.

So I need to fix this.
chatainsim
Posts: 101
Joined: Wednesday 25 March 2015 10:46
Target OS: Linux
Domoticz version: v4.11307
Location: France
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by chatainsim »

Kiefdelicious wrote: Wednesday 11 December 2019 17:09 Yes I copied the code from the Github, And I do have the JSON.lua in the right folder. All data is coming in Domoticz fine, but I only get this message when I shutdown octprint. I've got Domoticz V4.10717
I've updated the script, it should be fixed now.
Keep me posted, Thanks
Kiefdelicious
Posts: 5
Joined: Tuesday 10 December 2019 23:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by Kiefdelicious »

chatainsim wrote: Thursday 12 December 2019 12:27
Kiefdelicious wrote: Wednesday 11 December 2019 17:09 Yes I copied the code from the Github, And I do have the JSON.lua in the right folder. All data is coming in Domoticz fine, but I only get this message when I shutdown octprint. I've got Domoticz V4.10717
I've updated the script, it should be fixed now.
Keep me posted, Thanks
Great I'll give it a try, Thank you!
Kiefdelicious
Posts: 5
Joined: Tuesday 10 December 2019 23:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by Kiefdelicious »

chatainsim wrote: Thursday 12 December 2019 12:27
Kiefdelicious wrote: Wednesday 11 December 2019 17:09 Yes I copied the code from the Github, And I do have the JSON.lua in the right folder. All data is coming in Domoticz fine, but I only get this message when I shutdown octprint. I've got Domoticz V4.10717
I've updated the script, it should be fixed now.
Keep me posted, Thanks
The error message is indead gone, Now I only get this one:

EventSystem: Warning!, lua script octoprint has been running for more than 10 seconds
chatainsim
Posts: 101
Joined: Wednesday 25 March 2015 10:46
Target OS: Linux
Domoticz version: v4.11307
Location: France
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by chatainsim »

Kiefdelicious wrote: Friday 13 December 2019 22:27
chatainsim wrote: Thursday 12 December 2019 12:27
Kiefdelicious wrote: Wednesday 11 December 2019 17:09 Yes I copied the code from the Github, And I do have the JSON.lua in the right folder. All data is coming in Domoticz fine, but I only get this message when I shutdown octprint. I've got Domoticz V4.10717
I've updated the script, it should be fixed now.
Keep me posted, Thanks
The error message is indead gone, Now I only get this one:

EventSystem: Warning!, lua script octoprint has been running for more than 10 seconds
I've added a timeout to ping command, maybe this willl help.
Can you try ? Thanks
Kiefdelicious
Posts: 5
Joined: Tuesday 10 December 2019 23:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by Kiefdelicious »

chatainsim wrote: Saturday 14 December 2019 11:49
Kiefdelicious wrote: Friday 13 December 2019 22:27
chatainsim wrote: Thursday 12 December 2019 12:27

I've updated the script, it should be fixed now.
Keep me posted, Thanks
The error message is indead gone, Now I only get this one:

EventSystem: Warning!, lua script octoprint has been running for more than 10 seconds
I've added a timeout to ping command, maybe this willl help.
Can you try ? Thanks
Sorry didn't work, I get a message every hour:
2019-12-15 10:00:12.994 Error: EventSystem: Warning!, lua script octoprint has been running for more than 10 seconds
2019-12-15 11:00:10.287 Error: EventSystem: Warning!, lua script octoprint has been running for more than 10 seconds
2019-12-15 12:00:10.127 Error: EventSystem: Warning!, lua script octoprint has been running for more than 10 seconds

This is when Octoprint is offline (so the Pi is completely off)

EDIT
chatainsim wrote:
:
I see the script is triggerd every minute, next to that it spams my log, don't know if thats bad?
2019-12-19 10:32:05.558 Status: EventSystem: Script event triggered: octoprint
2019-12-19 10:33:05.479 Status: EventSystem: Script event triggered: octoprint
2019-12-19 10:34:05.478 Status: EventSystem: Script event triggered: octoprint
2019-12-19 10:35:05.566 Status: EventSystem: Script event triggered: octoprint
Yokohama
Posts: 5
Joined: Tuesday 31 March 2020 9:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: The Netherlands
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by Yokohama »

Hi, i just want let you see what i made untill to now.
Switching the printer on and off does not require a plugin. I put a Sonoff POW between the power cord. The sonoff is flashed with Tasmota.
I switch the printer on with it and i can follow up on the power use. Then i created a Domoticz keep alive on the Octoprint IP address. In the keep alive switch i put the off command for the sonoff.
When Domoticz now sees that the Octoprint is not responding it will send a poweroff signal to the sonoff.
Attachments
Octoprint.png
Octoprint.png (16.51 KiB) Viewed 3352 times
Yokohama
Posts: 5
Joined: Tuesday 31 March 2020 9:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: The Netherlands
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by Yokohama »

For monitoring Octoprint i use Node Red. First you have to add the MQTT plugin to Octoprint.
In Node Red i use the following flow:
Octoprint.png
Octoprint.png (61.65 KiB) Viewed 3352 times
I still haven't figured out how to put the time estmates in it but this works mutch better than the Lue script i used before. The script made Domoticz unstable (timeouts).
The Node Red code is below, please enhance and correct if you want.
Spoiler: show
[{"id":"38d87d0c.c0dba2","type":"tab","label":"Octoprint","disabled":false,"info":""},{"id":"83a9a492.59f388","type":"mqtt in","z":"38d87d0c.c0dba2","name":"Temperature bed","topic":"octoprint/temperature/bed/#","qos":"0","datatype":"auto","broker":"146ca2a1.e14f9d","x":160,"y":200,"wires":[["2b228f31.950f5"]]},{"id":"2b228f31.950f5","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":330,"y":200,"wires":[["ca948c99.4302"]]},{"id":"ad308bc2.753d38","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"_timestamp","vt":"str"},{"t":"eq","v":"actual","vt":"str"},{"t":"eq","v":"target","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":670,"y":200,"wires":[[],["47c48783.f78178"],[]]},{"id":"ca948c99.4302","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":510,"y":200,"wires":[["ad308bc2.753d38"]]},{"id":"2a937535.2fe7aa","type":"mqtt out","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"146ca2a1.e14f9d","x":1190,"y":200,"wires":[]},{"id":"47c48783.f78178","type":"function","z":"38d87d0c.c0dba2","name":"Tevo Bed actual","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 486;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":900,"y":200,"wires":[["2a937535.2fe7aa"]]},{"id":"d17f01b0.d3db5","type":"mqtt in","z":"38d87d0c.c0dba2","name":"Temperature tool0","topic":"octoprint/temperature/tool0/#","qos":"0","datatype":"auto","broker":"146ca2a1.e14f9d","x":170,"y":280,"wires":[["d457f05.7c9b91"]]},{"id":"d457f05.7c9b91","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":330,"y":280,"wires":[["acab5c8.cb217a"]]},{"id":"e4654870.da4c68","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"_timestamp","vt":"str"},{"t":"eq","v":"actual","vt":"str"},{"t":"eq","v":"target","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":670,"y":280,"wires":[[],["4dd5e474.0e389c"],[]]},{"id":"acab5c8.cb217a","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":510,"y":280,"wires":[["e4654870.da4c68"]]},{"id":"4dd5e474.0e389c","type":"function","z":"38d87d0c.c0dba2","name":"Tevo Tool0 actual","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 487;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":870,"y":280,"wires":[["936e5378.7484a"]]},{"id":"936e5378.7484a","type":"mqtt out","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"146ca2a1.e14f9d","x":1170,"y":280,"wires":[]},{"id":"951dd801.bbe048","type":"mqtt in","z":"38d87d0c.c0dba2","name":"Event","topic":"octoprint/event/#","qos":"0","datatype":"auto","broker":"146ca2a1.e14f9d","x":130,"y":360,"wires":[["80e4a78f.32d5e8"]]},{"id":"80e4a78f.32d5e8","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":330,"y":360,"wires":[["31b12dfb.52b212"]]},{"id":"86831727.6e41c8","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"new","vt":"str"},{"t":"eq","v":"_event","vt":"str"},{"t":"eq","v":"state_id","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":670,"y":360,"wires":[["41fa892d.c97508"],[],[]]},{"id":"31b12dfb.52b212","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":510,"y":360,"wires":[["86831727.6e41c8"]]},{"id":"e6ce789c.9c1468","type":"mqtt out","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"146ca2a1.e14f9d","x":1150,"y":360,"wires":[]},{"id":"41fa892d.c97508","type":"function","z":"38d87d0c.c0dba2","name":"Z-Change","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 494;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":840,"y":360,"wires":[["e6ce789c.9c1468"]]},{"id":"17a3b4d.9bb8a4b","type":"mqtt in","z":"38d87d0c.c0dba2","name":"Temperature","topic":"octoprint/temperature/#","qos":"0","datatype":"auto","broker":"146ca2a1.e14f9d","x":150,"y":600,"wires":[["89bcf392.ef067"]]},{"id":"89bcf392.ef067","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":350,"y":600,"wires":[["f4d9f431.321e88"]]},{"id":"65f60dda.fb0c74","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"tool0/target","vt":"str"},{"t":"eq","v":"bed/target","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":600,"wires":[["958b89f0.71e238","9443b17.48e4e5"],["334563e7.92e08c"]]},{"id":"f4d9f431.321e88","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":510,"y":600,"wires":[["65f60dda.fb0c74"]]},{"id":"c79822ad.a78fb","type":"function","z":"38d87d0c.c0dba2","name":"Tevo Percent completed","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 489;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":890,"y":440,"wires":[["e2d967a3.4e77e8"]]},{"id":"e2d967a3.4e77e8","type":"mqtt out","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"146ca2a1.e14f9d","x":1130,"y":440,"wires":[]},{"id":"334563e7.92e08c","type":"debug","z":"38d87d0c.c0dba2","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":760,"wires":[]},{"id":"e6c2abcf.387108","type":"mqtt in","z":"38d87d0c.c0dba2","name":"progress printing","topic":"octoprint/progress/printing/#","qos":"0","datatype":"auto","broker":"146ca2a1.e14f9d","x":160,"y":440,"wires":[["bf782295.52d9f"]]},{"id":"bf782295.52d9f","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":330,"y":440,"wires":[["318d70a3.89a55"]]},{"id":"dfa8fb0c.451448","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"progress","vt":"str"},{"t":"eq","v":"printer_data","vt":"str"},{"t":"eq","v":"state","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":670,"y":440,"wires":[["c79822ad.a78fb"],[],[]]},{"id":"318d70a3.89a55","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":510,"y":440,"wires":[["dfa8fb0c.451448"]]},{"id":"5c057964.e50628","type":"mqtt out","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"146ca2a1.e14f9d","x":1070,"y":600,"wires":[]},{"id":"958b89f0.71e238","type":"function","z":"38d87d0c.c0dba2","name":"Z-Change","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 494;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":860,"y":600,"wires":[[]]},{"id":"9443b17.48e4e5","type":"debug","z":"38d87d0c.c0dba2","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":950,"y":760,"wires":[]},{"id":"698e4eae.aece8","type":"mqtt in","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"2","datatype":"auto","broker":"42c17f80.3e1c4","x":160,"y":140,"wires":[["c9416bae.dcc038"]]},{"id":"e3788ef3.70e57","type":"debug","z":"38d87d0c.c0dba2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1170,"y":40,"wires":[]},{"id":"c9416bae.dcc038","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":330,"y":140,"wires":[["3aa9e07d.ade04","e3788ef3.70e57"]]},{"id":"8bc22ae7.083688","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"istype","v":"string","vt":"string"},{"t":"istype","v":"boolean","vt":"boolean"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":140,"wires":[["9174d3d5.a0ca"],[]]},{"id":"3aa9e07d.ade04","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":510,"y":140,"wires":[["8bc22ae7.083688"]]},{"id":"9174d3d5.a0ca","type":"function","z":"38d87d0c.c0dba2","name":"Tevo Tool0 actual","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 484;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":870,"y":140,"wires":[[]]},{"id":"146ca2a1.e14f9d","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.11","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"42c17f80.3e1c4","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.11","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Yokohama
Posts: 5
Joined: Tuesday 31 March 2020 9:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: The Netherlands
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by Yokohama »

I have been working on this, this should be better.
But there is still room for improvement.
Octoprint.png
Octoprint.png (52.31 KiB) Viewed 3326 times
Spoiler: show
[{"id":"38d87d0c.c0dba2","type":"tab","label":"Octoprint","disabled":false,"info":""},{"id":"83a9a492.59f388","type":"mqtt in","z":"38d87d0c.c0dba2","name":"Temperature bed","topic":"octoPrint/temperature/bed/#","qos":"0","datatype":"auto","broker":"146ca2a1.e14f9d","x":160,"y":200,"wires":[["2b228f31.950f5"]]},{"id":"2b228f31.950f5","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":330,"y":200,"wires":[["ca948c99.4302"]]},{"id":"ad308bc2.753d38","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"actual","vt":"str"},{"t":"eq","v":"target","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":200,"wires":[["47c48783.f78178"],[]]},{"id":"ca948c99.4302","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":510,"y":200,"wires":[["ad308bc2.753d38"]]},{"id":"2a937535.2fe7aa","type":"mqtt out","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"146ca2a1.e14f9d","x":1190,"y":200,"wires":[]},{"id":"47c48783.f78178","type":"function","z":"38d87d0c.c0dba2","name":"Tevo Bed actual","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 486;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":900,"y":200,"wires":[["2a937535.2fe7aa"]]},{"id":"d17f01b0.d3db5","type":"mqtt in","z":"38d87d0c.c0dba2","name":"Temperature tool0","topic":"octoPrint/temperature/tool0/#","qos":"0","datatype":"auto","broker":"146ca2a1.e14f9d","x":170,"y":280,"wires":[["d457f05.7c9b91"]]},{"id":"d457f05.7c9b91","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":330,"y":280,"wires":[["acab5c8.cb217a"]]},{"id":"e4654870.da4c68","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"actual","vt":"str"},{"t":"eq","v":"target","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":280,"wires":[["4dd5e474.0e389c"],[]]},{"id":"acab5c8.cb217a","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":510,"y":280,"wires":[["e4654870.da4c68"]]},{"id":"4dd5e474.0e389c","type":"function","z":"38d87d0c.c0dba2","name":"Tevo Tool0 actual","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 487;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":870,"y":280,"wires":[["936e5378.7484a"]]},{"id":"936e5378.7484a","type":"mqtt out","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"146ca2a1.e14f9d","x":1170,"y":280,"wires":[]},{"id":"951dd801.bbe048","type":"mqtt in","z":"38d87d0c.c0dba2","name":"Event","topic":"octoPrint/event/#","qos":"0","datatype":"auto","broker":"146ca2a1.e14f9d","x":130,"y":420,"wires":[["80e4a78f.32d5e8"]]},{"id":"80e4a78f.32d5e8","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":310,"y":420,"wires":[["31b12dfb.52b212"]]},{"id":"86831727.6e41c8","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"new","vt":"str"},{"t":"eq","v":"name","vt":"str"},{"t":"eq","v":"state_string","vt":"str"},{"t":"eq","v":"remoteAddress","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":650,"y":420,"wires":[["41fa892d.c97508"],["67e3be2b.81457"],["5bd8d405.b9397c"],["7b47cf98.3fcd4"]]},{"id":"31b12dfb.52b212","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":490,"y":420,"wires":[["86831727.6e41c8"]]},{"id":"41fa892d.c97508","type":"function","z":"38d87d0c.c0dba2","name":"Z-Change","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 494;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":840,"y":340,"wires":[["66175381.fac34c"]]},{"id":"c79822ad.a78fb","type":"function","z":"38d87d0c.c0dba2","name":"Tevo Percent completed","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 489;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":870,"y":540,"wires":[["e2d967a3.4e77e8"]]},{"id":"e2d967a3.4e77e8","type":"mqtt out","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"146ca2a1.e14f9d","x":1150,"y":540,"wires":[]},{"id":"e6c2abcf.387108","type":"mqtt in","z":"38d87d0c.c0dba2","name":"progress printing","topic":"octoPrint/progress/printing/#","qos":"0","datatype":"auto","broker":"146ca2a1.e14f9d","x":160,"y":540,"wires":[["bf782295.52d9f"]]},{"id":"bf782295.52d9f","type":"json","z":"38d87d0c.c0dba2","name":"","property":"payload","action":"obj","pretty":false,"x":330,"y":540,"wires":[["318d70a3.89a55"]]},{"id":"dfa8fb0c.451448","type":"switch","z":"38d87d0c.c0dba2","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"progress","vt":"str"},{"t":"eq","v":"printer_data","vt":"str"},{"t":"eq","v":"state","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":650,"y":540,"wires":[["c79822ad.a78fb"],[],[]]},{"id":"318d70a3.89a55","type":"split","z":"38d87d0c.c0dba2","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":490,"y":540,"wires":[["dfa8fb0c.451448"]]},{"id":"7b47cf98.3fcd4","type":"function","z":"38d87d0c.c0dba2","name":"Verbonden met","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 620;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":860,"y":460,"wires":[["66175381.fac34c"]]},{"id":"67e3be2b.81457","type":"function","z":"38d87d0c.c0dba2","name":"Print name","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 618;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":850,"y":380,"wires":[["66175381.fac34c"]]},{"id":"66175381.fac34c","type":"mqtt out","z":"38d87d0c.c0dba2","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"146ca2a1.e14f9d","x":1110,"y":400,"wires":[]},{"id":"5bd8d405.b9397c","type":"function","z":"38d87d0c.c0dba2","name":"Print state","func":"var msg_out = {payload: msg.payload.length};\nmsg_out.payload = {};\nmsg_out.payload.idx = 619;\nmsg_out.payload.nvalue = 0;\nmsg_out.payload.svalue = \"\" + msg.payload;\nreturn msg_out;","outputs":1,"noerr":0,"x":840,"y":420,"wires":[["66175381.fac34c"]]},{"id":"146ca2a1.e14f9d","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.11","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
chatainsim
Posts: 101
Joined: Wednesday 25 March 2015 10:46
Target OS: Linux
Domoticz version: v4.11307
Location: France
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by chatainsim »

In the beta version, there is now an Ocotoprint hardware.
Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by Wob76 »

chatainsim wrote: Friday 03 April 2020 9:34 In the beta version, there is now an Ocotoprint hardware.
I can see the Octoprint hardware made it into 2021.1 but I can't see any documentation about it, is anyone using it?

It has options for settings in\out topics but that doesn't actually appear to flow to anything as I can see in the MQTT logs it still publishes on the default OctoPrint/, it looks like it doesn't do any discovery and there is no option to create a virtual device for it, do we need to create another hardware device and create dummy devices to feed into it?

Thanks
Wob
thomasbaetge
Posts: 153
Joined: Wednesday 02 October 2019 11:47
Target OS: Linux
Domoticz version: 2023.1
Location: DE / BY / LT
Contact:

Re: 3d printer octoprint domoticz monitoring

Post by thomasbaetge »

interesting.... I just came across this thread, didn't even know, that this interface exists.
I may need another RPI for my 3D printer then.....🤣🤣🤣
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest