Sort of. Using the web API in Cortex for this is somewhat clunky in that each request requires a web api "action". So if you want to "set living room light on" that would be an individual API request. Likewise for turning it off. You can combine actions with the API so you could have cortex send a request for "turn living room light on, set brightness to 50% and set the colour as blue" but each of these combos would need to be set individually and assigned to connections in other cortex objects such as switches/occupancy outputs etc. Some real life examples might be easier to follow so see below.
I'm already most of the way there.could we be replacing all our existing mix of dimmer- & relay-driven CFLs with Hue bulbs - in existing fittings ?
Here's a progress update;
Thanks to Karam and Vivian the PUT requests are now working. What I've done is add a web client API object for each room with hue lights and then added an API request for on and off for each hue lamp. I've blurred out the API key which forms part of the URL
api requests.jpg
An individual request looks like this with a json encoded body...
individual request.jpgbi
I've then added a legacy relay node with 6 connections here so I can set up some "virtual" light objects that aren't under Cortex hardware control. Make sure they are not set as network enabled.
Legacy relay node.jpg
The light behaviour is now as for any other Cortex controlled light and gives access to the light level and occupancy features
light behaviour.jpg
Finally I've set up the connections for the virtual light objects so that the on/off output sends the API requests to the hue hub.
light connections.jpg
The actual physical lamps are connected to a mix of cortex relay controlled, DIN mount dimmers and circuits not under cortex control. All of these are set to always on and in the case of the dimmer circuits at 100%. I'll likely remove the dimmers from the circuit at some point and just hard wire them.
So in practice all of the electrical circuits are always on and cortex is sending on/off commands over the software API.
Provided they are not totally disconnected from the mains the bulbs retain their last brightness and colour settings with the on/off API requests. If the power is totally disconnected, when it is switched back on the bulbs default to a warm white at 100% brightness (presumably a sort of safety feature).
Up to now we're back to the same functionality that cortex offers but without any dimming capability. Setting of colours, dimming and scenes is now handled on the hue side of things and particularly useful is the Apple Siri integration, especially in combination with the Apple watch. I can now have cortex take care of the occupancy and have the lights switch on to the last scene automatically and then press and hold the watch rotary dial and say "set the relax scene" or "turn bookcase purple".
I've set button number 8 on the digital panel to toggle all the lights on/off.
The next step will be add a scene menu connected to button 9 that mirrors the scenes I've set up in the Hue app that will be connected to new API requests to set those scenes. This will be useful for those that don't have the hue app or siri capabilities.
I haven't had any missed requests from Cortex in case anybody is wondering about reliability. The only issues I can forsee are if somebody uses siri or the hue app to toggle the on/off state then Cortex will become out of sync. So long as distinct on and off outputs are used rather than the toggles then it should catch back up on the next request from cortex. For example if I go to bed and have siri "Turn all lights off" they will temporarily be out of sync in Cortex until the room occupancy and light timers cause cortex to resync them into the off state. I've not encountered a real life scenario where it has caused a problem yet.