Updated on September 14, 2017
Openhab hue motion sensor
I got the question how to use your hue motionsensor with openhab, so here are the steps you need to do:
- get hue user (api key)
You need a hue username key for the requests to the hub, philips has a great tutorial for that 🙂 https://developers.meethue.com/documentation/getting-started
Note that the id of my motionsensor is 12, and it will poll the status every 3 seconds (3000ms), you need to change the id to the id of your motion sensor, and don’t forget to replace 192.168.x.x with the ip address of your hue hub.
If you don’t know the ID of your motionsensor check http://IP_HUE_HUB/USERKEY/sensors to find the id
- add transform script
- setup openhab rules
I have created a switch in openhab, which I can switch on when I’m out of the house, if the switch is set to on, and motion is detected I will receive the push notification.
You can create a switch in your items file by just adding “Switch OutOfHouse” to your items file, and then you are able to check the state of the switch if motion is detected “if(OutOfHouse.state == ON)… and so on”