-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Twinkly integration crashes when tree is not in movie mode #133759
Comments
Hey there @dr1rrb, @RobBie1221, @Olen, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) twinkly documentation |
If I remember correctly, there should be some handling of this. At least I remember some discussions where we realised that setting a single color acted just like setting a movie with a single color playing forever. |
We are setting mode to movie explicitly here
|
So, in my case this happened with quite a new setup, and I seem to catch the same kind of situation from some of the other issues on this. Some posters suggest that setting an effect in the Twinkly app makes home assistant suddenly catch up, so there's definitively something going on here. I suspect that there is some sort of state in the twinkly controller that makes it unable to just switch to movie mode without any other parameters. Maybe it's what happens if no movies are available? According to the REST API documentation, the 1102 error code is just a generic error, so it's impossible to say... This seems to be exactly what happened to me too. I've had a movie playing for a couple of hours, and the integration started working all of a sudden. If it wasn't so close to Christmas, I'd reset the whole thing and work on reproducing the issue reliably. For the integration itself, I would kindly suggest having some check on whether any movies are returned, and if not, operating it in |
The problem
I believe have discovered an issue with the twinkly integration. There are a few issues already reported with this similar symptoms, and I believe that these may very well be caused by this issue.
The root cause of the issue is that the Twinkly lights operate in two modes: static, and movie, but the integration always assumes that the movie mode is active.
In the static mode, all LEDs display a single color, whereas in movie mode, the LEDs are used a bit like a screen to display an animation.
There are two issues at play:
Primarily, the hass integration seems to assume that the Twinkly LEDs are always in movie mode.
When the integration runs the
async_update
method to query the device, it will eventually call the methodasync_update_current_movie()
, which uses thettls
API functionget_current_movie()
.If no movie is playing, this API will throw an exception which is the second issue.
So for this integration, you could probably run that integration in a
try
/except
block, but it's probably much better to check if it's actually in movie mode.This is trivial with the API. Here's an example:
In fact, it would be cool to build upon this static mode and make it work a little like a regular light bulb when in static mode.
Anyway, the problem that most people who can't get this integration to work run in to, is what I just documented here.
I hope you can get a fix ready before Christmas :)
What version of Home Assistant Core has the issue?
core-2024.12.5
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
twinkly
Link to integration documentation on our website
https://www.home-assistant.io/integrations/twinkly
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
EDIT at 2024-12-22: I was some what incorrect in my
mode
mapping. Thert
mode is not the movie mode. It's just calledmovie
.The text was updated successfully, but these errors were encountered: