Open sstarkey12 opened 8 months ago
This appears to be a problem with the topic name and how the Octoprint MQTT plug-in is handling it, or it is flat out a bad name.
We only care about 3d Printer Enclosure/temperature
but it is unclear in your screenshot what the actual topic name/path is. In MQTT Explorer, select the temperature
node then use its copy button to get the full path on your clipboard.
Share that here please.
Another thought is the MQTT python library may not like spaces in the topic name. Are you able to rename it to something with either dashes or underscores in whatever is controlling your mqtt bridge (I'm assuming zigbee)?
Do you run Home Assistant? I have an idea for working around it from there as well.
We only care about 3d Printer Enclosure/temperature but it is unclear in your screenshot what the actual topic name/path is. In MQTT Explorer, select the temperature node then use its copy button to get the full path on your clipboard.
Share that here please.
Fair assumption, but I did use the copy button, and that's the value I pasted on the plugin config page. For posterity, zigbee2mqtt/3d Printer Enclosure/temperature
but I've changed it. The new topic is octoprint/enclosure
which is a direct copy from MQTT Explorer.
Another thought is the MQTT python library may not like spaces in the topic name. Are you able to rename it to something with either dashes or underscores in whatever is controlling your mqtt bridge (I'm assuming zigbee)?
After I posted the initial issue, the spaces thing occurred to me as well, so reconfigured my NodeRED node a little to remove them and publish to different topic. Didn't seem to help, but I'll keep this setup for now as it's a little cleaner.
Do you run Home Assistant? I have an idea for working around it from there as well.
I do use Home Assistant. With it I'm running the Node-RED add-on, Zigbee2MQTT add-on, and Mosquitto Broker add-on. I'm using NR to take the MQTT value from the sensor topic zigbee2mqtt/3d Printer Enclosure
(which has a bunch of extra stuff in the JSON besides temperature) and feed just the temp by itself it to a custom MQTT topic, octoprint/enclosure
. You don't specify the format of the MQTT message so I just assumed it would be a plain number value. I also have the Octoprint integration going inside HA, but don't really use it for control, just occasional monitoring.
I'm pretty sure Octoprint MQTT is working ok as I also use the MQTT Publish plugin to control the enclosure light and the printer (via smart switch), and it functioning. I did enable debug logging for the plugin but nothing has been captured yet. Did an uninstall and then reinstall the plugin (no errors on install) as well. I'm pretty stoked that you put this plugin together, so anything you need to troubleshoot I'm game.
And you're getting the same error?
Running Octoprint on a pi?
Yes, on a pi 4. Let me delete the log file, restart Octoprint, and recheck it and I'll report back here.
This has got to be something silly.
Ok....so it seems to be seeing the MQTT according to the logs:
2024-01-14 13:50:18,237 - octoprint.plugins.mqttchambertemperature - DEBUG - __init__: on_after_startup
2024-01-14 13:50:18,293 - octoprint.plugins.mqttchambertemperature - DEBUG - mqtt_publish registered
2024-01-14 13:50:18,299 - octoprint.plugins.mqttchambertemperature - DEBUG - subscribed to [octoprint/enclosure]
2024-01-14 13:50:18,311 - octoprint.plugins.mqttchambertemperature - DEBUG - mqtt_unsubscribe registered
2024-01-14 13:50:56,093 - octoprint.plugins.mqttchambertemperature - DEBUG - Received message for octoprint/enclosure: b'17.2'
2024-01-14 13:54:02,990 - octoprint.plugins.mqttchambertemperature - DEBUG - Received message for octoprint/enclosure: b'18.4'
2024-01-14 13:54:03,032 - octoprint.plugins.mqttchambertemperature - DEBUG - Received message for octoprint/enclosure: b'18.4'
But I'm not seeing anything on the Temperature panel in the Octoprint UI. I feel like I'm not doing something right here...lol.
Nice... Go into your printer profile, enable the enclosure and you'll be good to go.
I'll tag this issue to update documentation.
Works! I'm guessing the spaces in the topic may have been the issue but I didn't know I had to enable it in my print profile....even though mine's not technically 'heated' you still have to add that to your print profile. Had no idea...Thanks for the assist and your patience. Great job on the plugin and I liked the links you added for making your enclosure heated for us new guys! Cheers!
Great to see you got it all sorted out.
A couple things coming out of this (my own notes)
Not working for me.
OctoPrint: 1.9.3 MQTT (0.8.14)
I appears that OctoPrint is connected to MQTT, but no chamber temp appears. Tried sending both JSON string and raw temp data. MQTT Explorer:
Plugin Config:
Looking at the octoprint.log: