core: Emulated Hue: Device Unresponsive

Home Assistant release with the issue: 0.98.2

Last working Home Assistant release (if known): 0.97.2

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io

Component/platform: /components/emulated_hue/

Description of problem: My Alexa devices have been having trouble connecting/controlling the exposed lights and scripts in my Home Assistant instance. I suspect that this has to do with the latest Alexa update (iOS version 2.2.291375.0), since I that was right around when the issues started occurring.

I have checked to make sure that the integration is loaded and responded by navigating to http://HA-IP-Address:8300/api/pi/lights and seeing the correct list of devices.

I have deleted and re-added all of the devices 4 or 5 times and each time I see the same issue. After using the app to turn on the light, I see the message “Waiting for Royal Phillips Electronics”, then the light turns on and then the app gives one of 2 messages: “Device malfunction” or “Device is unresponsive”. After that I only ever see the error messages and the lights will not change.

Related to this could be the the new setting on the Alexa app. For all the device I’ve added (switch, script, etc.) there is a color setting with the ability to set a color. I’m not sure if the app is trying to set a color and being unsuccessful. When I go into the settings (on the Alexa app) for the entity I see the following information:

  • Connected via: [Echo Device]
  • Description: Royal Phillips Electronics smart device
  • Type: Light
  • Color Capabilities: Color
  • Enabled: True

For reference, the devices being exposed are 2 scripts and 3 GE smart light switches with dimming capabilities. They were working perfectly up until about a week ago.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

emulated_hue:
  host_ip: !secret hass_ip
  listen_port: 8300
  expose_by_default: false
  entities:
    light.ge_14295_in_wall_smart_toggle_dimmer_level:
      name: "Living Room"
      hidden: false
    light.ge_14295_in_wall_smart_toggle_dimmer_level_2:
      name: "Kitchen"
      hidden: false
    light.ge_14295_in_wall_smart_toggle_dimmer_level_3:
      name: "John's Room"
      hidden: false
    switch.monitors:
      name: "Monitors"
    script.tv_up:
      name: "Volume Up"
      hidden: false
    script.tv_down:
      name: "Volume Down"
      hidden: false

Traceback (if applicable):


Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 34 (6 by maintainers)

Most upvoted comments

I’ve been doing some digging in to this. and have sniffed the network traffic between HA and Alexa to try and work out what is going on.

The issue appears to be with alexa ‘checking’ the bri: value after turning on the light. If the value is still ‘0’ then it makes another request to set the brightness, which doesnt work properly and then reports “That value is out or range for device ____”

The exact symptoms I have is that emulated hue works perfectly for any device which has a (genuine) brightness component, but reports “value out of range” for anything which does not (i.e. switches).

For completeness here is (the important part of) my config.yaml:

switch:
  - platform: mqtt
    name: Aquarium
    command_topic: '/RF_Bridge/cmd'    
    payload_on: 'RC,on=41'
    payload_off: 'RC,off=41'  
    
    
emulated_hue:
  listen_port: 80
  expose_by_default: false
  
  entities:
    light.livingrm_side:
      name: "test"
      hidden: false
    switch.aquarium:
      name: "fish tank"
      hidden: false

Light.Livingrm_side is a dimmable TRADFRI bulb Switch.aquarium is an mqtt controlled RF smart plug

A Summary of the network traffic seen when attempting to control switch.aquarium: “Alexa turn on fish tank”

Alexa -> HA:    PUT request with JSON {"on":true}
HA -> Alexa:    200 'OK' with JSON {"success": {"/lights/switch.aquarium/state/on": true}}
Alexa -> HA:   GET
HA -> Alexa:    {"modelid": "HASS123", "name": "fish tank", "state": {"bri": 0, "hue": null, "on": true, "reachable": true, "sat": null}, "swversion": "123", "type": "Dimmable light", "uniqueid": "switch.aquarium"}
Alexa -> HA:   PUT {"bri":254}
HA -> Alexa:   200 'OK' with JSON {"success": {"/lights/switch.aquarium/state/on": false}}, {"success": {"/lights/switch.aquarium/state/bri": 254}}
Alexa -> HA:   GET
HA -> Alexa:   {"modelid": "HASS123", "name": "fish tank", "state": {"bri": 0, "hue": 0, "on": false, "reachable": true, "sat": 0}, "swversion": "123", "type": "Dimmable light", "uniqueid": "switch.aquarium"}

It appears Alexa requests to turn the switch on (PUT), which is successful. Then checks on it (GET) and is not happy that the brightness value is zero, so makes a second request (PUT) to set the brightness to 254. This ‘works’ but has the result of HA turning the light off again.

That’s all I’ve got for now…I’ll see if I can make any sense of the emulated hue code as to why this happens when I have time!

@eracknaphobia that’s funny because I thought they would at some point.

@novitibo did you read the response? You seemed to gloss over the setup that doesn’t cost money and focus on the $5 Nabu Casa portion.

Best alternative at this point is to switch to the Alexa Smart Home Skill.

I dropped emulated hue because it constantly breaks because there’s about 5 different developers making their own ‘enhancements’ over the past 5 months. Then the latest amazon port change sealed the deal.

All of this coupled with the fact that Phillips hue could drop support for hue bridge gen 1’s at any moment. Meaning Amazon could follow suit.

Maybe I’m missing something here but the if statement to determine what attributes are returned doesn’t look right to me?

if (entity_features & SUPPORT_BRIGHTNESS) or entity.domain != light.DOMAIN

That looks like it says, if the entity supports brightness OR is not in the light domain. If this is matched, state, brightness, hue , and sat are returned. Otherwise only state is returned. Shouldn’t it be if (entity_features & SUPPORT_BRIGHTNESS) or entity.domain == light.DOMAIN?