hass-emulated-hue / core

Hue Emulation for Home Assistant
Apache License 2.0
333 stars 56 forks source link

not able to use toggle on customize light template with logitech harmony remote #397

Closed almooj closed 1 year ago

almooj commented 1 year ago

Description

im using a custom light template to control switches from logitech harmony remote (not the app but binded devices to remote control) with this in my configuration in home assistant

Expected behavior

being able to use only one short pressed home control dedicated button on my harmony remote controller to turn on and off device (calling switch toggle service as configured to turn on ) as it used to be in previous emulated hue core version

here is an exemple of how it is configured once hue bridge has been bind in the android app image

As you can see there is no abilities to customize the turn off action and it is set to long press by design so we can not press it to turn on and off the selected device but if the turn on action is configure to call the switch.toggle service in HA configuration , it was working perfectly prior to the last update

Reproduction steps

Relevant log output

it seems that once button pressed a second time on harmony remote (to toggle and turn off the switch), no new input entries is logged in hue core log files but only with long press ...

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-set-vars.sh
cont-init: info: /etc/cont-init.d/00-set-vars.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun emulated-hue (no readiness notification)
s6-rc: info: service legacy-services successfully started
[11:50:14] INFO: Starting Emulated Hue...
2023-02-07 11:50:15,781 DEBUG aiorun -- Entering run()
2023-02-07 11:50:15,782 DEBUG aiorun -- Creating default executor
2023-02-07 11:50:15,786 INFO  emulated_hue.controllers.config -- Auto detected listen IP address is 192.168.1.176
2023-02-07 11:50:15,805 DEBUG getmac -- Raw MAC found: None
2023-02-07 11:50:15,807 DEBUG getmac -- Raw MAC found: dc:a6:32:ba:d9:83
2023-02-07 11:50:15,847 INFO  hass_client -- Connected to Home Assistant ws (version 2023.2.2)
2023-02-07 11:50:16,039 INFO  emulated_hue.web -- Started HTTP webserver on port 80
2023-02-07 11:50:16,111 INFO  emulated_hue.web -- Started HTTPS webserver on port 443
2023-02-07 11:50:16,129 DEBUG asyncio -- Using selector: EpollSelector
2023-02-07 11:50:59,062 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/2/state
2023-02-07 11:50:59,067 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:51:13,645 DEBUG emulated_hue.apiv1 -- [192.168.1.131] GET /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights
2023-02-07 11:51:21,855 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/2/state
2023-02-07 11:51:21,859 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:51:23,679 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/3/state
2023-02-07 11:51:23,684 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:51:24,901 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/2/state
2023-02-07 11:51:24,902 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:51:25,858 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/3/state
2023-02-07 11:51:25,859 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:51:33,909 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/2/state
2023-02-07 11:51:33,910 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:51:34,416 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/2/state
2023-02-07 11:51:34,420 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:51:35,371 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/3/state
2023-02-07 11:51:35,374 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:51:41,261 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/7/state
2023-02-07 11:51:41,265 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:51:51,039 DEBUG emulated_hue.apiv1 -- [192.168.1.131] GET /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights
2023-02-07 11:51:54,814 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/3/state
2023-02-07 11:51:54,820 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:52:04,764 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/2/state
2023-02-07 11:52:04,765 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:52:06,079 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/3/state
2023-02-07 11:52:06,084 DEBUG emulated_hue.apiv1 -- {"xy":[0,0],"on":true,"bri":0}
2023-02-07 11:52:07,527 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/2/state
2023-02-07 11:52:07,532 DEBUG emulated_hue.apiv1 -- {"on":false}
2023-02-07 11:52:09,292 DEBUG emulated_hue.apiv1 -- [192.168.1.131] PUT /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights/3/state
2023-02-07 11:52:09,294 DEBUG emulated_hue.apiv1 -- {"on":false}
2023-02-07 11:52:19,255 DEBUG emulated_hue.apiv1 -- [192.168.1.131] GET /api/yn7-oe02PbGstiaBdlJtftBipggi6B4mDluQ4ifL/lights

Operating system

HassOS

Install method

HassOS Addon

Version

0.3.0

Dev Version

No response

Any other information that may be helpful

No response

alexyao2015 commented 1 year ago

This appears that it is behaving as intended. Can you also try restoring to the old version and seeing if this problem still exists? I'm not seeing anything particularly broken from the logs.

almooj commented 1 year ago

Thx for the answer but it was working fine before , it seems that when i press home control button again it did not trap this input but it use to be...dont know if some delays have been put somewhere or if some state of turn on device is preventing to handle one more press for some reason

Maybe you could have some hint about that

Ive already try to restore but it seem than the backup wasn't a full one

Thx

Regards

Le 7 févr. 2023 12:01, Alex Yao @.***> a écrit :

This appears that it is behaving as intended. Can you also try restoring to the old version and seeing if this problem still exists? I'm not seeing anything particularly broken from the logs.

Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: @.***>

[ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/hass-emulated-hue/core/issues/397#issuecomment-1421109949", "url": "https://github.com/hass-emulated-hue/core/issues/397#issuecomment-1421109949", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

almooj commented 1 year ago

also try restoring to the old version and seeing if this problem still exists? I'm not seeing anything particularly broken from the logs.

@alexyao2015 so i was able to return to a full backup and it worked again as it was (short press turn on and off the switch) but i was able to compare the /config/hass-emulated-hue/emulated_hue.json and the main differences are in the throttle value

"6": { "colormode": "xy", "config": { "archetype": "sultanbulb", "direction": "omnidirectional", "function": "mixed", "startup": { "configured": true, "mode": "safety" } }, "enabled": true, "entity_id": "light.prise2", "name": "", "state": { "mode": "homeautomation", "on": true, "reachable": true }, "throttle": 0, "uniqueid": "00:91:d6:a0:5f:de:60:b1-8f" },

and in the new version

"3": { "config": { "archetype": "sultanbulb", "direction": "omnidirectional", "function": "mixed", "startup": { "configured": true, "mode": "safety" } }, "enabled": true, "entity_id": "light.prise2l", "name": "", "state": { "brightness": null, "color_mode": null, "color_temp": null, "effect": null, "flash_state": null, "hue_saturation": null, "power_state": false, "reachable": true, "rgb_color": null, "transition_seconds": 0.4, "xy_color": null }, "throttle": 150, "uniqueid": "00:30:84:31:00:bf:00:4b-df" },

so now im gonna try to roll back to this week backup and change this to 0 value to see if there is any improvements

l'll keep U in touch

Regards

github-actions[bot] commented 1 year ago

This issue has been marked as stale due to no activity and will be closed in 7 days.

almooj commented 1 year ago

unfortunately this bug has not yet been fixed since the behaviour is different from the previous version has confirmed when rolled back and differences in logs files between version 0.3.0 and previous version

please consider to give it a look (if you can)

Thx regards

alexyao2015 commented 1 year ago

So the issue is with the throttle value? The throttle setting affects how quickly operations can be made which are relayed to home assistant. If you set it to 0, it will not not throttle operations.

almooj commented 1 year ago

hi , unfortunately i don't know exactly . i thing throttle is one cause of ther reason but not only , cause as you can see the json structure from the previous version
"state": { "mode": "homeautomation", "on": true, "reachable": true }, "throttle": 0, "uniqueid": "00:91:d6:a0:5f:de:60:b1-8f" },

vs in the 0.3.0

"state": { "brightness": null, "color_mode": null, "color_temp": null, "effect": null, "flash_state": null, "hue_saturation": null, "power_state": false, "reachable": true, "rgb_color": null, "transition_seconds": 0.4, "xy_color": null }, "throttle": 150, "uniqueid": "00:30:84:31:00:bf:00:4b-df" },

once again thx for your work and sorry to not being able to help you more