answerstu

Controlling Philips Hue using OpenHAB in Raspberry Pi

I want to control the Philips Hue Lux color lamps with OpenHAB. So I wonder what are the steps I should do and if I am missing something. In pi@raspberrypi:/opt/openhab/configurations/rules $ sudo vi demo.rules rule "Select scene" when Item scene received command then switch(receivedCommand) { /*alles uit */ case 0 : { sendCommand(Toggle_7, OFF); sendCommand(Toggle_3, OFF); sendCommand(Toggle_1, OFF); sendCommand(Toggle_10, OFF); sendCommand(Toggle...Read more

Convert Philips Hue XY values to HEX

The Philips Hue API returns an xy value in certain cases for the color value of the blub. How can I convert this to a HEX string? I've tried various formulas I found online but none of them work on all of the colors from the bulb.I took a look at the guides suggested below and tried to implement in PHP as follows:list($x, $y) = $light['state']['xy'];$z = 1.0 - $x - $y;$Y = $light['state']['bri'] / 255.0; // The given brightness value$X = ($Y / $y) * $x;$Z = ($Y / $y) * $z;$r = $X * 1.612 - $Y * 0.203 - $Z * 0.302;$g = -$X * 0.509 + $Y * 1.412 +...Read more

Philips Hue API: Turn on lights at fix time

I'm programming on HUE API.I want to schedule for a light turn on at one time and automatically turn off at another time. As this link is for reference (you must login before see this page).HUE API Schedules APIAs I research, maybe noway for me to do that except I must separate to two schedule commands: schedule to turn on at one time and schedule to turn off at another time.Is this true way to done this work ? Because I see that is too handy. Is there another way for HUE API does automatically ? Thanks :)...Read more

philips hue - Are multiple (PUTs) need for Turning on/off multiple lights using lights API?

I am using the following script: https://github.com/callil/SparkHue/blob/master/sparkhue.inoThis is working great besides the fact that it only lets me control that one light with id 3. What is I have multiple light ID's I want to turn on / off with the light API. Do I need to make multiple calls for each? client.println("PUT /api/deviceAddress/groups/1/action HTTP/1.1"); client.println("Connection: keep-alive"); // client.println("Host: 192.168.1.11"); //same as server client.println(...Read more

Supplement Natural Light as the sun goes down each day with Philips HUE Motion Sensor (and integrated light sensor) Without Motion

I recently fitted out my home office with Philips HUE bulbs and a Philips HUE motion sensor that has a builtin light sensor. I was hoping that I could get up the Philips HUE Motion Sensor (with light sensor) to supplement light in the office as the sun went down so the room was always the same brightness (to save my little eyes from the strain of poor lighting)While the sensor has have the light / lux sensor and it does allow me to set a threshold for when it should begin to turn on the lights - it does require motion and it doesn't supplement ...Read more

philips hue - Get data from Hue in realtime

I'm checking the hue API and I'm wondering if I understand it correctly that the motion sensor is able to switch lights on directly via the "rules", but it is impossible to get notified via the bridge about changes?My scenario is that I would like to detect, if there is any motion and if not to turn my TV via its rest API off.I also read that the sensor data are just updates every 5 minutes, how can I decrease the scan interval?...Read more

philips hue - How to use sunset and sunrise data

I see that the Hue API provides, on the "Daylight" sensor, fields for geographic location, and a sunrise/sunset offset.To be specific:latlongsunriseoffsetsunsetoffsetThe API as currently published does not provide any information that I could find on how the sunrise/sunset can be used.If I use the update sensor API to set the latitude and longitude, will the sunrise/sunset offsets be populated with data automatically, and I can query those to adjust my light schedule accordingly? I want to do e.g. "every day, light on at sunset + 20 minutes".I ...Read more

philips hue - Recurring lights Auto-off after 'x' minutes

I've been looking for a feature that will automatically turn the lights off after 'x' minutes if they have been on. Basically if someone forgets to turn the light off, I want it to turn off after some time interval. Does something like this exist already?The stock IOS app has a timer function, but it is not recurring. All the other routines want a specific day/time to do something but I don't care about day/time.I wrote some sample code in Python that pulls the state of the group at an interval and if it exceeds the threshold, it turns the l...Read more

philips hue - Anyone experiencing Error code -46 on Java SDK 1.20

Latest Java SDK (1.20) seems to throw NoSuchMethodError when trying to autheticate with the accesspoint using onAuthenticationRequired() ; Once the exception is thrown then all subsequent attempt to connect to the bridge will result in " Error - Code 46 Message bridge not responding"Anyone experiencing this behaviour, code is executed on java version "1.6.0_27"OpenJDK Runtime Environment (IcedTea6 1.12.8) (6b27-1.12.8)OpenJDK Zero VM (build 20.0-b12, mixed mode)Exception in thread "Thread-25" java.lang.NoSuchMethodError: java.lang.Integer.com...Read more

philips hue - Responding to Hue events?

I'd like to respond to events from a ZGP (Tap) switch. From what I read in the API documentation, I'll have to poll by routinely GETing the sensor and looking for a buttonevent in the state description.Certainly there's a better way. Has anyone found a way to add callbacks to a Hue bridge or any other technique to avoid constant polling?...Read more

philips hue - How do I create a test bulb?

I am trying to test an app I am working on and I want to see how it works with multiple and different bulbs, but I don't have as many lights as I would like.Is there any way to create a "fake" bulb that acts like a normal hue bulb and works with the hue app? Basically, I want to trick Hue into believing that there are a few more lights connected to the bridge....Read more

Can a Philips Hue app using the API react to a light being turned on?

I'm trying to accomplish something simple. When someone turns on a hue light, if it's after 6pm, set the light to a specific color.I haven't been able to find a way to do this without polling constantly (which seems lame).The main Hue iOS app has alarms, but lights only respond to alarms when they are turned on. So the app's alarms also fail to set a specific color after 6pm when a light is turned on at 7pm....Read more

how to detect power cycle on philips hue bridge?

How can I detect power outage on bridge? I tried using CLIP sensor daylight's lastupdated object and checked it against none but it does not help. As per meet hue description of 'lastupdated' object, it should none."Last time (based on /config/utc) the sensor send state data reflected in the state field. No value change is required to update the field. “none” (asof 1.x.0 null) when not initialized/no recent update has been received since the last bridge power cycle"But it always returns as timestamp. Can somebody suggest a way out please?regard...Read more