Home Assistant release with the issue:
0.103.0
Last working Home Assistant release (if known):
0.102.3
Operating environment (Hass.io/Docker/Windows/etc.):
Docker
Integration:
Emulated Hue
Description of problem:
After updating to 0.103.0 I had some issues with Alexa, so I forgot all devices and run a discovery, however only half (5/10) of my exposed devices were found by Alexa. Since those were working, I figured there's no issue with the configuration, so after checking the api endpoint at http://<IP>:8300/api/pi/lights
, I noticed that half of the devices were given as "type": "On/off light"
(exactly the missing ones) whereas the other half was "type": "Dimmable light"
(the working ones). I went back to 0.102.3 where all devices are given as "type": "Dimmable light"
, and could confirm that all 10 devices are discovered.
It seems Alexa doesn't recognize the "type": "On/off light"
. I'm using a first gen Echo and a second gen Echo Dot.
Example below shortened to two devices.
Problem-relevant configuration.yaml
entries and (fill out even if it seems unimportant):
emulated_hue:
expose_by_default: false
entities:
switch.heating:
hidden: false
script.heating_eco:
hidden: false
Additional information:
Output of http://<IP>:8300/api/pi/lights
.
0.103.0 (first device discovered, second one not)
{
"1": {
"manufacturername": "Home Assistant",
"modelid": "HASS123",
"name": "Heating Eco",
"state": {
"bri": 1,
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "Dimmable light",
"uniqueid": "00:78:23:05:f7:d6:2f:15-0c"
},
"2": {
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "Heating",
"state": {
"mode": "homeautomation",
"on": true,
"reachable": true
},
"swversion": "123",
"type": "On/off light",
"uniqueid": "00:75:ac:58:ce:a7:c6:1d-89"
}
}
0.102.3 (both devices discovered)
{
"1": {
"modelid": "HASS123",
"name": "Heating Eco",
"state": {
"bri": 0,
"hue": 0,
"on": false,
"reachable": true,
"sat": 0
},
"swversion": "123",
"type": "Dimmable light",
"uniqueid": "script.heating_eco"
},
"2": {
"modelid": "HASS123",
"name": "Heating",
"state": {
"bri": 0,
"hue": null,
"on": true,
"reachable": true,
"sat": null
},
"swversion": "123",
"type": "Dimmable light",
"uniqueid": "switch.heating"
}
}
Hey there @NobleKangaroo, mind taking a look at this issue as its been labeled with a integration (emulated_hue
) you are listed as a codeowner for? Thanks!
Thanks @BearWithTie for reporting this. I'm working to configure an environment in which I can reproduce this error. Hoping to have an update in the next day or two if you can bear with me. 馃槈
In the mean time, could you share with me how your entities look, so I know what they actually are (to figure out why your switch.heating
entity is now considered an on/off light). Thanks!
Happy Holidays,
NobleKangaroo
The switch.heating
entity is a template switch and to me it makes sense to have it as an on/off switch/light which it actually is, though I don't mind it being reported as dimmable light.
- platform: template
heating:
friendly_name: Heating
value_template: "{{ ##removed long template## }}"
turn_on:
service: script.heating_heat
turn_off:
service: script.heating_off
I have some Osram Smart+ Plugs connected to my actual Hue and they're reported as "type": "On/Off plug-in unit"
. I don't know if an "On/off light" exists, but my Alexa definitely doesn't recognize it and I guess both would have the same functionality anyway. So maybe it's as easy as changing to the plug-in unit type.
I have a similar issue with a number of Zwave & other devices captured in Emulated Hue. Similar to @BearWithTie, I cleared out the Emulated Hue in HA JSON and Alexa app has only discovered the entities with type of "Dimmable Light" which in my case is 'Bedroom Dimmer Lamp'. All entities with type of On/Off light are not discovered.
My previous working version was 102.2. I haven't reverted version yet but know that they were shown as Dimmable device as my heating on Echo Show would always display a slider bar on screen when I used wake word to trigger it.
Happy to provide any other details to assist if needed. My full JSON is below.
{
"1": {
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "TP General Switch",
"state": {
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "On/off light",
"uniqueid": "00:4b:0b"
},
"3": {
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "Printer",
"state": {
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "On/off light",
"uniqueid": "00:86:5e"
},
"4": {
"manufacturername": "Home Assistant",
"modelid": "HASS123",
"name": "Bedrooom Dimmer Lamp",
"state": {
"bri": 1,
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "Dimmable light",
"uniqueid": "00:51:f2"
},
"5": {
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "Central Heating",
"state": {
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "On/off light",
"uniqueid": "00:b5:1d"
},
"6": {
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "TV Lamp",
"state": {
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "On/off light",
"uniqueid": "00:b7:f8"
},
"7": {
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "Fan Heater",
"state": {
"mode": "homeautomation",
"on": true,
"reachable": true
},
"swversion": "123",
"type": "On/off light",
"uniqueid": "00:12:e8"
},
"8": {
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "Fibaro - OnOff 1 Switch",
"state": {
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "On/off light",
"uniqueid": "00:96:17"
}
}
I have the same issue as the person above. For my lights, I have GE z wave switches and all the switches that are not Dimmers (normal switches) then Alexa doesnt detect them.
In configuration:
emulated_hue:
listen_port: 80
My Description:
<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://192.168.1.133:80/</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>HASS Bridge (192.168.1.133)</friendlyName>
<manufacturer>Royal Philips Electronics</manufacturer>
<manufacturerURL>http://www.philips.com</manufacturerURL>
<modelDescription>Philips hue Personal Wireless Lighting</modelDescription>
<modelName>Philips hue bridge 2015</modelName>
<modelNumber>BSB002</modelNumber>
<modelURL>http://www.meethue.com</modelURL>
<serialNumber>1234</serialNumber>
<UDN>uuid:2f402f80-da50-11e1-9b23-001788255acc</UDN>
</device>
</root>
My Api Lights when entered under browser under 192.168.1.xxx:80/api/pi/lights/:
{"1": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "When no ones home", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:78:4a:9b:46:8e:ea:e1-eb"}, "10": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "all lights", "state": {"mode": "homeautomation", "on": true, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:c6:04:a6:b5:7a:9c:b0-e3"}, "11": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Hallway", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:4e:5d:02:a3:bc:46:54-07"}, "12": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Fireplace", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:2c:70:98:c1:1f:62:1d-14"}, "13": {"manufacturername": "Home Assistant", "modelid": "HASS123", "name": "Living Room", "state": {"bri": 254, "mode": "homeautomation", "on": true, "reachable": true}, "swversion": "123", "type": "Dimmable light", "uniqueid": "00:f3:07:51:ec:68:2f:71-b0"}, "14": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Island", "state": {"mode": "homeautomation", "on": true, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:d7:ee:8b:79:e1:8b:2f-41"}, "15": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Sink", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:9f:1c:6f:8c:fd:94:a4-f4"}, "16": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Water Heater", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:f3:2c:86:7c:e6:d4:02-6e"}, "17": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Master Bath Fan", "state": {"mode": "homeautomation", "on": true, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:13:04:f9:3d:32:ec:be-3b"}, "18": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Bath Sink", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:9e:2e:ff:0a:06:0a:0d-a8"}, "19": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Bathroom Tub Sw", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:b9:87:4b:81:bd:8f:cf-7e"}, "2": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "When on vacation", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:ee:77:1b:88:c2:86:61-8d"}, "20": {"manufacturername": "Home Assistant", "modelid": "HASS123", "name": "Nursery Light", "state": {"bri": 1, "mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "Dimmable light", "uniqueid": "00:2e:04:66:55:b0:40:8c-86"}, "21": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Humidifier", "state": {"mode": "homeautomation", "on": true, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:86:1e:70:82:b1:e8:ef-a2"}, "3": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "When a guest is home", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:12:4e:40:c5:8e:84:99-39"}, "4": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "all devices", "state": {"mode": "homeautomation", "on": true, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:cd:d9:2d:e1:30:fa:77-31"}, "5": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Front Porch", "state": {"mode": "homeautomation", "on": true, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:81:e1:29:32:80:2d:85-d3"}, "6": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "all switches", "state": {"mode": "homeautomation", "on": true, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:20:1a:da:61:8e:b6:41-f1"}, "7": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "Driveway", "state": {"mode": "homeautomation", "on": true, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:53:1e:2a:b4:18:8b:bb-a3"}, "8": {"manufacturername": "Home Assistant", "modelid": "HASS321", "name": "garage", "state": {"mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "On/off light", "uniqueid": "00:8e:1f:a0:4b:8f:33:73-68"}, "9": {"manufacturername": "Home Assistant", "modelid": "HASS123", "name": "kitchen", "state": {"bri": 1, "mode": "homeautomation", "on": false, "reachable": true}, "swversion": "123", "type": "Dimmable light", "uniqueid": "00:e0:07:4e:d2:99:b5:38-f4"}}
I can provide more information as provided.
Any further info on this? I also saw the same issue after upgrading to 103.x so I rolled back to 102.3 until there's a fix. I can help debug, if additional info is needed. Thanks!
I'm working on identifying what the cause is, after reverting a couple commits manually, but haven't been successful yet in reproducing it with my own setup. May have to add a bunch of testing components to see if I can find the actual cause.
If 102.3 is working perfectly I could use that. Any chance you could share that component in a zip or share with me how you reverted to that specifically?
Thanks, and happy new year!
On December 31, 2019 12:57:09 PM EST, Boris Feldman notifications@github.com wrote:
Any further info on this? I also saw the same issue after upgrading to
103.x so I rolled back to 102.3 until there's a fix. I can help debug,
if addition info is needed. Thanks!--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/home-assistant/home-assistant/issues/30013#issuecomment-569966590
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
I run Home Assistant via Docker so rolling back was as easy as updating the "image" reference in docker-compose to point to the version specific tag:
image: homeassistant/home-assistant:0.102.3
I'd be happy to pull any file out of that docker image if that helps.
The easiest way to repro this may be for you to create a template switch like this:
- platform: template
switches:
alarm_armed:
friendly_name: "Alarm Armed"
value_template: "{{ is_state('alarm_control_panel.home_alarm', 'armed') }}"
turn_on:
service: alarm_control_panel.alarm_arm_away
data:
entity_id: alarm_control_panel.home_alarm
code: !secret alarm_code_int
turn_off:
service: alarm_control_panel.alarm_disarm
data:
entity_id: alarm_control_panel.home_alarm
code: !secret alarm_code_int
Nothing in my config that's an on/off switch (vs. a dimmable light) was discovered by Alexa on 103.x.
I have also rolled back to hassio version 0.102.3 do to this issue. All of my stuff emulated hue stuff is switches & input_booleans (non-dimmable). None were discovered by my Alexa Tap (software version 647588520) on hassio version 103.6.
@balloob: Does it make sense to rollback the the Hue emulation code to the 102.x behavior as @NobleKangaroo is no longer the code owner and his committed changes broke the functionality for many of us using this component?
Yes. A pull request is welcome.
Just for fun, I updated to 0.104 because Emulated Hue had been changed. It still will not let me add new devices (i.e. input boolean). The pre-existing devices are working, however, Alexa responds with "[this device] isn't responding. Please check it's network connection and power supply"
I think this is a cache issue.
Could you try to do a factory reset on the Alexa?
Hi @croghostrider ,
I don't think this is a cache issue on Alexa as I have rolled back to 102.3 and devices were picked up again. It appears to be be a different _Type_ tag for devices in Emulated Hue for 103.0 onwards.
Most of my devices are Binary so transferred to On/Off Switch under 103.0. I had one device which is a Dimmer and that was still found by Alexa discovery on 103.0.
My EH devices list for both (single item only) is as below. This one is not working in latest versions:-
103.0
"5": {
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "Central Heating",
"state": {
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
_"type": "On/off light",_
"uniqueid": "00:b5:1d"
102.3
"4": {
"modelid": "HASS123",
"name": "Central Heating",
"state": {
_"bri": 0,_
"hue": 0,
"on": false,
"reachable": true,
"sat": 0
},
"swversion": "123",
_"type": "Dimmable light",_
"uniqueid": "switch.central_heating_switch
I _think_ that the Alexa device discovery process is ignoring devices due to them being advertised as On/Off Switch type. There _are_ some commercial On/Off devices so Alexa does support this type but maybe one or more of the entity attributes are not populating correctly within Emulated Hue for them to be discovered. The ideal scenario is for these Binary type devices to be identified as an On/Off Switch and pulled into Alexa in that type.
Looking at the one device that _did_ work after 103.0, I notice that there is also a field name BRI which is not present on any other devices. The value is reversed for the same device, but it is present in both 102.3 and in 103.0 for the single device which worked. There are other fields (Hue, Sat) which were previously present and are now missing but as the device below works without them, it's probably not related to them.
103.0
"4": {
"manufacturername": "Home Assistant",
"modelid": "HASS123",
"name": "Bedrooom Dimmer Lamp",
"state": {
_"bri": 1,_
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "Dimmable light",
"uniqueid": "00:51:f2"
102.3
"3": {
"modelid": "HASS123",
"name": "Bedrooom Dimmer Lamp",
"state": {
_"bri": 0,_
"hue": 0,
"on": false,
"reachable": true,
"sat": 0
},
"swversion": "123",
"type": "Dimmable light",
"uniqueid": "light.wall_dimmer_1_level"
Saying all that, I don't want to reset any existing devices but _do_ have a brand new Echo Show 5 so could try discovery on it as that should rule out a local device cache issue. Am I picking you up correctly that you think it is local cache, not some form of Alexa account wide cache?
Hi @croghostrider ,
When I do a factory reset on the Alexa. I am unable to add any devices back to the Alexa as all of my emulated_hue devices are On/Off. When I downgrade again all the devices are found.
I think I've solved it - the affected devices' 'type' attribute seems to be unknown to Alexa. I've extracted a working value from my physical Hue bridge and created PR#31330. This also circumvents the issue from prior versions, where Alexa could see and turn on/off the affected devices, but would always give you a verbal error response.
In the meantime, you can duplicate the 'emulated_hue' folder to your _config/custom_components_ and apply the 1-line-change from the PR yourself (see also official docs on custom components)
@xtools-at did you actually test your change?
I had already written on Dec 20th that the original Hue provides the type as "On/Off plug-in unit" rather than "On/off light", however I couldn't get it to work just changing the string.
To be sure I just updated to 0.105.0b2 which includes your PR, but it's still not working on my side and Alexa doesn't pick up the on/off entities.
@balloob I suggest reopening this issue as it seems it's not fixed.
Thanks for the heads-up! I had the entitities connected before to Alexa once by using 'Dimmable Lights' as type as a workaround. I did remove them and was able to reconnect them, but I admit this is no thorough testing.
I found some more attributes which may be important and will do some extensive testing, I'd also suggest to reopen the PR.
Hmmm I seem not to not get them to work.
This is part of my /api/pi/lights
output:
"1":
{
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "Ambilight",
"state":
{
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "On/Off plug-in unit",
"uniqueid": "00:51:f1:ea:ef:7f:8d:52-d8"
},
It's picked up by Alexa after deleting it again and again, as device type "Other" in the Alexa App.
Here's the "real" Hue JSON in comparison. The only meaningful difference I've found and that may be worth trying is adding retval["productname"] = "On/Off plug"
Other than that, we could try and add step-by-step a config
and capabilities
, and spoof modelid
and manufacturername
"7": {
"state": {
"on": true,
"alert": "none",
"mode": "homeautomation",
"reachable": true
},
"swupdate": {
"state": "notupdatable",
"lastinstall": "2019-11-17T00:25:22"
},
"type": "On/Off plug-in unit",
"name": "Plug",
"modelid": "TRADFRI control outlet",
"manufacturername": "IKEA of Sweden",
"productname": "On/Off plug",
"capabilities": {
"certified": false,
"control": {},
"streaming": {
"renderer": false,
"proxy": false
}
},
"config": {
"archetype": "classicbulb",
"function": "functional",
"direction": "omnidirectional"
},
"uniqueid": "d0:cf:5e:ff:fe:6d:26:be-01",
"swversion": "2.0.022"
},
That鈥榮 so strange, I just copied the complete json from my Hue (Osram plug which is working fine with Alexa) to HA and only changed the name and uniqueid and Alexa didn鈥檛 pick it up.
As soon as I go back to dimmable light it鈥榮 working again.
I鈥榤 using a first gen Echo and second gen Echo Dot, not sure if that has an influence.
I do have a 2nd Gen Dot too. In the app, I go to 'add devices', then tap Hue, then 'discover'.
While typing this, I deleted another device and suddenly could not pair it again. Wtf, it worked ~10h ago and I didn't touch HA or Alexa in the meantime... Maybe Alexa caches parts of the hue json (although that would be stupid)?? Back to square one I guess, will be testing now with 10h waiting time after each change 馃槄
I've added retval["productname"] = "On/Off plug"
on top of my change and they were discoverable immediately again as device type 'other' in the app
(cleared pycache
of the custom component i'm using for testing after applying the change, restarted HA, checked actual json output)
@BearWithTie would you mind testing it too?
Nope, I just can't get Alexa to pick it up on my side as an On/off plug-in unit
(json below) while it works every time as soon as I switch back to a Dimmable light
. I cleared the pycache and restarted the Echos inbetween, but it just doesn't work.
It doesn't make sense because it picks up my original Osam Smart+ plugs just fine. I couldn't find out why though, as I already copied over the complete json from the original ones and just replaced the name and uniqueid.
{
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "Heating",
"productname": "On/Off plug",
"state": {
"mode": "homeautomation",
"on": false,
"reachable": true
},
"swversion": "123",
"type": "On/off plug-in unit",
"uniqueid": "00:75:ac:58:ce:a7:c6:1d-89"
}
Not sure if anyone else is facing the same issue, but I'm thinking if it would make sense to add a config entry (kind of legacy mode) which if set would report all on/off devices as dimmable lights as it was prior to 0.103.0.
For now I'm working with a copy as custom component where I replaced the on/off entities with dimmable lights and have no issues whatsoever, same as before 0.103.0.
@BearWithTie how do you set it up as a custom component? I have tried but could not make it work...
@josh929800 you just copy the emulated_hue
folder to config/custom_components
and restart HA. It should pick it up automatically.
I've played around a little more, updating the description.xml
too, and added all attributes from my real lights like @BearWithTie , also restarted my Dots in-between. I don't get them to show up just like my actual bridge (devices still report as "Royal Philips ..." and device type _other_, instead of Ikea/Switch), but adding the productname
makes them at least discoverable and accessible for Alexa.
Anyone else care to test, so we maybe have a 3rd result?
@xtools-at I can help test. What鈥檚 the best way for me to get your latest code?
@xtools-at I upgraded to the Dev to test your integration improvement. My On/Off lights are not discoverable and if I use them it tells me there is an error check power supply but changes the light state.
@borisfeldman see @BearWithTie 's comment:
you just copy the emulated_hue folder to config/custom_components and restart HA. It should pick it up automatically.
apply the changes from the PR to hue_api.py
, and add this line after the change too:
retval["productname"] = "On/Off plug"
, so your else
block at the end of the file looks like this:
else:
# some comments
retval["type"] = "On/Off plug-in unit"
retval["productname"] = "On/Off plug"
retval["modelid"] = "HASS321"
also
cleared
pycache
of the custom component i'm using for testing after applying the change, restarted HA, checked actual json output
and restart the Dot(s), just in case.
@josh929800 could you also please try adding retval["productname"] = "On/Off plug"
and test again?
For me it works like described above - if we can confirm this for other setups, I'll update the PR.
@xtools-at I pulled in the latest docker image 0.105.0b4, copied the the emulated_hue folder to my custom_components, killed my emulated_hue_ids.json file and did a restart.
Alexa still doesn't find my on/off devices.
Here is the JSON snippet returned from Home Assistant:
"14": {
"manufacturername": "Home Assistant",
"modelid": "HASS321",
"name": "Living Room Table Lamps",
"productname": "On/Off plug",
"state": {
"mode": "homeautomation",
"on": true,
"reachable": true
},
"swversion": "123",
"type": "On/off plug-in unit",
"uniqueid": "00:23:5d:ff:7d:65:f2:44-fd"
},
If I change hue_api.py
to:
retval["type"] = "Dimmable light"
# retval["type"] = "On/off plug-in unit"
# retval["productname"] = "On/Off plug"
Then the devices are discovered, but don't actually turn on/off.
If I add:
retval["state"].update({HUE_API_STATE_BRI: state[STATE_BRIGHTNESS]})
Then everything seems to work as expected.
Thank you for the tip on custom_component. I got that up and working...
@xtools-at I updated the script as you suggested it does turn the lights on and off but responds Alexa responds with "The entryway light isn't responding please check it's network connection and power supply." It does not discover devices using this code.
else:
# On/off plug-in unit (Zigbee Device ID: 0x0000)
# Supports groups and on/off control
# Used for compatibility purposes with Alexa instead of "On/off light"
retval["type"] = "On/off plug-in unit"
retval["productname"] = "On/Off plug"
retval["modelid"] = "HASS321"
manufacturername | "Home Assistant"
modelid | "HASS321"
name | "Entryway Light"
productname | "On/Off plug"
state | 聽
mode | "homeautomation"
on | true
reachable | true
swversion | "123"
type | "On/off plug-in unit"
uniqueid | "00:96:ef:97:01:6b:6d:5f-b6"
md5-09e42082c2783a683c4636e1ee9802f4
```json
manufacturername | "Home Assistant"
modelid | "HASS321"
name | "Entryway Light"
state | 聽
bri | 1
mode | "homeautomation"
on | false
reachable | true
swversion | "123"
type | "Dimmable light"
uniqueid | "00:96:ef:97:01:6b:6d:5f-b6"
Hmmm these results don't look promising... I've been hoping for an easier fix, but I guess we need to further reverse-engineer Hue and/or related projects like diyhue.
E.g. my v2 bridge also has an endpoint called /api/user/config
, but the (v1) emulated hue only has .../lights and /description.xml
Maybe wiresharking the dot during discovery could help too, to see which urls it requests from HA
Update! I updated home assistant to 0.104.3 and now this code works... Stand by and I will check the other code.
else:
# On/off plug-in unit (Zigbee Device ID: 0x0000)
# Supports groups and on/off control
# Used for compatibility purposes with Alexa instead of "On/off light"
retval["modelid"] = "HASS321"
retval["type"] = "Dimmable light"
retval["state"].update({HUE_API_STATE_BRI: state[STATE_BRIGHTNESS]})
@josh929800 thanks for confirming, then there's hope :)
I'm testing too with @borisfeldman 's code atm - so far, entities are discovered and can be turned on/off, but when i turn them on, I get a short "device malfunction" in the app / a verbal error from alexa. Will try to refine the approach to get rid of that.
Running Home Assistant Version 0.104.3
@xtools-at Code Lights turn On/Off but responds Alexa responds with "The entryway light isn't responding please check it's network connection and power supply." It does not discover new devices using this code.
@borisfeldman - Light turns on and off, Alexa responds with "ok" and devices are discovered. The App is working too with no errors. When on HASSIO version 0.102.3 the lights would end up on all the time.
NOTE: this should also resolve issue #29899 "Emulated Hue Alexa still responds "Sorry
I'm getting the "Device malfunction" message constantly with HA 0.104.3, although everything works - I think it's related to some brightness Alexa is trying to set together with the turn-on command. This seems to both work nicely and get rid of the error for me (fixed reported brightness to 100%):
retval["modelid"] = "HASS321"
retval["type"] = "Dimmable light"
retval["state"].update({HUE_API_STATE_BRI: HUE_API_STATE_BRI_MAX})
I was able to resolve #29899 the same way for scripts (additionally removed the or entity.domain == script.DOMAIN
from the block above)
This works for me. Note the App always shows the light at 100% even when the light is off but it discovers new lights, turns the light on and off, and responds appropriately.
retval["modelid"] = "HASS321"
retval["type"] = "Dimmable light"
retval["state"].update({HUE_API_STATE_BRI: HUE_API_STATE_BRI_MAX})
nice :) if we can get another confirmation, I'll put together a PR and we may make it in time for the next 0.105.beta
Works for me, brightness set to 0% or 100% doesn鈥榯 matter. I鈥榤 actually using a custom version with exactly this since 0.103.0.
Proposed change to line 709: to set BRI to 0/255 depending on On/Off State
retval["state"].update({HUE_API_STATE_BRI: HUE_API_STATE_BRI_MAX if state[STATE_ON] else 0})
Proposed change @ Line 688: to allow set fan speed and adjust brigtness.
retval["state"].update(
{
HUE_API_STATE_BRI: state[STATE_BRIGHTNESS],
HUE_API_STATE_COLORMODE: "ct",
HUE_API_STATE_CT: state[STATE_COLOR_TEMP]
}
Per Hue API (https://developers.meethue.com/develop/hue-api/lights-api/) bri must be between 1 and 254.
On February 4, 2020 3:04:09 PM EST, josh929800 notifications@github.com wrote:
Proposed change to line 709: to set BRI to 0/255 depending on On/Off
State
retval["state"].update({HUE_API_STATE_BRI: HUE_API_STATE_BRI_MAX if state[STATE_ON] else 0})
Proposed change @ Line 688: to allow set fan speed and adjust
brigtness.retval["state"].update( { HUE_API_STATE_BRI: state[STATE_BRIGHTNESS], HUE_API_STATE_COLORMODE: "ct", HUE_API_STATE_CT: state[STATE_COLOR_TEMP] }
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/home-assistant/home-assistant/issues/30013#issuecomment-582090312
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Most helpful comment
I think I've solved it - the affected devices' 'type' attribute seems to be unknown to Alexa. I've extracted a working value from my physical Hue bridge and created PR#31330. This also circumvents the issue from prior versions, where Alexa could see and turn on/off the affected devices, but would always give you a verbal error response.
In the meantime, you can duplicate the 'emulated_hue' folder to your _config/custom_components_ and apply the 1-line-change from the PR yourself (see also official docs on custom components)