Anders-Holst / xled_plus

Addons to the XLED package, to create nice effects for Twinkly LED lights
MIT License
33 stars 8 forks source link

404 Client Error: Not Found for url: http://192.168.1.194/xled/v1/led/layout/full #12

Closed Nixellion closed 11 months ago

Nixellion commented 2 years ago

I get this error whenever I try to run any of the sample effects, what might be the problem? It's Gen I Twinkly 105 LEDs.

404 Client Error: Not Found for url: http://192.168.1.194/xled/v1/led/layout/full

Anders-Holst commented 2 years ago

I have only Generation II myself, so can not verify this, but from the error message it seems that your device and firmware doesn't have the call to fetch the physical layout. What is your firmware version? Is it the latest for Gen I?

I suppose you have mapped the led positions with the app? It seems that only later versions, and maybe only Gen II, stores the layout on the device where we can retrieve it.

If I am right, then some sample effects should work - all those not relying on the layout. That is, days 1-3, 6-10, 13-15, 23, and 25 (unless I am mistaken about some days).

Nevertheless, the code should not crash. What should happen is that if the layout can not be retrieved, the pattern will follow the string. Right now this situation is not caught, because according to the documentation the led/layout endpoint should be there from all versions of Gen I, but apparently it is not true. So on line 608 in highcontrol.py there is a check, which needs to be modified to catch your case. If you tell me your firmware version I will correct the code. (It is however of limited use for you, unfortunately, since those 2D-effects will not be visible when the leds are considered as a one-dimensional string.)

Nixellion commented 2 years ago

I just updated firmware today, so it should be latest.

Oh, day 1 worked! Cool.

What I'm trying to do is actually just set the LED to one single warm white color :D Whenever I try to upload any movie from the official app it seems like it has some left-over from older animation. Like it only updates the frist 80-90% of the animation to whatever I tell it to, but last 10-20% repeat the same effect that was uploaded last year.

Day 1 animation uploaded correctly and seems to be working fine though. I suppose I can work from here, thank you!

Here's firmware info:

{'version': '2.3.8', 'code': 1000}

I did map led positions with the app

Anders-Holst commented 2 years ago

That's a strange behavior you describe... a bug in the app. Maybe it gest confused about he movie length, for some strange reason. You could try uploading an effect by the app, observe if its faulty (and try to time it), then use the pyton calls ctr.get_led_movie_config and ctr.set_led_movie_config to figure out how long it thinks the movie is, and adjust the length to the correct value. Tell me if you need more hints on this.

Thank's for the version. I will update highcontrol.py, so at least it does not crash. And maybe the documentation too. But it's a real disappointment that Gen I can not get 2D or 3D effects using python. The python code relies on the app to produce the layout.

By the way, to find your favorite solid tint, have you tried the interactive color-picker?

pip install colorsphere
python -m xled_plus.xled_colorpicker
Nixellion commented 2 years ago

Honestly, I see no point in trying to debug the app if I can just set whatever effects I want from Python. F their app. It's buggy as hell.

I'm a little confused why HomeAssistant has Twinkly integration, but it lacks setting colors or basic effects. Seems like at least some basic things could've been implemented.

No, I haven't! Managed to get what I need by picking and adjusting colors from Fire effect and applying them to Breath effect. Looks about right :D Thanks for the suggestion though, I'll check color picker

Anders-Holst commented 2 years ago

Yes! That's the attitude! The app and the HomeAssistant integration seem to be limited in so many, and completely unnecessary, ways. Its a freedom to do what we like from python. (But extra annoying that the layout does not work on Gen I then.)

Nixellion commented 2 years ago

Well, improving HomeAssistant integration is in our hands though :) Unlike the official app. It's FOSS and Python, though it uses https://pypi.org/project/twinkly-client/ instead of xled.

I am considering improving the integration component, but I'm honestly just not entirely sure if I want to spend time on it, considering personally I only really need this once a year. And I were to get any new smart christmas decorations I would now rather go the DIY route, cheaper and more control over it. And there are now tons of addressable decorations on aliexpress, just connect some ESP to it and off you go.

I could instead just make some python scripts and make buttons for them in Hass UI :D