I could not resist it, I acquired a Hue motion sensor and a dimmer switch, already had some TAP´s. I wanted to put the house in night mode when the TAP was pressed late in the evening, so the TAP had to be visible in ST as a device.
The problem with the Hue API is that it does not provide events to the outside world. So it had to be a poll implementation, not a good idea to have the hue bridge polled every second (well the Hue bridge might not be bothered) but the ST cloud will be. But polling faster for a shorter period of time might deliver a more responsive Hue Sensor for ST, as i had ST motion sensors in lots of places I got the idea that the probability of someone pressing a button on a hue sensor is higher when there is motion going on in it´s neighbourhood.
So it has two parallel modes of operation:
-
It schedules a poll event to the Hue Sensors every minute.
-
If you have ST motion sensors or any other motion sensors (not the hue motion sensor
) that are defined in ST it will schedule a number of poll events when motion starts. In the smartapp you can assign an ST motion sensor to the discovered Hue Sensor. These scheduled polls will pick up a change on the related sensor quicker. At least that is the intention. After the series of polls it will stop and wait for a next motion event.
The smartapp is only tested with bridges that are discovered by Super Lan Connect. It supports multiple bridges. When the bridges are discovered it will ask for the Username that is used to make the API calls. The app provides you with a button that brings you to the device definition in the IDE where you have to copy the username from the user data section. When you paste the username in the app it should discover the sensors that are on that bridge(s).
In version 1.01 it now also supports bridges that were created with custom apps that provide the username for the API as an attribute and have the capability bridge e.g. Hue B Smart. The username will then be filled in by default.
In version 1.02 it is now possible to have elevated Hue Bridge polling (10 seconds) during selected modes as opposed to normal 1 minute polls. Also you can select to not poll at all during selected modes (holidays, away etc…). If you select same mode in poll/no poll NO poll is selected.
From version 1.14 on, a buttonpress event will lead to a small burst of polls on the switch, to have more responsive button presses.
in version 1.15 it is now possible to add and control Hue Rooms (groups), the generic device domoticzOnOff is needed for that. Only groups that are defined with the room attribute are added to keep this as clean as possible.
The motion sensor also provides illuminance in lux and temperature.
The Tap is basically a button device
The Dimmer Switch is switch and a button device (long presses are recognized, but no clue if you can use them in ST).
To manage expectations, the devices are used to show status and create events that one can use in ST automations, the HUE API does not allow to change the status, e.g. push a button and modify the status from ST in the bridge.
If any problems or wishes, please post, if not too difficult…it gets fixed or implemented.
add verbem smartthingspublic master github to the definitions and look for
Hue Sensor (Connect) in the apps, this app will create the devices and is mandatory
Hue Tap, Hue Switch, Hue Motion in the DTH
Hue Sensor (Connect)
Hue Motion
Hue Switch
Hue Tap
Have fun, Martin