Github Devices Community Docs Blog

How is HomeAssistant auto discovery supposed to work?

Hi there, I got OpenMQTTGateway running with the RF gateway, with automatic integration to HomeAssistant… fantastic project!

I’m failing to understand, though, how the automatic integration is supposed to work. It created an entity with several switches (of which only one is an RF device of mine, a PIR motion sensor). All the switches seem to be perennially off:

How do I use this? OR should I just disable autodiscovery and do things by hand?

Thank you for any help you can offer!

Hi,

Regarding the RF gateway, each time the gateway receive a signal it will create a switch with HA, if you switch it to ON the gateway will send back this signal by RF.

Is it what you are expecting?

Thank you for the quick answer!

Actually, I would expect that in addition to creating a switch, the switch would be operational in some way. I realize that it’s difficult without knowing what the RF device is, but the functionality as provided is not very useful: how do I detect that my motion sensor has triggered?

The issue here is that the gateway doesn’t know if it receives a signal from a remote control or a PIR sensor.
If I trigger the switch state if will never come back to OFF. As we will never receive an OFF signal.
Do you think that all the created signal should be done with a tempo to set automatic to OFF after a certain time (I don’t know if it can be done on HA discovery)?

It can be done. This is a auto-discovery message for an openmqttgateway doorsensor (piped through a python script that parses the home/OpenMQTTGateway/SRFBtoMQTT messages and re-publish to sensor/xxx topic)

homeassistant/binary_sensor/garagedoor/config
'{"name": "garagedoor", "device_class": "garage_door", "state_topic": "sensor/garagedoor", "unique_id": "garagedoor", "off_delay": 30, "device": {"identifiers": ["rfbridge_564886"],"name": "garagedoor", "model": "Digoo door sensor", "manufacturer": "Digoo"}}'

The question is: how do you distinguish between a signal received from a switch and a signal received from a door sensor or a PIR ?

Yeah, I agree it’s probably not feasible with a protocol as dumb as RF433…

So the solution seems to be to avoid autodiscovery.