Broadlink Switch unique ID issue

Hey, I’m trying to setup my broadlink RM4 mini with a couple devices as switches but when i look under entities they show up as read-only due to missing unique ID.
I have friendly names setup but cannot set unique ID for the switches so unsure what i need to do
My config is shown below

switch:
 - platform: broadlink
   host: 192.168.20.17
   mac: 24:DF:A7:34:BB:EA
   timeout: 15
   switches:
     aircon_remote:
       friendly_name: "Air Con"
       command_on: 'JgCSAAABJJMWEhUSFxEVEhYSFRIWEhUSFjYWERYSFjYWERYSFRIWEhUSFhIVEhYSFRIWNhcRFRIWEhUSFhIVEhY2FxAWNhYSFhEWNhUSFgACkBUSFhIVEhYSFRIWEhUSFhIVEhY2FhIVEhYSFRIWEhUSFhIVEhYSFhEWEhYRFhIWEhUSFhIVEhYSFjUWNhYRFhIWAA0FAAAAAA=='
       command_off: 'JgCSAAABJpEWEhcRFhEWNhYRFhIWERYSFjYVEhYSFTYWEhYRFhIVEhYSFRIWEhYRFhIWNhYRFhIWERYSFRIWEhU2FhIWNRcRFhIVNhYSFgACjhcRFRIWEhYRFhIWEhUSFhIVEhY2FhEWEhYRFhIWEhUSFhIVEhYSFRIWEhYRFhIWERYSFhEWEhYSFTYWNhYRFjYWAA0FAAAAAA=='
     tv_remote:
       friendly_name: "TV"
       command_on: 'JgBGAJOTEjcSNxI3EhISEhISEhISEhI3EjcSNxISEhISEhISEhISEhI3EhISEhISEhISEhISEjcSEhI3EjcSNxI3EjcSNxIABfgNBQ=='
       command_off: 'JgBGAJOTEjcSNxI3EhISEhISEhISEhI3EjcSNxISEhISEhISEhISEhI3EhISEhISEhISEhISEjcSEhI3EjcSNxI3EjcSNxIABfgNBQ=='

unique_id is not implemented for broadlink (it must be done in code), so there’s nothing you can do from your configuration to fix that I’m afraid.

1 Like

Damn, I can use scripts to get by for now.
Do you know if there are currently plans to fix this? I’ve got quite a few devices I’d like to control through Broadlink + switches

What do you need the unique_id for ?

To toggle the state, without a unique ID its read-only

???

The unique_id has nothing to do with the state ? States are toggled by the enitity_id.

1 Like

You were right after taking another look at the logs i had another error (Failed to send packet: The device storage is full), after defining the device type to fix this i can now toggle the device properly

The unique id is only used by Home Assiatant to map a device to a configuration, so you can change for instance friendly name or entity id. It doesn’t affect functionality of the integration otherwise (as already mentioned). There is however a PR open for adding config flow for broadlink, which adds unique id since that is needed for config flows. So it will come.

1 Like

For switches it unfortunately stayed the same after this PR, so this feature is still wanted.

Sorry to ressurect the thread, but is it at all possible to add a unique_id (so i can set a room etc.) to a ‘switch’ that uses the Broadlink platform to send the RF command to turn the switch on and off? At the moment i have the switch working and showing up in the main UI however as it doesnt have a unique_id it cant be assigned to a room… anyone have a trick to doing it?

3 Likes

Hello everyone!

It seems that unique_id management is still not yet functional for switches. Is there a way to do add one in order to manage yaml-added-switches from the UI?

Unique_id management would allow me to add those switches to a room via the GUI and associate some labels. This would be a big plus.

The code could look like this in yaml

  - platform: broadlink
    mac: 'AA:BB:CC:DD:44:55'
    switches: 
      - name: 'Ampli'
        command_on: 'XXXXXXXXXXXXXX'
        command_off: 'YYYYYYYYYYYYYYY'
        unique_id: b3a3dfb26-c32836a092c6=

I can open a request on github if needed.

Thanks

I vote for this feature too.