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

support setting lightingTheme via MQTT #618

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Sep 22, 2022

also publish the proper metadata for it to work via Home Assistant. note that this requires publishing an additional state topic that includes both the on/off state and the theme in a single topic (HASS can't deal with a single topic for commands and separated topics for state - it either needs to be a single topic for all attributes on both state and command, or it needs to be separate topics for each attribute on both state and command).

also publish the proper metadata for it to work via Home Assistant.
note that this requires publishing an additional state topic that
includes both the on/off state and the theme in a single topic
(HASS can't deal with a single topic for commands and separated
topics for state - it either needs to be a single topic for all
attributes on both state and command, or it needs to be separate
topics for each attribute on both state and command).
@ccutrer
Copy link
Contributor Author

ccutrer commented Sep 22, 2022

I'm not sure if this is ready yet. The MQTT topic structure is correct, and the command goes through. But I have an IntelliBrite light on an EasyTouch panel, and AFAICT the code doesn't actually send a "theme" command to the system, it manages the on/off timing itself. So the lightingTheme state never updates. I haven't actually opened my pool cover yet to watch and see if lights are going to the correct color. What's weird is that if I use the ScreenLogic app to set a color style, njsPC does pick up on that and quickly updates the lighting state.

@tagyoureit
Copy link
Owner

tagyoureit commented Sep 25, 2022

We manage the timing for the themes... You shouldn't do that via MQTT. It will never be guaranteed to be the right intervals.

The api call for setting the theme is like this:

{
    "method": "put",
    "url": "state/circuit/setTheme",
    "data": "{\"id\":3,\"theme\":1}"
}

You can get the themes for a given circuit (eg 3) with this http://[localhost]:4200/config/circuit/3/lightThemes.

This is what it looks like to set a theme in dashPanel:
image

@ccutrer
Copy link
Contributor Author

ccutrer commented Sep 25, 2022

I think you're misunderstanding. I'm not trying to replicate the timing for themes via MQTT. I'm exposing the same API you just referenced, via MQTT. And I've been testing using the dash panel. But either way, when I use njsPC to set the theme, it doesn't know what theme is set. But when I use Screenlogic, njsPC does know what theme was set. I'm curious why that is.

@tagyoureit
Copy link
Owner

Ok, gotcha.

it doesn't know what theme is set

We should know the theme. Can you tell me the steps to reproduce? Or do a packet capture (even better) so I can see what you mean?

@tagyoureit
Copy link
Owner

Did you get this one working? Or still having the issues mentioned above?

@ccutrer
Copy link
Contributor Author

ccutrer commented Oct 9, 2022

I have not yet. It's a bit of a lower priory for me, since the core on/off functionality works. It's definitely on my list to look at at some point though.

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

Successfully merging this pull request may close these issues.

2 participants