This tutorial runs a python script on a raspberry, or the like, and publishes a XMPP JID that you be friend with and then use both XEP 323 read and XEP 325 control. But you can also use plain chat to interact with the lamp through simple chat.
#Preparations you need an environment that can run python scripts.
A JID for each lamp
You need one Jabber ID or JID for short. First setup these accounts for each lamp on your favourite XMPP site for example [jabber.se] or find one on any of the free public and secure XMPP sites
##Get the python code
Clone the philipshue api and SleekXMPP code from github
start the Hue Api client
The script will try to connect to the local HUE gateway. If it cannot get access the script will ask you to push the connect button. If It is able to connect it will log on to the gateway. It uses the central Philips Hue service to find the IP adress for the gateway
- Each lamp is known as “individual” so you start one script for each lamp.
- If you don’t provide an individual you will adress the whole group of lamps connected to the hue gateway
when the script starts the first time you need to press the button on the Philipshue gateway to open access to it. Use a - - debug to get more information
you can now start chatting with the lamp by sending hi or ? in the chat window.
giving a debug flag would give more information
Reading a value from a device
We now start a script that continiously reads values from the first.
Writing a value to a device
keep the two scripts above running ans start a third one changing values in the sever device.