I did setup a SonOff RF bridge with Tasmota. I would like to integrate a 4 buttons remote. It sends a simple MQTT message when one of the button is pressed, the data field corresponds to the button.
“{“Time”:“2021-06-12T10:00:19”,“RfReceived”:{“Sync”:10330,“Low”:340,“High”:1040,“Data”:“640A88”,“RfKey”:“None”}}”
Of course, I can just use rednode to get this mqtt message (as I did for debug), but I do not find this very “clean”. I have 4 remotes with 4 buttons each, they only differ by the value of the data field. This does not leads to very readable code.
I would like to have some sort of entity, sensor, etc defined in HA with a readable name (e.g. ButonA_Remote1) . To make a comparison with programming, it’s like using a constant well defined in a program instead of using a value hard coded. Both works, but having a constant makes things more clear. So having an ‘entity’, sensor, etc natively from HA would ease maintenance and readability.
What is the best way to integrate such a remote into HA ? my remote does not seems to be a binary_sensor since the remote button has no state (i.e. the MQTT message is only send when the button is released).
So from my understanding, it would be something like an “event” but I do not really know how to define it.
Can you help me with this: what kind of HA 'object (entity, sensor, etc) is the most suitable and how to implement it (a link to en example would be enough)
Thanks for your help