PatchworkBoy / homebridge-edomoticz

Domoticz Homebridge-Plugin
Other
118 stars 43 forks source link

Milight Night light mode in HomeKit #102

Closed magichew closed 6 years ago

magichew commented 7 years ago

In the Domoticz web interface there is a button for night light mode and this works flawlessly every time. Is there anyway that this can be implemented in the Home app?

The homebridge Milight plug in has any value under 5% set the lights to night mode but this behaviour doesn’t seem to work in the Domoticz plugin and is hit and miss anyway in the Milight plugin and never works when the lights are brought from off state.

The use case is for setting up an automation in HomeKit for late night motion detection to bring the lights on to night mode to dimly light the way.

magichew commented 7 years ago

Following on from this there is also an automation issue with MiLight. No matter what settings I set in the automation for my light (colour/brightness) the lights come on WHITE and 99% brightness when trigger by a Home app automation.

Anyone else seeing this behaviour?

PatchworkBoy commented 6 years ago

What’s the JSON API Output for the particular switch? I don’t think Domoticz exposes a way to control sub-switches of a device other than via it’s own interface (I’d need a screenshot of how it appears in Domoticz UI to know what’s going on at Domoticz’ end). Might be worth looking into whether you can LUAScript a virtual switch to trigger it and keep all the logic within Domoticz, then tie your motion detection to the virtual switch in HomeKit.

PatchworkBoy commented 6 years ago

re: the follow on, this is because apparently Domoticz doesn’t return the RGB / HSV value for lights via the json api... just spotted a note in the code:

getHueValue: function (type, callback) { // TODO: Wait for Domoticz to add RGB/HSB status to their lights. Return last known value or 'white' for now.

This was written a while ago however, so could you get me the JSON API output for your light whilst set to a colour and midrange brightness so I can see whether this has changed or not...

Short-term solution: create a virtual switch in domoticz that manipulates your current domoticz switch to set them to the correct value (or create a scene in Domoticz that sets the lights how you want them, and a virtual switch to trigger that). HomeKit will then pick up this virtual switch and you can use that in your automation.

PatchworkBoy commented 6 years ago

Just to elaborate on the above, see the open issue over on Domoticz repo - https://github.com/domoticz/domoticz/issues/1808

No need to get me that JSON API output. It hasn’t changed - I’ve just checked the latest beta.