Change color of elements

And i just posted something on this a few minutes ago here: https://community.home-assistant.io/t/how-to-set-up-layers-for-different-floorplans/39920/16

When using different layers, you may find that you want to use the same entity in different layers. I found an easy workaround for this for most of my devices, ie MQTT devices. The workaround I found for these duplicate entities is to create a new entity per different layer as follows:

  • name: “Stairs”
    command_topic: milight/EDIT/rgb_cct/1
    state_topic: milight/updates/EDIT/rgb_cct/1
    <<: &MILIGHT_PARAMS
    platform: mqtt_json
    computed_color: true
    color_temp: true
    brightness: true
  • name: “Upstairs Stairs”
    command_topic: milight/EDIT/rgb_cct/1
    state_topic: milight/updates/EDIT/rgb_cct/1
    <<: *MILIGHT_PARAMS #copy of light.stairs created for floorplan multilayers
    Not the prettiest solution, as it adds a lot of unneeded code, but it works. Since these duplicated entities use the same MQTT topics, their statuses are linked and update at the same time on all layers. Sweet!

For the only other type of entity that I have on several layers, ie. camera, I just created a group with only that entity. This kinda works, but looks a bit crappy… Snapshot displays, but unnecessary info is added and no correct status (‘Streaming’, ‘Recording’ or ‘Idle’) is associated. I might have to look into @pkozul’s latest published camera implementation of floorplan, but that would involve editing the changes made in the HA-floorplant.htm and that could take more time than I have.

Let me know, if you found another more elegant solution…