Skip to content
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

WLED controls in Mainsail #1413

Open
iCarl opened this issue Jun 9, 2023 · 22 comments
Open

WLED controls in Mainsail #1413

iCarl opened this issue Jun 9, 2023 · 22 comments
Labels
💡 Type: FR Requests a new feature

Comments

@iCarl
Copy link

iCarl commented Jun 9, 2023

Requested feature:

Could it possible to have a color picker in a similar fashon to the neopixel support in Mainsail ( #1050 )?

Solves the following problem:

No response

Additional information:

No response

@iCarl iCarl added the 💡 Type: FR Requests a new feature label Jun 9, 2023
@meteyou
Copy link
Member

meteyou commented Jun 10, 2023

Thx for your request! I don't think, that it will work fine, because wled is no part of Moonraker or Klipper. It's a third-party software. But I have to double-check it.

@rackrick
Copy link
Member

rackrick commented Jun 12, 2023

WLED offers an JSON API to controll it. With that it is possible to implement a color picker.
The real question is if its a use case for mainsail.

@meteyou
Copy link
Member

meteyou commented Jun 13, 2023

We actually want to have only one api between Mainsail and Host (Moonraker). So it would be nice if it could connect with Moonraker.

@rackrick
Copy link
Member

That's reason I said to question the usecase for mainsail.
The moonraker wled api offers just basic control of wled. Which doesn't include the possibility for a colorpicker.
The moonraker docs even recommend to use the wled json api for more low level control.

@iCarl
Copy link
Author

iCarl commented Jun 13, 2023

Ok, thanks

@iCarl iCarl closed this as completed Jun 13, 2023
@meteyou
Copy link
Member

meteyou commented Jun 13, 2023

@rackrick ohhh... i missed this option. maybe i should check the moonraker integration of WLED and check what is possible in the GUI with it.

@iCarl i will reopen this ticket as a reminder to check this component.

@meteyou meteyou reopened this Jun 13, 2023
@rackrick
Copy link
Member

@meteyou hmm... just checked the moonraker repo.
there is even an function to set the wled colors set_wled in moonraker.
But this function is not exposed as an api endpoint... just as remote method for gcode calls? remote methods for GCODE.

Guess you have a better undstanding of moonraker then i have. May have a look there.
If it's possible to expose that method as endpoint. Implmenting the color picker could be quite easy.

@meteyou
Copy link
Member

meteyou commented Jun 14, 2023

@rackrick mainsail only sends G-Codes for the klipper LEDs. So it would fit, but Moonraker must also manage the current state and update it via Websocket to the clients. This is what I have to check.

@rackrick
Copy link
Member

rackrick commented Jun 14, 2023

grafik
@meteyou moonraker returns just an ok result... not the actuall state of the leds. Thats what you meant right?

@meteyou
Copy link
Member

meteyou commented Jun 14, 2023

@rackrick thats normal for gcode. you should get a notify back with the new state.

@rackrick
Copy link
Member

@meteyou the notify_status_update contains pretty much everything else. but no wled information. If I compare it to the klipper led function. The next status_update contains the colors per channel... etc

@meteyou
Copy link
Member

meteyou commented Jun 14, 2023

notify_status_update should only send klipper data. so it should be a own notify_xx for WLED. Maybe this is missing right now in Moonraker.

@meteyou
Copy link
Member

meteyou commented Jun 14, 2023

ahh.. find right now the docs for it: https://moonraker.readthedocs.io/en/latest/web_api/#get-strips. there are own API commands for it.

@rackrick
Copy link
Member

there are... but they don't contain any color channel information. which we would need for the colorpicker 😅

@meteyou
Copy link
Member

meteyou commented Jun 15, 2023

Oh right. Only presets, brightness and on/off

@rackrick
Copy link
Member

guess the "problem" is the possibilty of having each led in a different state.

LED 1 -> red
LED 2 -> green
LED 3 -> blue

what do you want to display in the colorpicker then?

moonraker keeps track of the color states in the array _chain_data which could be probably added in the return of the status endpoint.

@meteyou
Copy link
Member

meteyou commented Jun 19, 2023

This would fit. It's the same as klipper returns for Neopixel. And then we also need an API point to send new color commands. Atm moonraker only supports on/off from presets.

@rackrick
Copy link
Member

@rackrick mainsail only sends G-Codes for the klipper LEDs. So it would fit, but Moonraker must also manage the current state and update it via Websocket to the clients. This is what I have to check.

We could use the gcode method for that or would you prefer an extra http endpoint for that?

@meteyou
Copy link
Member

meteyou commented Jun 19, 2023

Because you get the update states via Moonraker directly, I would also prefer to send the commands via Moonraker with separate API points (Websocket/http).

@iCarl
Copy link
Author

iCarl commented Aug 13, 2023

Any updates on this request ?

@peperonikiller
Copy link

Currently using gcodes to control WLED at the moment. Would love to see my WLED light pop up in the misc bar some day ;)

@c-mellueh
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Type: FR Requests a new feature
Projects
None yet
Development

No branches or pull requests

5 participants