Github Boards Devices Community Docs Blog

ESP32 433 & HomeAssistant problems

Within the last few days I built my ESP32 433 gateway using SRX882. The gateway works. I can monitor MQTT messages and see that when I push a button on my remote, a MQTT message is created.

Additionally, I can see in HomeAssistant that a switch was created. I can even view the log, and see that HA is registering NEW MQTT messages.

My problem is, the switch never turns on. I’ve tried checking with automations, I’ve tried viewing the history on the switch. No luck getting anything to actually “happen” in HA.

I was also reading that for pushbuttons (the only 433 devices I have at the moment) it’s better that they use Device Triggers MQTT Device Trigger - Home Assistant vs binary sensors or switches - Is there any plan to add Device Triggers as a discovery type? Apparently they only are able to be discovered, not configured via YAML.

Thanks, and any help is much appreciated.

You mean that the switch status in hass is not representing the real state ?

Yes. I mean nothing was happening. At all. I was able to modify the source and get it working.
In ZGatewayRF.ino I changed the function RFtoMQTTdiscovery - I modified the line char* switchRF to char* switchRF[8] = {“switch”, val, “”, “”, jsonVal, val, “”, “”};

Upon reading up on the HomeAssistant’s processing of the MQTT protocol, it would need to know how to process the JSON payload. The val_template that jsonVal would setup to know to get the data out of the JSON payload.

I now am able to successfuly turn the HA switch on by pressing a button. I will reiterate that “best practice” according to the docs is for a “device trigger” to be created/used for pushbuttons instead of a switch. I’ll look into modifying the source to support the mqtt message type and see what the results are like.

1 Like