Can you customize binary sensors for more usable name?

Morning All,

I have just got a Xiaomi Gateway and a few switches. It all works fine but it would be nice if I could somehow rename the switches.

I’ve tried the following in customize.yaml:

  friendly_name: "Switch TA1"

  friendly_name: "Switch TA2"

I tried the above in the hopes I could just call “binary_sensor.switch_TA2” in my automation but it doesn’t work. Of course “binary_sensory.switch_158d0001b86c49” does work though.

Just a side note I also couldn’t figure out how to differentiate between single and double clicks with HASSIO’s in-built automation system. I tried the following to no avail:

Trigger Type:
Event Type:
Event Data:
  "entity_id": "binary_sensor.switch_158d0001b86c49"
  "click_type": "double"

The “friendly_name” attribute is for human readability only. You must use the actual entity name in your automation. However, you could create a Template Binary Sensor and give it whatever name you choose.

That’s fair. The only thing throwing me off is my broadlink, when I use switches on that the friendly name is the switch name opossed to the name I use:

  friendly_name: "Night Light"
  command_on: ''
  command_off: ''

That is called with switch.night_light and not switch.plug_003a. I’ll go with the template binary sesnor to route it that way, I even thought of that but ignored it for some reason.

Any idea on the double / long click?

There’s an open issue about the broadlink switch.