Alexa and emulated hue gets That value is out of range for device X response

Been using home assistant with emulated hue and Alexa for a while now.

Then early this week my pi3 had a meltdown. So I had to restore.

Restored from a week old snapshot on 96.3 but this caused Alexa to refind all my emulated hue devices. Also updated to 97.2

Since then when asking Alexa to turn on a device the device turns on but Alexa responds with “That value is out of range for device X”

I did have similar issue a while ago which I fixed using a modified custom emulated hue. But that fix doesn’t seem to work this time.

a1c57b2 commit from this link

Any ideas

Had a similar issue here and found a workaround (also v0.97). I have several “switch” entities exposed to Alexa, which suddenly stopped working few days ago. Turned out that port 8100 didn’t work anymore and I had to switch to 80. After trying out some things, I ended up with having connection again but the error you mentioned occured. Lights (i.e. switches) would switch on and off in a sec while Alexa said the “value is out of range for device…”. Those devices didn’t appear as “binary” anymore (on-off). Alexa showed the option to adjust brightness and would give back the mentioned error, even when set to 100%. However, I came across one device that still appeared “binary” and that one was “on” while I let Alexa look for new devices. Tried that with the other and bingo - got all of them as “binary” back again and Alexa was fine… :wink:

So, here’s the workaroudn in a nutshell:

  1. Remove “broken” device from Alexa
  2. Switch “on” the device in Home Assistant
  3. Let Alexa look for new devices.

Voila! Hope this helps…

And here’s my (unqualified) theory after some digging:

I took a look at how devices are exposed via [emulated_hue_ip]:[port]/api/pi/lights/ (e.g. http://192.168.1.8/api/pi/lights)

Those devices that did not appear “binary” in Alexa had a 0 in values hue and saturation. After switching them on in HA these values changed to NULL.

Extract:

Working: Light Livingroom being switched on and interpreted as “binary” switch
“2”: {
“modelid”: “HASS123”,
“name”: “Light Livingroom”,
“state”: {
“bri”: 0,
“hue”: null,
“on”: true,
“reachable”: true,
“sat”: null
},

Not working: Light Livingroom being interpreted as “dimmable”
“2”: {
“modelid”: “HASS123”,
“name”: “Light Livingroom”,
“state”: {
“bri”: 0,
“hue”: 0,
“on”: false,
“reachable”: true,
“sat”: 0
},

Hope this helps fixing the bug!

2 Likes

Another workaround - that will break the dimming feature, but works without having the devices switched on.

Be aware: this is really realy dirty! :smiley:

  1. Copy current emulated_hue to custom_component
    grafik
  2. change output of hue and sat to “none” in hue_api.py

Has the same effect as described above, but for ALL devices exposed via emulated_hue…

I did find a problem so maybe just for switches you need this as Alexa seems to add a device by default as a light - which is the problem. I have already done the port 80 change

So, here’s the REVISED workaround in a nutshell for switches (Sonoff Tasmota):
1. Remove “broken” device from Alexa App
2. Switch “on” the device in Home Assistant (can be multiple)
3. “Add New Device” select “Switch” and then “Other”
4. Let Alexa discover new devices.

Hope this works for you and keeps the wife happy :o)

1 Like

Can confirm the same “value is out of range for device X response”.

Updated to 0.99.0 yesterday, and have changed to port 80 from 8300, the problem still persists.

The above does work.

What above? I’ve done as suggested by @eldotta and the problem persists.

I just fixed my Alexa not talking to Hassio after adding a brand new dot (newer version). I switched to port 80 but when I added devices she would respond with “value is out of range for device X.” So I completed what @monbotpoo described. Went to the alexa app on my phone and deleted all the devices one by one. Turned on all the devices in Hassio and then in the alexa app:

To set up each device as a switch with on/off values instead of a light with dimming percentages.

This indeed worked and the documentation needs to be updated to let others know.
EDIT: IT DID REVERT BACK. UGH!

The method worked for a while, but it happens again the next day. How do i fix it permanently?

If you change ports you gotta rediscover. Also if you are running on hassio, you cannot change to port 80 because the hass user doesn’t have access to port 80.

This 100% depends on the number of alexa’s in your house.

For some inexplicable reason, amazon is rolling out firmware changes slowly (to gen1/2 echo dots). I have 2 dots, and it took 2 weeks to roll out the firmware to both devices. After the first device updated to the latest firmware, a simple home assistant restart fixes the issue if the other dots are on the old firmware. This unfortunately masks the issue for many people because they think they fixed everything. Then the second dot gets updated and everything breaks again. Rinse and repeat. Finally, when the last dot updates you can no longer ‘fix the issue’ and have to switch to port 80 and rediscover new devices and delete old devices. After that, there have been reports of still getting ‘x does not respond’ but the lights will turn on. But it’s unclear if these people have deleted the old devices or not. Personally, I have an instance of HA running with emulated hue connected to alexa on port 80 without any ‘x does not respond’. Because this issue is so wide spread and half of the users don’t know what they are doing, we don’t actually know the full extent of the issue. There is a PR out there that claims to fix the issue that may be merged soon. I personally am skeptical whether or not it will fix things.

1 Like

thank you. i remember there is another way to expose HA to Alexa, apart from emulated hue, maybe it s best to explore other options now?

On hassio 99.3, tried the remove device from alexa, turn it on in HA, and rediscover in Alexa. Still have the problem.

The potential fix for the communication hasn’t been merged yet. Also, you’ll still need to move to port 80 as there isn’t a fix for the port move.

I’ve resorted to always keep a custom_component for emulated_hue and brute force comment out any and all dimming settings that keep regressing almost every update. Somewhere in the hue<->alexa communication something always breaks and i don’t think it’s the component. I have tested factory fresh alexa straight out of the box, factory reset existing alexa (old and new), and the only common ground i can find is that from my 7 devices at least 6 report either value out of range with “stock” hue_api.py or a 90% chance of a comment “device x doesn’t seem to work properly” although it works.
So in conclusion here are my suspected factors for getting this:

  • something like if (entity_features & SUPPORT_BRIGHTNESS) or entity.domain != light.DOMAIN: (current line 574 in hue_api.py) does its best but does not work (i’ve seen many iterations of this)
  • the state of the device at (alexa-)discovery time may or may not play a role for above detection to work although i have had it go both ways
  • removing and re-discovering devices in a alexa may or may not be enough, i’ve had instances of (ghost) devices that survived until factory reset no matter what the json sends or doesn’t send
  • since there is very limited control or debugging for local alexa i’m afraid that game will be played forever and i’m of the opinion that alexa shuffles around things seemingly randomly. I tried keeping track of dot updates but even that doesn’t seem to be consistent. Emulated_hue is the best shot we got, and i’m happy we have it but it is a nightmare for switch users. I can’t tell if it is better for light hardware since i have none.

That being said, having to listen to “device x is not working properly” or whatever local equivalent is grating, especially in the middle of the night.

Yep, that’s part of the reason I left emulated_hue.

This is the other reason. Alexa clearly has a caching issue with discovery and performing a delete does not rectify the issue. I’d be willing to bet that only a factory reset will actually get rid of them.

I moved over to Alexa Smart Home Skill of Haaska. More functionality, Free, and NabuCasa uses the same component on home assistants side. So you can bet your ass that they will keep it up to date and working with alexa. Theres only 2 drawbacks: 1. It’s not a simple setup. 2. The commands to the lights are not local.

As for the more functionality, with this component everything differentiates itself. I.E. a dimmer is a dimmer, a switch is a switch, a cover is a cover, etc. They also have specialized commands like “alexa open x window” instead of us having to fake out a light. You can also query sensors that are connected “alexa, whats the temperature in the living room?”.

  1. It’s not a simple setup.

At this point i’d be willing to work my way reverse translating mongolian pdfs if need be, given the time i invested in trying to make local alexa a thing.

  1. The commands to the lights are not local.

That’s a much harder pill to swallow. I really use home assistant in the first place because it allows me to be completely local. But then again, who am i kidding - this is a thread about alexa :yum:

Even when the calls are local on alexa, if she doesn’t have internet, she doesn’t work. That was my reasoning for swallowing that pill.

I’m still waiting on a semi-easy to setup open source voice platform. Whenever that appears, goodbye alexa.

@petro Did you look at this? I did some reading but never pursued it…

Looked at it a while back. It’s in it’s infancy and very experimental but who knows how it may progress. One thing is for sure though. Alexa doesn’t want anyone using her outside of the cloud.