Power Button
Hello,
I'm using power on/off button with mqtt topic.
Is it possible to have a button reflecting power status. (maybe by changing color of the button)
Thanks
I'm using power on/off button with mqtt topic.
Is it possible to have a button reflecting power status. (maybe by changing color of the button)
Thanks
Comments
{"activeExtruder":0,"autostartNextPrint":false,"condition":1,"conditionReason":"","debugLevel":6,"doorOpen":false,"extruder":[{"error":0,"output":0.0,"tempRead":20.0,"tempSet":0.0},{"error":0,"output":0.0,"tempRead":20.0,"tempSet":0.0},{"error":0,"output":0.0,"tempRead":20.0,"tempSet":0.0}],"fans":[{"on":false,"voltage":0},{"on":false,"voltage":0},{"on":false,"voltage":0},{"on":false,"voltage":0}],"filterFan":false,"firmware":"Repetier_0.92.6","firmwareStyle":"craftbot","firmwareURL":"https://github.com/repetier/Repetier-Firmware/","flowMultiply":100,"hasXHome":false,"hasYHome":false,"hasZHome":false,"heatedBeds":[{"error":0,"output":0.0,"tempRead":20.0,"tempSet":0.0}],"heatedChambers":[{"error":0,"output":0.0,"tempRead":20.0,"tempSet":0.0}],"layer":0,"lights":0,"maxLayer":0,"notification":"","numExtruder":3,"powerOn":false,"rec":false,"sdcardMounted":true,"shutdownAfterPrint":false,"speedMultiply":100,"volumetric":false,"x":0.0,"xOff":0.0,"y":0.0,"yOff":0.0,"z":0.0,"zOff":0.0}
So you can just use that to do whatever you want in your mqtt client. How you do that depends on your mqtt client I guess. In homeassistant for example you could define a binary_sensor with
"state_topic":"RepetierServer-xxxxxx-781c-46c9-9672-3a4e128444e3/state/Felix/state"
"value_template":"{{ value_json.powerOn }}"
"payload_on":"True"
"payload_off":"False"
and then use this in your button logic.
It's a toggle button without visible state.
@runButtonCommand togglePower