#Mqtt set vs state
1 messages · Page 1 of 1 (latest)
- name: 'vpn'
unique_id: vpn
state_topic: 'vpn/12345/state'
command_topic: 'vpn/12345/set'
availability:
- topic: "vpn/12345/available"
payload_on: '{"vpn":{"on":1}}'
payload_off: '{"vpn":{"on":0}}'
value_template: '{{ value_json.vpn.on }}'
state_on: 1
state_off: 0
I can change the status on HAS by changing the state from mqtt explorer. If I toggle the switch, I can send a set command but how do I combine that with changing the state as well.
The button slides back to the previous state ofter one second.