Ok, so I have a broadlink RM pro that I have configured to control a few outlets and my bedroom fan. Works great and I will provide my configuration below. I also have a Sonoff RF Bridge flashed with OpenMQTTGateway that allows me to listen for RF remotes such as the remote for my outlets and my bedroom fan. Obviously when you control any of those devices through HA, you HA is aware of its state. The problem is that if i control the device through a remote, HA wont be aware of its current state as it obviously interfaces directly with the device. Thus the reason for the openmqttgateway. So what I am thinking I can do is have the remotes work like normal, but openmqttgateway will pass on its received RF code through mqtt and i now need to figure a way for HA to simply update/toggle that devices state instead of actually performing the action on the device since that was already done by the remote. Make sense?
Also, in case it makes a difference, my outlets do have an on button and and off button so the rf codes will be different, but the bedroom fan is simply a toggle.
In configuration.yaml:
switch: !include switches.yaml
In switches.yaml:
platform: broadlink
host: 192.168.1.211
mac: '34:ea:34:89:19:23'
switches:
outlet_1:
friendly_name: 'Lamp 1'
command_on: 'sgYyAAcSEwYHEgcSBxITBgcSEwYHEhMGBxITBgcSEwYHEhMGBxIHEhMGEwYHEgcSEwYTBge6AAAAAAAA'
command_off: 'sg4yAAcSEwYHEgcSBxITBgcSEwYHEhMGBxITBgcSEwYHEhMGBxIHEhMGEwYTBhMGBxIHEge6AAAAAAAA'
outlet_2:
friendly_name: 'Lamp 2'
command_on: 'shIyAAcSEwYHEgcSBxITBgcSEwYHExMGBxITBgcSEwYHEhMGEwYTBgcSBxIHEgcSEwYTBge6AAAAAAAA'
command_off: 'sgwyAAcSEwYHEgcSBxITBgcSEwYHEhMGBxITBgcSEwYHEhMGEwYTBgcSBxITBhMGBxIHEge6AAAAAAAA'
outlet_3:
friendly_name: 'Lamp 3'
command_on: 'sggyAAcSFAYHEgcSBxITBgcSEwYHEhMGBxITBgcSEwYTBhMGBxIHEgcSBxIHEgcSEwYTBge6AAAAAAAA'
command_off: 'sgsyAAcTEwcHEwcSBxITBgcSEwYHEhMGBxITBgcSEwYTBhMGBxIHEgcSBxITBhMGBxIHEge6AAAAAAAA'
outlet_4:
friendly_name: 'Lamp 4'
command_on: 'shQyAAcS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