Please… Can I add HEAT button?
My experiment didn’t work:
NR:
{"id":"68da138e.e3b8fc","type":"mqtt in","z":"56deb452.46025c","name":"Set Mode","topic":"home/termostato/mode/set","qos":"2","datatype":"auto","broker":"99ab3ff6.4455d","x":200,"y":1380,"wires":[["2396e0a1.f33d6"]]},{"id":"2396e0a1.f33d6","type":"template","z":"56deb452.46025c","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"[{{ payload }}]","output":"str","x":500,"y":1380,"wires":[["702f8922.58b8c8"]]},{"id":"702f8922.58b8c8","type":"json","z":"56deb452.46025c","name":"","property":"payload","action":"","pretty":false,"x":650,"y":1380,"wires":[["1b2f80ea.a810a7"]]},{"id":"1b2f80ea.a810a7","type":"modbus-write","z":"56deb452.46025c","name":"Set Mode","showStatusActivities":false,"showErrors":false,"unitid":"","dataType":"MHoldingRegisters","adr":"9","quantity":"1","server":"36e9f5f4.01499a","emptyMsgOnFail":false,"keepMsgProperties":false,"x":820,"y":1380,"wires":[[],[]]},{"id":"99ab3ff6.4455d","type":"mqtt-broker","name":"MQTT HA Server","broker":"192.168.10.17","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"36e9f5f4.01499a","type":"modbus-client","name":"Termostato","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.10.75","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":true}]
in config
switch:
- platform: mqtt
name: "Termostato Heat"
state_topic: "home/termostato/mode/state"
command_topic: "home/termostato/mode/set"
payload_on: "1"
payload_off: "0"
qos: 0
retain: true
icon: mdi:radiator
dashboard:
- entity: switch.termostato_heat
hold_action:
action: more-info
show_icon: true
show_name: true
show_state: true
tap_action:
action: toggle
type: button
name: Heat