I want to set my bed and tool temp for my printer via an automation so I can set it directly from my dashboard.
I installed the mqtt, homeassistant discovery and mqtt service plugins in octoprint.
Using mqtt explorer I can successfully set the bed and tool temps however it isn’t working when I try to do it in home assistant, either by calling the mqtt_publish service or via an automation.
This is my automation code:
alias: Mega X test
description: ""
trigger:
- platform: template
value_template: "{{ states.input_number.mega_x_bed_temp_helper.state | int }}"
condition: []
action:
- service: notify.notify
data:
message: Mega X bed temp has been set to the inputted value
- service: mqtt.publish
data:
qos: 0
retain: false
topic: octoprint/cmd/bed
payload: {'"temp":30'}
mode: single
I have tried variations on the above using call-service, service_data and multiple variations on the payload but none of them change the temp on octoprint.
Additionally, I want to input the number inputted from the dashboard stated in the trigger as the payload, I’m just using a hardcoded number above to try and get it working.
Can anyone help me to get this working?
Thanks