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

L8 Moodlight #59

Closed
mssaleh opened this issue Feb 15, 2021 · 15 comments
Closed

L8 Moodlight #59

mssaleh opened this issue Feb 15, 2021 · 15 comments
Assignees
Labels
enhancement New feature or request

Comments

@mssaleh
Copy link

mssaleh commented Feb 15, 2021

First of all, Thanks for the massive, impressive effort. I have been trying to make use of these high-potential devices for more than a year. I managed to create several working prototypes using vanilla LVGL but no 2-way integration with HomeAssistant, and also with ESPhome (works nicely with HA but no touch!). I am beyond grateful for your generous contribution here.

Regarding the L8. Now with version 0.3.3, when I set up the backlight of L8 using moodlight (GPIOs r:26,g:32,b:33). The resulting entity in HomeAssistant (via MQTT auto-discovery) isn't working. I tried to create a manual MQTT light using the MQTT Light Template Schema in HA which worked only for on/off but not for color.
I created 3 sliders on a page and used groupid to link them to each GPIO directly from the HASP without HomeAssistant. This seems to work fine. Kindly take a look if have an L8.

Also, in general, I think it is possible to link a color-picker object with moodlight using groupid so we can directly control it without MQTT. It needs a bit of work but will make more sense than using HA or MQTT to change the backlight color on L8.

Best Regards!

@fvanroie fvanroie added the enhancement New feature or request label Feb 16, 2021
@fvanroie fvanroie self-assigned this Feb 16, 2021
@mssaleh
Copy link
Author

mssaleh commented Feb 16, 2021

I tried to read the code parts related to moodlight and groupid in order to help and contribute to this enhancement, but because I don't have enough C++ knowledge and there is very little comments in the code, I haven't got the confidence to submit a pull request.

My simple idea with minimal code change is to assign a pre-fixed groupid to moodlight (such as 888) and then modify to value normalization function to allow for the color hex code (with a simple "if" statement to create exception for groupid 888).

@fvanroie
Copy link
Collaborator

Hi @mssaleh,

Thanks for the input, I'm looking into this... The moodlight uses 3 groupids, one per PWM channel.
The way groups are currently setup, each object belongs to a single groupid. A colorpicker is special in that regard...

I think for HA to recognize the RGB values, the message needs to be in {"rgb":[255,255,255]}format.
I'm a HA n00b so I need to test that part some more, but this is certainly a goal to have that working too.

@fvanroie
Copy link
Collaborator

OK, I got the moodlight auto-discovery working in HA now.

@mssaleh
Copy link
Author

mssaleh commented Feb 24, 2021

Thanks a lot! You are really a github treasure! I have been extremely busy at work but I am planning to contribute to your effort in March.

@fvanroie
Copy link
Collaborator

image

Looking good, still need to add brightness support.

@nagyrobi
Copy link
Collaborator

nagyrobi commented Mar 4, 2021

How do you guys use this with autodiscovery in HA?
I configure everything manually - can this be done too?

Any manual HA config sample perhaps?

@fvanroie
Copy link
Collaborator

fvanroie commented Mar 5, 2021

autodiscovery is not yet working in 0.3.4, but in 0.4.0-dev it should work now

@nagyrobi
Copy link
Collaborator

nagyrobi commented Mar 5, 2021

But is there a way to use this with manual confuguration, not autodiscovery?

@fvanroie
Copy link
Collaborator

fvanroie commented Mar 5, 2021

There is a moodlight command in 0.3.4

@nagyrobi
Copy link
Collaborator

nagyrobi commented Mar 8, 2021

Ok my problem was that my Home Assistant's MQTT was initially configured back when autodiscovery didn't even exist. Somehow autodiscovery refused to work but re-installing the MQTT integration solved this.

@nagyrobi
Copy link
Collaborator

But is there a way to use this with manual confuguration, not autodiscovery?

The custom component adds it manually so no more autodiscovery needed, cool.

@fvanroie
Copy link
Collaborator

autodiscovery was the only possibility for a while, this has been dropped now since we have a custom component that can handle it better.

@nagyrobi
Copy link
Collaborator

yes, that's why I thought I should mention this.

@fvanroie
Copy link
Collaborator

I think we can close this issue in favor of the openHASP custom component?

@mssaleh mssaleh closed this as completed Apr 14, 2021
@nagyrobi
Copy link
Collaborator

Looking good, still need to add brightness support.

Is brightness of moodlight implemented at firmware level? Or is it just missing from the component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants