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

Moonlight sync with HA #452

Closed
jokerigno opened this issue Jan 8, 2019 · 13 comments
Closed

Moonlight sync with HA #452

jokerigno opened this issue Jan 8, 2019 · 13 comments
Labels

Comments

@jokerigno
Copy link

Hi,

I noticed that if I change color or brightness using moonlight lamp the result doesn't change in HA (0.84.6).

@rytilahti
Copy link
Owner

Does miiocli report the values correctly? If yes, this might be an issue on homeassistant's side.

@jokerigno
Copy link
Author

Miiocli is the mi home app?

If so the answer is yes: the app report the correct value

@syssi
Copy link
Collaborator

syssi commented Jan 9, 2019

Please install this library by "pip". It provides a command line interface called miiiocli.

@syssi
Copy link
Collaborator

syssi commented Jan 10, 2019

pip3 install python-miio
miiocli -d philipsmoonlight --ip IP --token TOKEN status

@jokerigno
Copy link
Author

jokerigno commented Jan 13, 2019

Hi,

sorry for the delay.

This is the output:

DEBUG:miio.device:192.168.2.248:54321 >>: {'id': 1, 'method': 'get_prop', 'params': ['pow', 'sta', 'bri', 'rgb', 'cct', 'snm', 'spr', 'spt', 'wke', 'bl', 'ms', 'mb', 'wkp']}
DEBUG:miio.device:192.168.2.248:54321 (ts: 1970-01-18 13:21:44, id: 1) << {'result': ['on', 0, 1, 65280, 1, 6, 0, 15, 0, 1, 1, 1, [0, 24, 0]], 'id': 1}
Power: on
Brightness: 1
Color temperature: 1
RGB: (0, 255, 0)
Scene: 6

While on Mi Home App is showing as Night Mode (the real status of the lamp at the moment, not green).

@syssi
Copy link
Collaborator

syssi commented Jan 17, 2019

Thanks! If you turn off the "night mode" does the component/library work as expected?

@jokerigno
Copy link
Author

Yes. If I change color in HA I can see the change in Mi Home app and viceversa. So the Issue seems related to night mode.

Can in be implemented somehow?

@jokerigno
Copy link
Author

Ok. It can be done via script but there's still a issue.

Set scene allow values from 1 to 4 while my moonlight bedlamp has 6 scene. And I'm intrested in using the sixth (night mode).

So @syssi do you think it is still achievable?

@syssi
Copy link
Collaborator

syssi commented Feb 5, 2019

Honestly I don't know. You could use the miioclio tool to test all cases. I assume the night mode is a fixed brightness + colortemp. Do you want to cancel the night mode if you change the brightness f.e.?

@jokerigno
Copy link
Author

Yes. I want to create a goodnight scene (with lamps on night mode) but also a goodmorning scene with a different brightness.

@jokerigno
Copy link
Author

Well. I see that moonlight bedlamp has 6 available scene while component allow to choose between 4.

@rytilahti maybe it can be added to the component?

@syssi
Copy link
Collaborator

syssi commented Jun 6, 2019

I've added scene 5 and 6 in the past. I will close this issue.

https://github.com/rytilahti/python-miio/blob/master/miio/philips_moonlight.py#L250-L258

@syssi syssi closed this as completed Jun 6, 2019
@jokerigno
Copy link
Author

Thank you!

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

No branches or pull requests

3 participants