ESPHome Light Not Turning on Through Hue App

Hi there, I have flashed a Lohas 9W smart bulb with ESPHome using tuya-convert and have successfully got it to work using Home Assistant. I have also managed to get the light to appear in the Hue app and it is added to the app. However, when i turn the light on in the app, the bulb fails to turn on. It seems like the app isn’t communicating with ESPHome despite having the correct YAML configurations. Here is my YAML configuration:

esphome:
 
  name: lohas_cct
  platform: ESP8266
  board: esp01_1m
  includes:
    - diyhueasyncudp.h
  libraries:
    - ESPAsyncUDP
 

custom_component:
- lambda: |-
    auto diyhue = new diyhueudp();
    return {diyhue};
 
wifi:
  ssid: XXXXXXXX
  password: XXXXXXXXX
 
  ap:
    ssid: Lohas1
    ap_timeout: 3min    

captive_portal:

logger:

ota:

web_server:

api:

switch:
  - platform: template
    name: alert
    id: alert
    optimistic: true
    turn_on_action:
      - light.turn_off: color_led
      - light.turn_on:
          id: white_led
          brightness: 100%
          color_temperature: 4000 K
      - delay: 1s
      - light.turn_on:
          id: white_led
          brightness: 10%
          color_temperature: 4000 K
      - delay: 1s
      - light.turn_on:
          id: white_led
          brightness: 100%
          color_temperature: 4000 K
      - delay: 1s
      - light.turn_on:
          id: white_led
          brightness: 10%
          color_temperature: 4000 K
      - delay: 1s
      - light.turn_on:
          id: white_led
          brightness: 100%
          color_temperature: 4000 K
      - switch.turn_off: alert
  - platform: template
    name: entertainment_switch
    id: entertainment_switch
    optimistic: true

output:
  - platform: esp8266_pwm
    id: output_red
    pin: GPIO5
  - platform: esp8266_pwm
    id: output_green
    pin: GPIO4
  - platform: esp8266_pwm
    id: output_blue
    pin: GPIO13
  - platform: esp8266_pwm
    id: output_cold_white
    pin: GPIO14
  - platform: esp8266_pwm
    id: output_warm_white
    pin: GPIO12

light:
  - platform: rgb
    id: color_led
    name: "color_led"
    red: output_red
    green: output_green
    blue: output_blue
    default_transition_length: 0.4s
    effects:
      - random:
           name: Random Effect With Custom Values
           transition_length: 5s
           update_interval: 3s
 
  - platform: cwww
    id: white_led
    name: "white_led"
    warm_white: output_warm_white
    cold_white: output_cold_white
    cold_white_color_temperature: 6000 K
    warm_white_color_temperature: 2700 K
    default_transition_length: 0.4s

text_sensor:
  - platform: template
    name: "light_id"
    id: light_id
    lambda: |-
     return {"esphome_diyhue_light;XX:XX:XX:XX:XX:XX;lohas_cct;0;0"};
    update_interval: 24h

I am running on a rpi3+ and have diyhue installed via docker. I have tried to debug the docker using this command:
sudo docker run -e "DEBUG=true" -d --name diyHue --restart=always --network=host -e MAC=XX:XX:XX:XX:XX:XX -v /mnt/hue-emulator/export:/opt/hue-emulator/export diyhue/core:latest

however this only starts the container and doesn’t output any logs. Is this the correct command?

Any help would be much appreciated, thank you.

Did you replace all the x values with the actual values? Ex the Mac address for the container?

Yes, sorry, the X’s were just for this post.

When you say there are no logs, do you mean you ran docker logs and see no output?

Yeah, I run the docker command from above and then the container starts but no logs appear in the command line.

This is a very late reply, but to answer your question, nothing will show up in the command line as that is expected. You need to utilize docker logs as mentioned earlier. Perhaps a simple docker tutorial will be able to teach that.

Hi @Jay, sorry for bumping an old topic but I was wondering if you ever fix your problem. As you can see in this thread:(Light is detected but the Hue app can't control anything)
i’m having the same problem as you.

Cheers.

Hi quoije,

I can confirm that switching from the master to the master-refactor branch fixed this issue for me. I believe that the master-refactor branch is now the default so make sure you’re running that branch and check again.

That actually works. Thank you very much :slight_smile:
Have a great day!

No worries, glad you got it working! You too!