Hi
I try to create manually a switch ON / OFF for my siren.
I think I don’t understand all parameters, I have the following code (inside the configuration.yaml):
switch:
- platform: mqtt
name: "Alarm Bathroom Switch"
state_topic: "zigbee2mqtt/siren_alarm_bathroom/state"
command_topic: "zigbee2mqtt/siren_alarm_bathroom/set"
payload_on: "{\"alarm\": true,\"humidity_alarm\": false,\"melody\": 1,\"temperature_alarm\": false,\"volume\": \"low\",\"duration\": 2}"
payload_off: "{\"alarm\": false,\"humidity_alarm\": false,\"melody\": 1,\"temperature_alarm\": false,\"volume\": \"low\",\"duration\": 2}"
state_on: "ON"
state_off: "OFF"
optimistic: false
qos: 0
retain: true
What state should I write ? I put “ON” and “OFF” but not sure it’s like that we have to use it in the UI ?
I want at the end a toggle ON/OFF in Lovelace which toggle publishing a MQTT request on my siren to have alarm: true or alarm: false
What should I do ?
Thank you in advance