upsert / lutron-caseta-pro

Custom Home Assistant Component for Lutron Caseta Smart Bridge PRO / RA2 Select
Apache License 2.0
183 stars 38 forks source link

Add support for entity registry in Home Assistant #3

Closed upsert closed 6 years ago

upsert commented 6 years ago

Add support for the Entity Registry in Home Assistant.

sknolin commented 6 years ago

This would be a good feature. For example - " If lights or shades are assigned to an area in the Lutron app, the area name will be prepended to the entity_id. e.g. for area 'Dining Room', it would be light.dining_room_ceiling_light" - in the android app at least, you have no choice, you must assign a room.

This required some creative "room" naming to work well for me to avoid awkward names.

darkmaestro3e8 commented 6 years ago

I agree that the Entity Registry would be a great feature. By the way, great work on this component @upsert. You really should consider making this a core component at some point in the future. I believe a lot of home assistant users would agree that making our homes "future proof" is a big part of the reason we've selected the DIY route to run our own hubs locally. For that reason, your component is far superior to the core Lutron Caseta component and the main reason I personally switched over to the Pro Hub. I think you'd get a lot of support from the community if you added this in. Keep up the good work.

@sknolin - Don't forget you can still customize entity naming and icons if you don't like the names that come out of the Lutron app. Some of those names can be a bit cumbersome.

https://www.home-assistant.io/docs/configuration/customizing-devices/

upsert commented 6 years ago

I'm not sure the best way to implement this. The Integration Report has IDs but has no unique identifier for the hub. Use of IP address is also not recommended as a base for a unique ID.

I could do it if there was a MAC address put in the configuration by the user:

lutron_caseta_pro:
    bridges:
      - host: IP_ADDRESS
        mac: aa:bb:cc:dd:ee:ff
        switch: [ 4, 5 ]
        cover: [ 11, 12 ]

Unique IDs would be MAC-IntegrationID. The MAC address is written on the bottom of the hub. In practice it could be anything non-conflicting with other devices, but it seems easier to have people use the MAC address.

It makes it a little more complicated to configure overall so I might see if I could make it an optional feature. If Home Assistant does not support it as optional, it would be a required config and a breaking change.

upsert commented 6 years ago

If someone wants to test my implementation, that would be great: https://github.com/upsert/lutron-caseta-pro/archive/entity_registry.zip

I've done it on a separate branch because I am a little paranoid about breaking things and used to branching. I will merge it once I get some feedback and do more testing.