Control ESPHome light via Philips Hue app

I found a solution to make a light (in my case a Neopixel led strip) available in the Philips Hue app, appearing as a normal full-colour light.
It seems not possible to create an entity in Home Assistant somehow that (via the ZHA Zigbee inerface) emulates a Hue-compatible bulb, other than create a complete Hue Hub replacement with an Raspberry-Pi. But I wanted to stick to the Hue hub I have.


I first coupled a Hue-compatible bulb (in my case an IKEA Tradfri bulb) to the Hue hub. This could have been any Hue bulb, for example one borrowed from your neighbour; but at least not a bulb that you want to pair with your Hue hub later on. Then I paired the bulb with my ZHA hub (but I could have returned it to my neighbour as well).
This leaves the bulb visible in the Hue app, but with the remark “Not reachable/Niet bereikbaar”. However, I can fully control it. In Home Assistant, it was listed as light.extended_color_light_1_2.
Then, I create an automation:

alias: Glow follower
description: ''
trigger:
  - platform: state
    entity_id: light.extended_color_light_1_2
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: light.extended_color_light_1_2
            state: 'off'
        sequence:
          - service: light.turn_off
            target:
              entity_id: light.neopixel_light_2
    default:
      - service: light.turn_on
        target:
          entity_id: light.neopixel_light_2
        data_template:
          brightness: '{{ state_attr(''light.extended_color_light_1_2'',''brightness'') }}  '
          rgb_color: '{{ state_attr(''light.extended_color_light_1_2'',''rgb_color'') }}  '
mode: single

The light I control with it is in this case light.neopixel_light_2, an entity created with ESPHome.
The result is a bulb in the Hue app, that can be part of any scene there, and a physical light that responds perfectly.
Two drawbacks so far:

  • The test “Niet bereikbaar” in the Hue app is not so elegant for a light that just works fine.
  • The response is a bit slower than for a regular Hue light, since there is some indirect communication.

If someone else has a different, maybe better implementation, please share. I would also be happy to learn how I can create a Blueprint out of this, to make it easier to deploy for others.

I created a Blueprint out of this. Easier to configure. And I suppose this can be used for any color light to be coupled. No need to explicitly switch off, since brightness=0 is the same as calling the turn_off service.

blueprint:
  name: Hue light follower
  description: Have any light follow a Hue (dummy) light
  domain: automation
  input:
    master:
      name: Master light
      description: This light will be the master.
      selector:
        entity:
          domain: light
    slave:
      name: Slave lights
      description: The light(s) to keep in sync.
      selector:
        target:
          entity:
            domain: light

mode: single    

trigger:
  - platform: state
    entity_id: !input master

action:
  - service: >

action:
  - service: light.turn_on
    data_template:
      brightness: "{{ trigger.to_state.attributes.brightness }}"
      rgb_color: "{{ trigger.to_state.attributes.rgb_color }}"
    target: !input slave

Updated version:

blueprint:
  name: Hue light follower
  description: Have any light follow a Hue (dummy) light
  domain: automation
  input:
    master:
      name: Master light
      description: This light will be the master.
      selector:
        entity:
          domain: light
    slave:
      name: Slave lights
      description: The light(s) to keep in sync.
      selector:
        target:
          entity:
            domain: light

mode: single    

trigger:
  - platform: state
    entity_id: !input master

action:
  - choose:
      - conditions:
          - condition: state
            entity_id: !input master
            state: 'off'
        sequence:
          - service: light.turn_off
            target: !input slave
    default:
      - service: light.turn_on
        target: !input slave
        data_template:
          brightness: '{{ trigger.to_state.attributes.brightness }}'
          rgb_color:  '{{ trigger.to_state.attributes.rgb_color  }}'

Hi,
I am building a 16x16 led matrix with ESPHome and I want to add it to my hue hub.

Do I still need to pair a hue bulb to take over its entity?

As far as I know, yes. I don’t know if other methods for adding entities to Hue.