Donate for PIHome
With tasker you can create some commands to control your different lights. For that you will need to create an On Task and also an Off task, because for now you can’t simply “toggle” the lights status.
1. Create a new task "Office Lamp On"
2. Click on the + and choose Net > HTTP Get
3. On the Server:Port field enter the API Url to control your Lamp
- Replace YOUR-IP with the IP of your PiHome installation
- Replace API-KEY with yours, you will find it in the user settings (http://YOUR-IP/home/user/) Click on the key icon to get it
- Replace the first &ch=X by a letter ( A or B or C or D or E ) you wil find it > Settings > Lamps
- Replace &co=XXXXX : replace the XXXXX with light code ( 10000 ) Settings > Lamps
- Replace &s=X : with 0 for off or 1 for on ( 0 = off or 1 = on )
4. Let the others fields blank and save your task
5. To trigger the task you can use different profils, events, stats or autovoice and use “Ok Google”.
6. You can duplicate the On Task and create an Off one. Don’t forget to change the 1 by 0 to shut down your lamp.
Thanks to Julien Ferla for this tutorial