Hi, i have the following problem.
I built a small box to open my garage door. It is based on a esp32, running a small mqtt programm,. To open/close the garage I need do send the mqtt command
DUMSHOME/GarageMarc/CMND with the payload ON
this will switch a relais, and I have to send a new command with the payload OFF to open the relais again. when the relais switches from off to on, the garagedoor gets an impulse and toggles the garagedoor, so when it is open it closes, and viceversa.
This is used by other tools and should remain n place.
The system does not return the state of the garagedoor
So I have a zigbee dorr sensor who delivers the following paylod
{"battery":97,"contact":true,"device_temperature":15,"linkquality":3,"power_outage_count":6,"trigger_count":0,"voltage":2995}
I would like to retrieve the v alue of contact to set the state of the switch
I think zhe ya,l file should be something like
# define GarageDoorMarc
- name: "GarageDoorMarc"
state_topic: "zigbee2mqtt/GarageMarc"
command_topic: "DUMSHOME/GarageMarc/CMND"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true
and I need to use a template to get the value, but the template seems to be applied to the command topic, and not to read the state value.
Once this works, i will build on automation to send an mqtt command with payload ON, and once the state is false, I will send a command with the payload OFF.
Alos, in a dashboard there should be a switch to open/close the garagedoor, but that’s when the MQTT switch works