home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.76k stars 28.91k forks source link

"Failed to call service light.turn_on. An error occurred while updating the Elgato Light" when specifying Kelvins #84784

Closed tomwilkie closed 1 year ago

tomwilkie commented 1 year ago

The problem

I have an automation that turns on a set of lights, and its been failing to turn on all the lights recently:

image

I've tracked it down to setting the kelvins on an elgato keylight; this call in Developer Tools > Services triggers the same error:

service: light.turn_on
target: 
  entity_id: light.elgato_key_light
data_template:
  kelvin: 2000

Unfortunately there doesn't seem to be much in the logs:

2022-12-29 16:35:10.917 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: An error occurred while updating the Elgato Light
2022-12-29 16:35:10.920 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139811720285584] Error handling message: An error occurred while updating the Elgato Light (unknown_error) from 192.168.1.175 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36)

What version of Home Assistant Core has the issue?

core-2022.12.8

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Elgato

Link to integration documentation on our website

https://www.home-assistant.io/integrations/elgato/

Diagnostics information

config_entry-elgato-ed4e9fb7907c953e7b3e36045e56870f.json.txt

Example YAML snippet

service: light.turn_on
target: 
  entity_id: light.elgato_key_light
data_template:
  kelvin: 2000

Anything in the logs that might be useful for us?

2022-12-29 16:35:10.917 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: An error occurred while updating the Elgato Light
2022-12-29 16:35:10.920 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139811720285584] Error handling message: An error occurred while updating the Elgato Light (unknown_error) from 192.168.1.175 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36)

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @frenck, mind taking a look at this issue as it has been labeled with an integration (elgato) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `elgato` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign elgato` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


elgato documentation elgato source (message by IssueLinks)

tomwilkie commented 1 year ago

Having a look at the python-elgato source, it seems to be caused by passing kelvins out of range:

https://github.com/frenck/python-elgato/blob/main/src/elgato/elgato.py#L197

Confirmed that the follow service call does indeed work:

service: light.turn_on
target: 
  entity_id: light.elgato_key_light
data_template:
  color_temp: 200
tomwilkie commented 1 year ago

So this is going to be pretty hard to work around in a nice general way in my automation - how do you usually handle this sort of thing? Perhaps the elgato HA integration could round out-of-bounds values to their closest legal value?

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.