I’m quiet new to the HA system, so I’m not sure whether something like this already exists, but so far, I haven’t found anything so, here it goes:
I’m looking to design a custom switch which would be able to have multiple states.
In this case, I want to add a 433MHz RF receiver to my sound system, and send commands to it from either a Raspberry Pi, or a USB emitter. I would like HA to have something that could look like a TV remove, and when you’d press a button, a certain command (pything script) would be executed. This is quiet similar to the “command_swich”, yet it should have more states than just “ON” and “OFF”.
I suggest that you have a look at the Switch template and create one for every state. So every state you want to control will have its own ‘on’ and ‘off’ state.
Thank you for this answer. Although, I’m not sure I fully understand how this can be implements to suit my needs.
My understanding is that the switch_template would sort of “sync” various swtiches. Is that right? If so, can this also work with command_switches?
If I follow your explanation, I should have command_switches such as: