<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Domotica on OiePoie!</title>
    <link>https://www.oiepoie.nl/categories/domotica/</link>
    <description>Recent content in Domotica on OiePoie!</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 04 Oct 2015 15:24:11 +0200</lastBuildDate><atom:link href="https://www.oiepoie.nl/categories/domotica/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Cheap wifi switch Orvibo WiWo S20</title>
      <link>https://www.oiepoie.nl/2015/10/04/cheap-wifi-switch-orvibo-wiwo-s20/</link>
      <pubDate>Sun, 04 Oct 2015 15:24:11 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2015/10/04/cheap-wifi-switch-orvibo-wiwo-s20/</guid>
      <description>&lt;h1&gt;Orvibo WiWo S20&lt;/h1&gt;
&lt;p&gt;I bought this WiWo-S20 wifi switch a little while ago at &lt;a class=&#34;extlink&#34; href=&#34;http://www.banggood.com/WiWo-S20-Wi-Fi-Smart-Remote-Control-Timing-Socket-USEU-Plug-p-953743.html?p=6E2214592974201405G7&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34;&gt;Banggood&lt;/a&gt; because it was cheap (payed around €17) and it’s always handy to have remote controlled switches in the house.&lt;/p&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/10/WiWo-S20-schedule.png&#34;&gt;&lt;img alt=&#34;WiWo S20 schedule&#34; class=&#34;alignleft size-thumbnail wp-image-510&#34; height=&#34;150&#34; sizes=&#34;(max-width: 150px) 85vw, 150px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/10/WiWo-S20-schedule-150x150.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/10/WiWo-S20-schedule-150x150.png 150w, https://www.oiepoie.nl/wp-content/uploads/2015/10/WiWo-S20-schedule-92x92.png 92w, https://www.oiepoie.nl/wp-content/uploads/2015/10/WiWo-S20-schedule-100x100.png 100w, https://www.oiepoie.nl/wp-content/uploads/2015/10/WiWo-S20-schedule-200x200.png 200w, https://www.oiepoie.nl/wp-content/uploads/2015/10/WiWo-S20-schedule-400x400.png 400w&#34; width=&#34;150&#34;/&gt;&lt;/a&gt;The switch comes with an &lt;a class=&#34;extlink&#34; href=&#34;https://itunes.apple.com/cn/app/wiwo2/id859140969?mt=8&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34;&gt;app&lt;/a&gt; to control it (and yes, there is also an &lt;a class=&#34;extlink&#34; href=&#34;http://www.orvibo.com/software/android/wiwo2.apk&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34;&gt;Android app&lt;/a&gt;). Besides toggling the power from the app, it’s also possible to configure a countdown timer, or specify a schedule. This alone is worth the purchase. In the past i used a number of time switches, but changing the settings was always a burden. Now with the app it’s intuitive and simple.&lt;/p&gt;
&lt;h2&gt;Control&lt;/h2&gt;
&lt;p&gt;The plan was always to control this switch from my domotica system (i use &lt;a class=&#34;extlink&#34; href=&#34;http://www.domoticz.com&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34;&gt;Domoticz&lt;/a&gt;) so that it can be tied to events (for instance me waking up and automagically switching on the coffee). Luckily the heavy lifting (i.e. reverse engineering) has already be done, and somebody even wrote a &lt;a class=&#34;extlink&#34; href=&#34;https://github.com/franc-carter/bauhn-wifi&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34;&gt;perl script&lt;/a&gt; which i will be using with domoticz.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;
Normally these kind of devices are controlled via TCP/IP, so in a connection oriented way (establish the connection, give commands en quit). But this devices works connectionless through UDP. By using netcat we can still control the device from the commandline:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
## Subscribe to the device:&lt;br/&gt;
echo &#39;6864001e636c&#39;&#34;accf532147e4&#34;&#39;202020202020&#39;&#34;e4472153cfac&#34;&#39;202020202020&#39; | xxd -r -p | nc -u -w2 -p10000 192.168.1.76 10000 | xxd -p&lt;br/&gt;
## Switching on:&lt;br/&gt;
echo &#39;686400176463&#39;&#34;accf532147e4&#34;&#39;2020202020200000000001&#39; | xxd -r -p | nc -u -w2 -p10000 192.168.1.76 10000 | xxd -p&lt;br/&gt;
## Switching off:&lt;br/&gt;
echo &#39;686400176463&#39;&#34;accf532147e4&#34;&#39;2020202020200000000000&#39; | xxd -r -p | nc -u -w2 -p10000 192.168.1.76 10000 | xxd -p&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
The &lt;code&gt;accf532147e4&lt;/code&gt; in there is the MAC address of the device.You first need to subscribe to the device and then give the command to switch on or off.&lt;/p&gt;
&lt;p&gt;With the perl code it’s of course much easier; subscribing is already taken care of in the script, so it’s:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
$ ./orvibo-s20.pl AC:CF:23:51:47:E4 status&lt;br/&gt;
off&lt;br/&gt;
$ ./orvibo-s20.pl AC:CF:23:51:47:E4 on&lt;br/&gt;
$ ./orvibo-s20.pl AC:CF:23:51:47:E4 status&lt;br/&gt;
on&lt;br/&gt;
$ ./orvibo-s20.pl AC:CF:23:51:47:E4 off&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
When you download the script from &lt;a class=&#34;extlink&#34; href=&#34;https://github.com/franc-carter/bauhn-wifi/blob/master/bauhn.pl&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34;&gt;github&lt;/a&gt;, it’s called bauhn, but i renamed it to a name that makes more sense to me.&lt;/p&gt;
&lt;h2&gt;Domoticz&lt;/h2&gt;
&lt;p&gt;Controlling the switch from domoticz is not very complex. First you need to get the perl script into the &lt;b&gt;domoticz/scripts &lt;/b&gt; directory.&lt;br/&gt;
Next open the Domoticz web GUI, go to Setup -&amp;gt; Hardware and add a new Dummy device.&lt;br/&gt;
Go to Setup -&amp;gt; Devices and enable the device (click on the green arrow next to the name you gave it, and it should become a blue arrow).&lt;br/&gt;
The new dummy switch can be found in switches, click on edit and now you can configure the on and off actions:&lt;br/&gt;
&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/10/Screen-Shot-2015-10-04-at-15.15.16.png&#34;&gt;&lt;img alt=&#34;Domoticz configure WiWo Switch&#34; class=&#34;alignright size-medium wp-image-511&#34; height=&#34;188&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/10/Screen-Shot-2015-10-04-at-15.15.16-300x188.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/10/Screen-Shot-2015-10-04-at-15.15.16-300x188.png 300w, https://www.oiepoie.nl/wp-content/uploads/2015/10/Screen-Shot-2015-10-04-at-15.15.16-630x394.png 630w, https://www.oiepoie.nl/wp-content/uploads/2015/10/Screen-Shot-2015-10-04-at-15.15.16.png 772w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt;&lt;br/&gt;
That’s all there is to it. Have fun!&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Sources:&lt;/i&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;extlink&#34; href=&#34;https://stikonas.eu/wordpress/2015/02/24/reverse-engineering-orvibo-s20-socket/&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34;&gt;Blog of Andrius Štikonas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;extlink&#34; href=&#34;https://github.com/franc-carter/bauhn-wifi&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34;&gt;Perl code on Github from Franc Carter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Disable Foscam Infrared (IR) Leds</title>
      <link>https://www.oiepoie.nl/2014/12/14/disable-foscam-infrared-ir-leds/</link>
      <pubDate>Sun, 14 Dec 2014 21:15:49 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2014/12/14/disable-foscam-infrared-ir-leds/</guid>
      <description>&lt;p&gt;I own a couple of foscam Pan Tilt (no Zoom) webcams which i have bought under different brand names, some are Watchbot and one is from the Aldi sold as Supra IPC-1A. The webcams are indoor types, so they are inside looking out through the window. At daytime they work just fine, but when it gets dark they have a sensor which switches on the Infrared Leds to have a better view in low light.&lt;br/&gt;
The problem is that they are behind glass, so the IR bounces back en completely blinds the webcam as you can see from the picture: &lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/Foscam_IR_Night_reflection.png&#34;&gt;&lt;img alt=&#34;Foscam_IR_Night_reflection&#34; class=&#34;alignright size-medium wp-image-270&#34; fetchpriority=&#34;high&#34; height=&#34;184&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/Foscam_IR_Night_reflection-300x184.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/Foscam_IR_Night_reflection-300x184.png 300w, https://www.oiepoie.nl/wp-content/uploads/2014/12/Foscam_IR_Night_reflection-630x388.png 630w, https://www.oiepoie.nl/wp-content/uploads/2014/12/Foscam_IR_Night_reflection.png 787w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt;&lt;br/&gt;
Although this webcam supposed to have IR Led control from the GUI, in 90% of the time this didn’t work; so i decided to solve this permanently. The photo on the left shows the front of the webcam with the lens, IR Leds and the LDR (Light Dependant Resistor) which is responsible for measuring the light and switching on the IR Leds when it gets to dark.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0006_p.jpg&#34;&gt;&lt;img alt=&#34;Supra IPC-1A front&#34; class=&#34;alignleft size-medium wp-image-272&#34; height=&#34;225&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0006_p-300x225.jpg&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0006_p-300x225.jpg 300w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0006_p-630x472.jpg 630w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0006_p.jpg 800w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt;To disable the Infrared Leds we have to disassemble the camera head. Find a small philips screwdriver and remove the two screw which key the camera head together. Be careful with the screws, when they fall, you most likely will never find them again 🙂&lt;br/&gt;
When the screws are loose, you can carefully pry the parts apart.  &lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0007_p.jpg&#34;&gt;&lt;img alt=&#34;Supra IPC-1A opened&#34; class=&#34;alignright size-medium wp-image-273&#34; height=&#34;300&#34; sizes=&#34;(max-width: 225px) 85vw, 225px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0007_p-225x300.jpg&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0007_p-225x300.jpg 225w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0007_p-768x1024.jpg 768w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0007_p-630x839.jpg 630w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0007_p.jpg 800w&#34; width=&#34;225&#34;/&gt;&lt;/a&gt; My webcam now shows a PCB with the camera logic. The with cable on the top is for the connection to the LED and LDR board, i disassembled it further, but there is no need to do so if you only want to enable the IR Leds.&lt;br/&gt;
&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0009.jpg&#34;&gt;&lt;img alt=&#34;Supra IPC-1A LED and LDR panel&#34; class=&#34;alignleft size-medium wp-image-275&#34; height=&#34;225&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0009-300x225.jpg&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0009-300x225.jpg 300w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0009-1024x768.jpg 1024w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0009-630x472.jpg 630w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0009.jpg 1632w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;
The only thing that you need to do is disconnect that small white cable as shown in the picture below and then reassemble the head. This way you can easily undo the operation in the future if you need to.&lt;br/&gt;
&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0010.jpg&#34;&gt;&lt;img alt=&#34;Supra IPC-1A cable disconnected&#34; class=&#34;alignright size-medium wp-image-276&#34; height=&#34;225&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0010-300x225.jpg&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0010-300x225.jpg 300w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0010-1024x768.jpg 1024w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0010-630x472.jpg 630w, https://www.oiepoie.nl/wp-content/uploads/2014/12/IMG_0010.jpg 1632w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt;&lt;br/&gt;
Now reconnect the webcam to power and verify that it’s working OK.&lt;/p&gt;
&lt;h2&gt;Older model Foscam webcams&lt;/h2&gt;
&lt;p&gt;The image below is from a different kind of foscam webcam, where everything is attached to one single board attached to the motor driven axis. The way to fix this type is also to remove the screws and also unscrew the lens all the way. After that the PCB with everything is accessible and you can fix the IR Leds going on by short circuiting the LDR (low resistance is lots of light). See the image for the idea. By only twisting the LDR, you can simply undo this mod when you want to.&lt;br/&gt;
&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/Watchbot-IR_p.jpg&#34;&gt;&lt;img alt=&#34;Watchbot-IR_LDR&#34; class=&#34;alignleft size-medium wp-image-289&#34; height=&#34;300&#34; sizes=&#34;(max-width: 225px) 85vw, 225px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/Watchbot-IR_p-225x300.jpg&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/12/Watchbot-IR_p-225x300.jpg 225w, https://www.oiepoie.nl/wp-content/uploads/2014/12/Watchbot-IR_p-768x1024.jpg 768w, https://www.oiepoie.nl/wp-content/uploads/2014/12/Watchbot-IR_p-630x839.jpg 630w, https://www.oiepoie.nl/wp-content/uploads/2014/12/Watchbot-IR_p.jpg 800w&#34; width=&#34;225&#34;/&gt;&lt;/a&gt; After you reassemble the webcam head and screw in the lens, you will have to refocus to get a good picture again.&lt;br/&gt;
Have fun!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Philips Hue Lights into Domoticz and IFTTT functionality</title>
      <link>https://www.oiepoie.nl/2014/08/23/philips-hue-domoticz/</link>
      <pubDate>Sat, 23 Aug 2014 20:05:09 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2014/08/23/philips-hue-domoticz/</guid>
      <description>&lt;h2&gt;&lt;a class=&#34;extlink&#34; href=&#34;http://www.domoticz.com&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;Domoticz&#34;&gt;Domoticz&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt; is a great open source domotica solution. &lt;a href=&#34;http://www.domoticz.com&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34;&gt;&lt;img alt=&#34;Domoticz&#34; class=&#34;alignright size-medium wp-image-138&#34; height=&#34;119&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.31.30-300x119.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.31.30-300x119.png 300w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.31.30-500x199.png 500w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.31.30.png 961w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt;&lt;br/&gt;
If you have a &lt;a class=&#34;extlink&#34; href=&#34;http://www.raspberrypi.org/&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;Raspberry Pi&#34;&gt;Raspberry Pi&lt;/a&gt; lying around, it’s just a matter of &lt;a class=&#34;extlink&#34; href=&#34;http://sourceforge.net/projects/domoticz/files/&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;download domoticz&#34;&gt;downloading the SD-Card image&lt;/a&gt; from the site and there you go!&lt;br/&gt;
If you don’t have a Pi, buy one, it’s only thirty-some euro’s which is next to nothing for the versatility you get. Oh, and if you buy one, buy the Raspberry Pi B+ version since it has 4 USB ports and a 40 pin I/O header and it uses less energy.&lt;/p&gt;
&lt;p&gt;Allthough Domoticz supports a lot of hardware out of the box (check the &lt;a class=&#34;extlink&#34; href=&#34;http://www.domoticz.com/wiki/Main_Page&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;domoticz wiki&#34;&gt;Wiki&lt;/a&gt;), the fabulous Philips Hue lights are not among them, but it’s dead easy to integrate these using the standard functionality available.&lt;br/&gt;
So how is it done?&lt;/p&gt;
&lt;h6&gt;Step 1&lt;/h6&gt;
&lt;p&gt;The Hue Lights come with a &lt;strong&gt;Hue Bridge&lt;/strong&gt;&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/hue-bridge.jpg&#34;&gt;&lt;img alt=&#34;hue-bridge&#34; class=&#34;alignright border=&#34; height=&#34;150&#34; size-thumbnail=&#34;&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/hue-bridge-150x150.jpg&#34; width=&#34;150&#34; wp-image-110=&#34;&#34;/&gt;&lt;/a&gt;&lt;br/&gt;
which interfaces between your (wireless) network and the Zigbee protocol that the lights use. You need to find the ip-adres of the bridge, you can do that by looking into your router for the connected devices. The MAC address of your bridge is shown inside the Smartphone App (mine starts with &lt;code&gt;00:17:88&lt;/code&gt;, yours probably does too). While you’re in the router, make sure that the bridge gets a static IP address, that means coupling the bridge MAC address with a fixed IP address. Why? Because we’ll be using that IP address in our scripts and if it changes the scripts wont work 🙁&lt;br/&gt;
And, since you are here, be sure to do the same for the IP address of your Raspberry Pi!&lt;/p&gt;
&lt;p&gt;Ok, if you found the bridge IP address and you made it fixed, it’s now time to add an user to the bridge so we can use that to control the lights. This can be done by following the tutorial from Philips about the &lt;a class=&#34;extlink&#34; href=&#34;http://www.developers.meethue.com/documentation/getting-started&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;Philips Hue Bridge API&#34;&gt;Bridge API&lt;/a&gt; (API stands for Application Programming Interface).&lt;br/&gt;
Basically you fire up a browser (on the same network as the bridge lives) and go to:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;http://&amp;lt;bridge ip address&amp;gt;/debug/clip.html&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;From there you can use the API GUI to execute the command to create a new user:&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.43.17.png&#34;&gt;&lt;img alt=&#34;Hue API create new user&#34; class=&#34;alignright size-medium wp-image-145&#34; height=&#34;272&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.43.17-300x272.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.43.17-300x272.png 300w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.43.17-330x300.png 330w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.43.17.png 550w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and as a matter of security you have to press the link button on the Bridge before the command is executed.&lt;br/&gt;
When all went well you should now be able to control the lights through the CLIP API Debugger webpage.&lt;/p&gt;
&lt;p&gt;And also when you connect to your Pi from the command-line (ssh to the IP addres with user: pi and password: raspberry) you can set the lights with this command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;curl -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:true}&#39; http://ip-address/api/newdeveloper/lights/1/state&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;which turns the light on, and&lt;/p&gt;
&lt;p&gt;&lt;code&gt;curl -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:false}&#39; http://ip-address/api/newdeveloper/lights/1/state&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;which turns it off again.&lt;br/&gt;
If you get an error message about curl not being available, you might need to install it first with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo apt-get install curl&lt;/code&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;h6&gt;Step 2&lt;/h6&gt;
&lt;p&gt;This is about integrating Hue into Domoticz. After you fired up your Pi with the Domoticz SD-Card you should be able to access the web-interface on port 8080 of your P1: http://ip-address-of-Pi:8080&lt;br/&gt;
Goto &lt;b&gt;Setup -&amp;gt; Hardware&lt;/b&gt; and add a &lt;b&gt;Dummy&lt;/b&gt; device as shown in the screenshot. &lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.34.42.png&#34;&gt;&lt;img alt=&#34;Domoticz add Dummy Device&#34; class=&#34;alignright size-medium wp-image-119&#34; height=&#34;185&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.34.42-300x185.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.34.42-300x185.png 300w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.34.42-485x300.png 485w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.34.42.png 789w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt;, give it a name, and keep the state on &lt;b&gt;enabled&lt;/b&gt;&lt;br/&gt;
Next go to the &lt;b&gt;Switches&lt;/b&gt; TAB and click the button on the left to add a &lt;b&gt;Manual Light/Switch&lt;/b&gt;&lt;br/&gt;
Select the name from the virtual hardware device you just added and give this new switch some meaningful name. &lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.41.31.png&#34;&gt;&lt;img alt=&#34;Screen Shot 2014-08-23 at 16.41.31&#34; class=&#34;alignleft size-medium wp-image-121&#34; height=&#34;300&#34; sizes=&#34;(max-width: 279px) 85vw, 279px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.41.31-279x300.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.41.31-279x300.png 279w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.41.31.png 453w&#34; width=&#34;279&#34;/&gt;&lt;/a&gt;You can keep the type on X10, since that doesn’t matter; and also don’t worry about changing the X10 channel settings.&lt;br/&gt;
The new Light/Switch should now show up in the Domoticz Switches TAB.&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;&lt;/code&gt;&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;&lt;/code&gt;&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;&lt;/code&gt;&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;&lt;/code&gt;&lt;/p&gt;
&lt;h6&gt;Step 3&lt;/h6&gt;
&lt;p&gt;Now are we going to add the functionality to the new switch. Click the &lt;b&gt;Edit&lt;/b&gt; button on the switch and that will give you a window like this:&lt;br/&gt;
&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.49.14.png&#34;&gt;&lt;img alt=&#34;Domoticz edit Light/Switch&#34; class=&#34;aligncenter size-large wp-image-128&#34; height=&#34;298&#34; sizes=&#34;(max-width: 584px) 85vw, 584px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.49.14-1024x524.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.49.14-1024x524.png 1024w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.49.14-300x153.png 300w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.49.14-500x255.png 500w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-16.49.14.png 1235w&#34; width=&#34;584&#34;/&gt;&lt;/a&gt;&lt;br/&gt;
Now for the &lt;b&gt;On Action&lt;/b&gt; we are going to use a very simple script; ssh into your Pi with the pi user (password = raspberry) and change to the scripts directory:&lt;br/&gt;
&lt;code&gt;cd domoticz/scripts/&lt;/code&gt;&lt;br/&gt;
Copy the contents of the script below and don’t forget to fill in the right IP address of the Hue Bridge.&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
#!/bin/bash&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:true}&#39; http://your-bridge-IP-Address/api/newdeveloper/lights/1/state&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
Save the &lt;b&gt;On&lt;/b&gt; script:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
cat &amp;gt; hue_light_1_on.sh&lt;br/&gt;
#!/bin/bash&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:true}&#39; http://your-bridge-IP-Address/api/newdeveloper/lights/1/state&lt;br/&gt;
CTRL-D&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
And repeat this for the &lt;b&gt;Off&lt;/b&gt; script.&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
cat &amp;gt; hue_light_1_off.sh&lt;br/&gt;
#!/bin/bash&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:false}&#39; http://your-bridge-IP-Address/api/newdeveloper/lights/1/state&lt;br/&gt;
CTRL-D&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
Make both scripts executable:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
chmod 0755 hue_light*&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
And now fill in the reference to both scripts in de Domoticz webpage:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
ON:  script:///home/pi/domoticz/scripts/hue_light_1_on.sh&lt;br/&gt;
OFF: script:///home/pi/domoticz/scripts/hue_light_1_off.sh&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
Save is and test the switch by clicking on the lights. If it doesn’t do what you expect try running the scripts from within the ssh session, turning the light on:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
./hue_light_1_on.sh&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
and off:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
./hue_light_1_off.sh&lt;br/&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;h6&gt;Step 4&lt;/h6&gt;
&lt;p&gt;Apart from making a switch for a single Hue Light it’s just as easy to make a scene switch where you control a couple off lights and their brightness and/or color. It’s just a matter of combining the various commands into that on and off script.&lt;br/&gt;
For instance:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
#! /bin/bash&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:true,&#34;bri&#34;:203}&#39; http://IP-Address/api/newdeveloper/lights/1/state ; \&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:true,&#34;bri&#34;:205}&#39; http://IP-Address/api/newdeveloper/lights/2/state ; \&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:true,&#34;bri&#34;:91}&#39; http://IP-Address/api/newdeveloper/lights/3/state ; \&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:true,&#34;bri&#34;:136}&#39; http://IP-Address/api/newdeveloper/lights/4/state ; \&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:true,&#34;bri&#34;:255}&#39; http://IP-Address/api/newdeveloper/lights/5/state ;&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
and the accompanying off script:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
#! /bin/bash&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:false}&#39; http://IP-Address/api/newdeveloper/lights/1/state ; \&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:false}&#39; http://IP-Address/api/newdeveloper/lights/2/state ; \&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:false}&#39; http://IP-Address/api/newdeveloper/lights/3/state ; \&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:false}&#39; http://IP-Address/api/newdeveloper/lights/4/state ; \&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:false}&#39; http://IP-Address/api/newdeveloper/lights/5/state ;&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
Setting the Hue Lights Color is controlled this way:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X PUT --data &#39;{&#34;on&#34;:true, &#34;sat&#34;:255, &#34;bri&#34;:255,&#34;hue&#34;:10000}&#39; http://IP-Address/api/newdeveloper/lights/1/state&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
An easy way to set the right scene is to use your smartphone app until you are satisfied with the result and than request the parameters of all the lights to see how the are configured:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
curl -s -H &#34;Accept: application/json&#34; -X GET http://IP-Address/api/newdeveloper/lights&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
Or request this information via de Bridge CLIP API Debugger page we used earlier.&lt;/p&gt;
&lt;h6&gt;Step 5&lt;/h6&gt;
&lt;p&gt;So far it’s pretty amazing how simple you can create you own domotica system for an apple and an egg 😉&lt;br/&gt;
But the really &lt;b&gt;(REALLY!)&lt;/b&gt; big advantage is yet to come!&lt;br/&gt;
Domoticz has a Lego like logic system built in that’s called Blocky. It’s more ore less comparable with the functionality that you can get from &lt;a class=&#34;extlink&#34; href=&#34;http://ifttt.com&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;If This Than That&#34;&gt;IFTTT&lt;/a&gt; (If This Than That) but now fully within your own domotica system.&lt;br/&gt;
By using that system you can tell you Hue lights to activate 10 minutes after SunSet and go off at 11 pm. That means that you never have to adjust a timer in your live again because it’s getting dark earlier or later.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.20.29.png&#34;&gt;&lt;img alt=&#34;Domoticz Blocky&#34; class=&#34;aligncenter size-full wp-image-133&#34; height=&#34;356&#34; sizes=&#34;(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.20.29.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.20.29.png 714w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.20.29-300x149.png 300w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Screen-Shot-2014-08-23-at-17.20.29-500x249.png 500w&#34; width=&#34;714&#34;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h6&gt;Step 6&lt;/h6&gt;
&lt;p&gt;Relax and have a Brewski 😉&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Grolsch_small.jpg&#34;&gt;&lt;img alt=&#34;Grolsch&#34; class=&#34;alignright size-full wp-image-160&#34; height=&#34;217&#34; sizes=&#34;(max-width: 320px) 85vw, 320px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Grolsch_small.jpg&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2014/08/Grolsch_small.jpg 320w, https://www.oiepoie.nl/wp-content/uploads/2014/08/Grolsch_small-300x203.jpg 300w&#34; width=&#34;320&#34;/&gt;&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
