<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Raspberry-Pi on OiePoie!</title>
    <link>https://www.oiepoie.nl/tags/raspberry-pi/</link>
    <description>Recent content in Raspberry-Pi on OiePoie!</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 18 Feb 2015 15:24:58 +0100</lastBuildDate><atom:link href="https://www.oiepoie.nl/tags/raspberry-pi/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>RetroCasting with a Raspberry Pi</title>
      <link>https://www.oiepoie.nl/2015/02/18/retrocasting-with-a-raspberry-pi/</link>
      <pubDate>Wed, 18 Feb 2015 15:24:58 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2015/02/18/retrocasting-with-a-raspberry-pi/</guid>
      <description>&lt;h2&gt;Play Youtube Video’s on a TV with a Raspberry Pi&lt;/h2&gt;
&lt;p&gt;&lt;figure aria-describedby=&#34;caption-attachment-395&#34; class=&#34;wp-caption alignleft&#34; id=&#34;attachment_395&#34; style=&#34;width: 300px&#34;&gt;&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/TV_Raspberry_Pi_p.jpg&#34;&gt;&lt;img alt=&#34;Raspberry Pi driven TV with a Youtube video&#34; class=&#34;size-medium wp-image-395&#34; height=&#34;225&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/TV_Raspberry_Pi_p-300x225.jpg&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/TV_Raspberry_Pi_p-300x225.jpg 300w, https://www.oiepoie.nl/wp-content/uploads/2015/02/TV_Raspberry_Pi_p-1024x768.jpg 1024w, https://www.oiepoie.nl/wp-content/uploads/2015/02/TV_Raspberry_Pi_p-630x473.jpg 630w, https://www.oiepoie.nl/wp-content/uploads/2015/02/TV_Raspberry_Pi_p.jpg 2048w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34; id=&#34;caption-attachment-395&#34;&gt;Raspberry Pi driven TV with a Youtube video&lt;/figcaption&gt;&lt;/figure&gt;A couple of weeks we went to Maastricht were we stayed in a very nice design Hotel: &lt;a class=&#34;extlink&#34; href=&#34;https://www.townhousehotels.nl/en/&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;TownHouse Hotel&#34;&gt;TownHouse Hotel&lt;/a&gt;. There was a very nice ambiance which made us feel at home. The foyer was more like a large living room and next to the hammock there was an old portable TV which displayed content from the cable.&lt;br/&gt;
Back at home we bought a similar orange portable TV, which stood really nice on the bar in our orange kitchen. The next step was of course to get content on the screen, so extending the TV cable and having nothing interesting on the telly or doing something differently.&lt;/p&gt;
&lt;h2&gt;Raspberry Pi Tv Broadcasting Station&lt;/h2&gt;
&lt;p&gt;The Raspberry Pi has a video output (CVBS) on an RCA connector. When combined with an UHF modulater, this would provide the right signal to feed into the antenna input of the old TV. I bought a &lt;a href=&#34;http://www.ebay.co.uk/itm/RF-Modulator-UHF-Channel-21-69-Scart-CCTV-Convert-Aerial-TV-Phono-RCA/251699410008&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;RF modulator&#34;&gt;RF modulater of ebay&lt;/a&gt;, they are very cheap.&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/RF_Modulator.jpg&#34;&gt;&lt;img alt=&#34;RF_Modulator&#34; class=&#34;alignright size-full wp-image-401&#34; height=&#34;183&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/RF_Modulator.jpg&#34; width=&#34;222&#34;/&gt;&lt;/a&gt;. One thing, this RF modulator is for PAL (Phase Alternating Line) video, if you live in the States, you’ll need something which supports NTSC (Never The Same Colour :). Once u start using the modulator, you will need to configure the audio subchannel frequency, in the Netherlands thats at 5.5MHz (PAL B/G standard).&lt;br/&gt;
Now for configuring the Pi. Lets assume you have got one up and running (tutorials are all over the Internet). The software i used is &lt;a class=&#34;extlink&#34; href=&#34;https://pypi.python.org/pypi/whitey/0.4&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;Whitey&#34;&gt;whitey&lt;/a&gt; which can display youtube video’s in console mode (so you don’t have to mess around running X-Windows).&lt;br/&gt;
You only need a couple of things for this. At first download youtube-dl&lt;br/&gt;
&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
sudo apt-get install youtube-dl&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
Whitey itself is not in the debian repository, but since it’s a python program it can be easily installed with those tools. You will need “pip” to do that:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
sudo apt-get install python-pip&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
And next use pip to install whitey&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
sudo pip install whitey&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
On the Raspberry Pi you need omxplayer to display the video’s. Normally that should be possible by using “pi-yt”, but there is a bug which prevents it from running (at least on my Pi). But with linux there is always an other way to do things, so use the next command line:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
yt --player=omxplayer&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
That should give you a text screen with youtube video’s. Now try to play one by entering the number of your choice.&lt;/p&gt;
&lt;h2&gt;Connecting everything together&lt;/h2&gt;
&lt;p&gt;If you used the HDMI connection on you Pi during this setup, do a shutdown and disconnect the HDMI and connect the RCA video out connector to the RF modulator. Also connect sound to the modulator (you will need a conversion cable for that). Next switch on the Pi and the RF modulator. Select a channel, connect to your TV and tune into that channel.&lt;br/&gt;
On my TV the text is barely readable, but still enough to give you an indication of whats going on. &lt;/p&gt;
&lt;h2&gt; Remote Control&lt;/h2&gt;
&lt;p&gt;&lt;figure aria-describedby=&#34;caption-attachment-411&#34; class=&#34;wp-caption alignleft&#34; id=&#34;attachment_411&#34; style=&#34;width: 300px&#34;&gt;&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/Screen-Shot-2015-02-18-at-15.43.58.png&#34;&gt;&lt;img alt=&#34;YT Youtube commandline player&#34; class=&#34;size-medium wp-image-411&#34; height=&#34;234&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; src=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/Screen-Shot-2015-02-18-at-15.43.58-300x234.png&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/Screen-Shot-2015-02-18-at-15.43.58-300x234.png 300w, https://www.oiepoie.nl/wp-content/uploads/2015/02/Screen-Shot-2015-02-18-at-15.43.58.png 589w&#34; width=&#34;300&#34;/&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34; id=&#34;caption-attachment-411&#34;&gt;YT Youtube commandline player&lt;/figcaption&gt;&lt;/figure&gt;There is a very simple way to remote control what’s being played, that’s by using the program “screen”. First install it onto your Raspberry:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
sudo apt-get install screen&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
Next fire it up by typing in:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
screen&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
Now you have a shell session that stays active when you disconnect and can ben taken over from another computer. Screen has many more &lt;a class=&#34;extlink&#34; href=&#34;http://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; title=&#34;Screen&#34;&gt;handy features&lt;/a&gt;. So from type in the command to start up yt again:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
yt --player=omxplayer&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
And now from an other computer use ssh to connect to your Pi:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
ssh pi@ip-adress&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
when you have logged in, use screen to attach to the running session:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
screen -x&lt;br/&gt;
&lt;/code&gt;&lt;br/&gt;
And now you can search and play the youtube vid’s from here while they get displayed on your retro TV.&lt;/p&gt;
&lt;h2&gt;RetroCasting&lt;/h2&gt;
&lt;p&gt;The fun part is playing really old video’s because it’s like you have a time-machine, looking back into the past. The blurry picture and lofi sound just add to this experience 🙂&lt;br/&gt;
&lt;a href=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/IMG_0265_p.jpg&#34;&gt;&lt;img alt=&#34;IMG_0265_p&#34; class=&#34;aligncenter size-large wp-image-405&#34; height=&#34;473&#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/2015/02/IMG_0265_p-1024x768.jpg&#34; srcset=&#34;https://www.oiepoie.nl/wp-content/uploads/2015/02/IMG_0265_p-1024x768.jpg 1024w, https://www.oiepoie.nl/wp-content/uploads/2015/02/IMG_0265_p-300x225.jpg 300w, https://www.oiepoie.nl/wp-content/uploads/2015/02/IMG_0265_p-630x473.jpg 630w, https://www.oiepoie.nl/wp-content/uploads/2015/02/IMG_0265_p.jpg 2048w&#34; width=&#34;630&#34;/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&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>
