<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OpenHab &#8211; BeatificaBytes</title>
	<atom:link href="https://www.BeatificaBytes.be/tag/openhab/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.BeatificaBytes.be</link>
	<description>The Joys of Computing</description>
	<lastBuildDate>Sun, 09 Jan 2022 16:15:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>
	<item>
		<title>How to identify the Philips Hue sensors in OpenHab ?</title>
		<link>https://www.BeatificaBytes.be/how-to-identify-the-philips-hue-sensors-in-openhab/</link>
					<comments>https://www.BeatificaBytes.be/how-to-identify-the-philips-hue-sensors-in-openhab/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 09 Jan 2022 16:15:33 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[OpenHab]]></category>
		<category><![CDATA[Philips Hue]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=5208</guid>

					<description><![CDATA[When looking at the Things within OpenHab, each &#8220;Hue Motion Sensor&#8221; device appears as multiple things: the &#8220;Motion sensor xyz&#8221; itself but also a &#8220;Hue [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">When looking at the Things within OpenHab, each &#8220;Hue Motion Sensor&#8221; device appears as multiple things: the &#8220;Motion sensor xyz&#8221; itself but also a &#8220;Hue ambient light sensor i&#8221; and a &#8220;Hue temperature sensor i&#8221;. &#8220;Motion sensor xyz&#8221; is the name you gave to the device via the Philips Hue App and &#8220;i&#8221; is a sequential id which can&#8217;t be easily linked to the related &#8220;Motion sensor&#8221; device&#8230; The App Hue Essentials can help you !</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfbe031"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b276dfbe031'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfbe031" class="collapseomatic_content ">
<p style="text-align: justify;">On the screenshot bellow, one can see that I have renamed the Motion Sensors into &#8220;Motion sensor Door&#8221; and &#8220;Motion sensors Entry&#8221;, within the Philips Hue App. NB.: Only the Motion sensors appears in the Philips Hue App. One doesn&#8217;t see the Temperature and Ambient Light sensors&#8230;</p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-5212 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2022/01/Pasted-3.png" /></p>
<p style="text-align: justify;">In OpenHab, we see all the sensors, but the Ambient Light and Temperature sensors are not named accordingly to the related Motion sensors. Instead, the are named &#8220;Hue ambient light sensor i&#8221; and a &#8220;Hue temperature sensor i&#8221; and one has no idea which one is part of the &#8220;Motion sensor Door&#8221; or &#8220;Motion sensor Entry&#8221;:</p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-5211 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2022/01/Pasted-2.png" /></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">The <a href="https://play.google.com/store/apps/details?id=com.superthomaslab.hueessentials" target="_blank" rel="noopener noreferrer">App Hue Essentials</a> is not free but is really great (opposite to Philips Hue, you can for example control devices from multiples Bridges without switching from one to the other all the time). It&#8217;s the first App I found, made for end users (and not for developers), which give access to the internal sensors of a selected device. I.e.: the other Apps list all the sensors but does not tell which sensors belongs to which device.</p>
<p style="text-align: justify;">One way to identify which sensor belongs to which device is to go to the Devices (1) within the App Hue Essentials, select the device (2).</p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-5214 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2022/01/Pasted-5.png" /></p>
<p style="text-align: justify;">Next , select, the menu Details (1 then 2):</p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-5215 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2022/01/Pasted-6.png" /></p>
<p style="text-align: justify;">In these details, you see the Identifier of the device. Here, the identifier is 13. </p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-5217 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2022/01/Pasted-8.png" /></p>
<p style="text-align: justify;">Back into OpenHab, you can now filter the list of Things on &#8216;:13&#8217; and find the device. </p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-5219 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2022/01/Pasted-10.png" /></p>
<p style="text-align: justify;">That was quite useless as the name of the device is the same in OpenHab and Philips Hue&#8230; but you can see that, obviously, the &#8220;Unique ID&#8221; displayed in Hue Essentials (00:17:88:01:06:44:42:35) is not the full id displayed (0107:ecb5fa857069)..</p>
<p style="text-align: justify;">One can do the same to find the id of the other sensors of this device: instead of the menu &#8220;Details&#8221;, select now the menu &#8220;Temperature&#8221; or &#8220;Light Level&#8221;. One can see immediatly the name of the related sensor (Here under &#8220;Hue light sensor 1&#8221;). One can also take the menu &#8220;Detail&#8221; (1) to take note of the identifier (here under &#8220;14&#8221;) to filter for it in OpenHab&#8217;s Things list.</p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-5222 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2022/01/Pasted-13.png" /></p>
<p style="text-align: justify;">The best is however to rename these sensors according to their device (The &#8220;Hue light sensor 1&#8221; could be renamed &#8220;Hue light sensor Door&#8221;), remove all of them (especially the &#8220;Motion Sensors&#8221; which were properly named otherwise,  the other sensors won&#8217;t be re-detected) and rescan for Hue&#8217;s Things in OpenHab.</p>
<p style="text-align: justify;">Et voilà.</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_5208" class="pvc_stats total_only  " data-element-id="5208" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/how-to-identify-the-philips-hue-sensors-in-openhab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Install Z-Stick &#038; ConBee II on RPI/Openhabian</title>
		<link>https://www.BeatificaBytes.be/install-z-stick-conbee-ii-on-rpi-openhabian/</link>
					<comments>https://www.BeatificaBytes.be/install-z-stick-conbee-ii-on-rpi-openhabian/#comments</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Wed, 05 Jan 2022 20:27:15 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<category><![CDATA[ZigBee]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=5198</guid>

					<description><![CDATA[Here is how to configure properly an Aeotec Z-Stick Gen5 and a Conbee II stick on a RPI 4 installed with Openhabian (running OpenHab 3)]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">Here is how to configure properly an Aeotec Z-Stick Gen5 and a Conbee II stick on a RPI 4 installed with Openhabian (running OpenHab 3)</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfbfebc"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b276dfbfebc'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfbfebc" class="collapseomatic_content ">
<p style="text-align: justify;">First, be sure that openhabian can access the serial ports. The easiest is to configure that via openhabian-config &gt; System Settings &gt; Serial Port:</p>
<blockquote>
<p>sudo openhabian-config </p>
</blockquote>
<p style="text-align: justify;">You can also do it with raspi-config &gt; Interfacing Options &gt; Serial :</p>
<blockquote>
<p>sudo apt-get install raspi-config<br />sudo raspi-config</p>
<p>&gt; Would you like a login shell accessible over serial? → <strong>No</strong><br />&gt; Would you like the serial port hardware to be enabled? → <strong>Yes</strong></p>
</blockquote>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Next, check that the sticks are well plugged with the command:</p>
<blockquote>
<p>lsusb</p>
</blockquote>
<p style="text-align: justify;">You should see something like</p>
<blockquote>
<p>Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br /><strong>Bus 001 Device 011: ID <span style="color: #0000ff;">1cf1</span>:<span style="color: #008000;">0030</span> Dresden Elektronik ZigBee gateway [ConBee II]</strong><br /><strong>Bus 001 Device 005: ID <span style="color: #0000ff;">0658</span>:<span style="color: #008000;">0200</span> Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) &#8211; UZB</strong><br />Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub<br />Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</p>
</blockquote>
<p style="text-align: justify;">In order to always have the USB sticks mounted on the same &#8220;port&#8221;, instead of being assigned once on /dev/ttyACM0, once on /dev/ttyACM1, &#8230; create a UDEV Rule file:</p>
<blockquote>
<p>sudo nano /etc/udev/rules.d/99-usb-serial.rules</p>
</blockquote>
<p style="text-align: justify;">Type the following, using the ID of the USB sticks found above, in this file:</p>
<blockquote>
<p>SUBSYSTEM==&#8221;tty&#8221;, ATTRS{idVendor}==&#8221;<span style="color: #0000ff;">0658</span>&#8220;, ATTRS{idProduct}==&#8221;<span style="color: #008000;">0200</span>&#8220;, SYMLINK+=&#8221;ttyUSB-ZWave&#8221;, GROUP=&#8221;dialout&#8221;, MODE=&#8221;0666&#8243;<br />SUBSYSTEM==&#8221;tty&#8221;, ATTRS{idVendor}==&#8221;<span style="color: #0000ff;">1cf1</span>&#8220;, ATTRS{idProduct}==&#8221;<span style="color: #008000;">0030</span>&#8220;, SYMLINK+=&#8221;ttyUSB-ZigBee&#8221;, GROUP=&#8221;dialout&#8221;, MODE=&#8221;0666&#8243;</p>
</blockquote>
<p style="text-align: justify;">If you didn&#8217;t prepare openhabian for ZigBee via sudo openhabian-config &gt; System Settings &gt; Serial Port, grant the following access for openhab :</p>
<blockquote>
<p>sudo adduser openhab dialout<br />sudo adduser openhab tty</p>
</blockquote>
<p style="text-align: justify;">Now, reboot (sudo reboot) and test if symlink was created with the command :</p>
<blockquote>
<p>ls /dev/tty*</p>
</blockquote>
<p style="text-align: justify;">You should see</p>
<blockquote>
<p>/dev/ttyUSB-ZigBee<br />/dev/ttyUSB-ZWave</p>
</blockquote>
<p style="text-align: justify;">Add edit openhab config file to add the symlinks to the PATH variable for Java (NB: for openhab 2, the file is namge openhab2 !!):</p>
<blockquote>
<p>sudo nano /etc/default/openhab</p>
</blockquote>
<p style="text-align: justify;">Search the line with EXTRA_JAVE_OPTS and modify accordingly to complete the parameter &#8216;Dgnu.io.rxtx.SerialPorts&#8217;:</p>
<blockquote>
<p>EXTRA_JAVA_OPTS=&#8221;-Xms192m -Xmx320m <strong><span style="color: #0000ff;">-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB-ZWave:/dev/ttyUSB-ZigBee</span></strong>&#8220;</p>
</blockquote>
<p style="text-align: justify;">Now, reboot again (sudo reboot) and install Phoscon, the application to manage the ZigBee devices. The easiest is to install it (on port 8081 as recommended) via openhabian-config &gt; Optional Components &gt; deCONZ:</p>
<blockquote>
<p>sudo openhabian-config</p>
</blockquote>
<p style="text-align: justify;">You can also look <a href="https://phoscon.de/en/raspbee/install#raspbian" target="_blank" rel="noopener noreferrer">here</a> on the phoscon website for a manual setup</p>
<p style="text-align: justify;">If you have a RPI 4B, also update the WiringPI like this:</p>
<blockquote>
<p>cd /tmp<br />wget https://project-downloads.drogon.net/wiringpi-latest.deb<br />sudo dpkg -i wiringpi-latest.deb</p>
</blockquote>
<p style="text-align: justify;">You can now open phoscon to login and search for ZigBee devices on http://&lt;your RPI IP&gt;:8081</p>
<p>If after a reboot, this UI is not available, then enable manually the service:</p>
<blockquote>
<p>sudo systemctl enable deconz</p>
</blockquote>
<p>If you want to change the port of Phoscon, edit the parameter &#8216;http-port&#8217; in this file:</p>
<blockquote>
<p>sudo nano /lib/systemd/system/deconz.service</p>
</blockquote>
<p> </p>
<p style="text-align: justify;">Finally, install the following addons (Bindings) in OpenHab :</p>
<ul style="text-align: justify;">
<li>&#8220;Dresden Elektronik deCONZ Binding&#8221;</li>
<li>&#8220;Z-Wave Binding&#8221;</li>
</ul>
<p style="text-align: justify;">The ConBee gateway will be detected automatically by OpenHab and appear twice in the &#8216;Inbox&#8217;: once as Deconz and once as Hue (indeed, it emulates a Philips Hue Bridge). If it was not detected automatically, open the Phoscon UI &gt; Gateway &gt; Advanced (Gear Icon at the bottom of the page) and CLick on &#8220;Authenticat App&#8221;. Then add the Thing manually into OpenHab using the Scan button of:</p>
<blockquote>
<p>OpenHab UI &gt; Administration &gt; Parameters &gt; Things &gt; + (Add Thing) &gt; Dresden Elektronik deCONZ Binding</p>
</blockquote>
<p> </p>
<p style="text-align: justify;">The Zwave gateway will only appear if you add it explicitly into OpenHab:</p>
<blockquote>
<p>OpenHab UI &gt; Administration &gt; Parameters &gt; Things &gt; + (Add Thing) &gt; Z-Wave Binding &gt; Z-Wave Serial Controller</p>
<p>In the field Serial Port, type manually &#8216;/dev/ttyUSB-ZWave&#8217; (without the quotes) and click &#8216;Create Thing&#8217;</p>
</blockquote>
<p style="text-align: justify;">Wait for about 10 seconds and the gateway will soon become online.</p>
<p style="text-align: justify;">Et voilà.</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_5198" class="pvc_stats total_only  " data-element-id="5198" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/install-z-stick-conbee-ii-on-rpi-openhabian/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>RPI 4/Openhabian into an Argon One Case</title>
		<link>https://www.BeatificaBytes.be/rpi-openhabian-into-an-argon-one-case/</link>
					<comments>https://www.BeatificaBytes.be/rpi-openhabian-into-an-argon-one-case/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Wed, 05 Jan 2022 18:17:10 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=5195</guid>

					<description><![CDATA[  If you installed Openhabian onto an RPI hosted into an Argon Once Case, here is how to configure the Argon One.]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">If you installed Openhabian onto an RPI hosted into an Argon Once Case, here is how to configure the Argon One.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfc17ee"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b276dfc17ee'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfc17ee" class="collapseomatic_content ">
<p style="text-align: justify;">Install the scripts to manage to Argon One&#8217;s features:</p>
<blockquote>
<p>sudo curl https://download.argon40.com/argon1.sh | bash</p>
</blockquote>
<p style="text-align: justify;">Configure the fan cooler, for example depending on the temperature, with the command:</p>
<blockquote>
<p>sudo argonone-config</p>
</blockquote>
<p style="text-align: justify;">Select the option 2 and type 10 for 55 °C, 55 for 60 °C and 100 for 65 °C, meaning that the fan speed will by 10% at 55 °C, etc&#8230;</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">In order to configure the Argon One to turn on automatically after a power failure, you have first to enable the i2C. The easiest is to do it with the raspi-config command, which can be installed with:</p>
<blockquote>
<p>sudo apt-get install raspi-config</p>
</blockquote>
<p style="text-align: justify;">Then run it:</p>
<blockquote>
<p>sudo raspi-config</p>
</blockquote>
<p style="text-align: justify;">And go to the menu &#8220;Interface option&#8221;, and select the entry &#8220;I2C&#8221; to enable the loading of the I2C kernel module.</p>
<p style="text-align: justify;">Now you can check that it works with the command:</p>
<blockquote>
<p>i2cdetect -y 1</p>
</blockquote>
<p style="text-align: justify;">And finally set the Power-On feature with the command:</p>
<blockquote>
<p>i2cset -y 1 0x01a 0xfe</p>
</blockquote>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Now, you can press the power button of the Argon One :</p>
<ul style="text-align: justify;">
<li>twice to reboot</li>
<li>+3 sec to shutdown and power off</li>
<li>+5 sec to force the shutdown</li>
</ul>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Et voilà</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_5195" class="pvc_stats total_only  " data-element-id="5195" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/rpi-openhabian-into-an-argon-one-case/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to create a recursive Timer in OpenHab3&#8217;s DSL Rule</title>
		<link>https://www.BeatificaBytes.be/how-to-create-a-recursive-timer-in-openhab3s-dsl-rule/</link>
					<comments>https://www.BeatificaBytes.be/how-to-create-a-recursive-timer-in-openhab3s-dsl-rule/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 16 May 2021 21:08:54 +0000</pubDate>
				<category><![CDATA[SmartHome]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4967</guid>

					<description><![CDATA[I wanted a DSL Script to send a notification email if a door was still opened after several checks. There are various options to achieve [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">I wanted a DSL Script to send a notification email if a door was still opened after several checks.</p>
<p style="text-align: justify;">There are various options to achieve this purpose.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfc3148"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b276dfc3148'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfc3148" class="collapseomatic_content "></p>
<p style="text-align: justify;">A simple option could have been to use a Switch Item with an Expire Property. When the door opens, set that Switch Item to &#8216;ON&#8217; and initialize a Number Item to be count how many checks will be done. When the Switch Item expires, execute a script which checks if the door is still opened. If it is not, that script ends. Otherwise, it increases the Item Number. If that Item Number is lower than the maximum checks to be done (your threshold), Set back the Switch Item to &#8216;ON&#8217;. Otherwise, send the notification email.</p>
<p style="text-align: justify;">Another option (just for fun) relies on a DSL Script with a lamdba expression which creates a Timer calling itself recursively until the door is closed or your threshold is reached. That DLS Script must be called when the Door opens.</p>
<p style="text-align: justify;">Here after a Number Item SensorGarageDoor_Duration is used to count the number of checks: The Item SensorGarageDoor_OpenClose is the state of the Sensor on the Door.</p>
<pre>[js]
val int treshold = 3
var int attempt = 0

// Define a Lambda Expression to check if the Door is open and if not,
// call itself after 15 minutes to check again until a treshold of calls is reached
val Functions$Function1 Monitor = [	Functions$Function1 recursive |
	if (SensorGarageDoor_OpenClose.state == OPEN) {
		logInfo("default.rules", "Monitor Opened Door")
		createTimerWithArgument(now.plusMinutes(15), recursive, [ Functions$Function1 callMonitor |
				var int duration = (SensorGarageDoor_Duration.state as Number).intValue + 1
				SensorGarageDoor_Duration.sendCommand(duration)
				logInfo("default.rules", "Garage Opened since " + duration.toString + " cycle(s)")
				if (duration == treshold) {
					logInfo("default.rules", "Notify by email that Garage still Opened after " + duration.toString + " cycles")
					val mailActions = getActions("mail", "your smtp binding")
					val success = mailActions.sendMail("your from", "your subject", "your message")
				} else if (duration &lt; treshold) {
					callMonitor.apply(callMonitor)
				}
			])
	} else {
		logInfo("default.rules", "Stop monitoring Door")
	}
	true]
	
if (SensorGarageDoor_Duration.state != NULL) {
	attempt = (SensorGarageDoor_Duration.state as Number).intValue
} else {
	attempt = treshold
}

if (attempt &gt;= treshold) {
	logInfo("default.rules", "Request for monitoring Opened Door")
	SensorGarageDoor_Duration.sendCommand(0)
	Monitor.apply(Monitor)
} else {
	logInfo("default.rules", "New request for monitoring Opened Door ignored")
}
[/js]</pre>
<p style="text-align: justify;">One of the trick is to pass the Lambda Expression as parameter to the Timer (Created with createTimerWithArgument). Indeed, a Timer may not call a &#8220;Global&#8221; Lambda Expression. To get a Lambda Expression as parameter, this parameter must be defined as Functions$FunctionX (where X is the amount of parameters of the Lambda Expression). In my sample above, my Lambda as one parameter which is itself, to be passed to the Trigger (So, it is typed Functions$Function1).</p>
<p style="text-align: justify;">You must type explicitly the parameters as Functions$Function1 to be able to use the method &#8220;apply()&#8221;.</p>
<p style="text-align: justify;"><span style="font-size: inherit; text-align: justify;"></div></span></p>
<div class="pvc_clear"></div>
<p id="pvc_stats_4967" class="pvc_stats total_only  " data-element-id="4967" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p>
<div class="pvc_clear"></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/how-to-create-a-recursive-timer-in-openhab3s-dsl-rule/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Xiamo Aqara and Openhab on Raspberry Pi</title>
		<link>https://www.BeatificaBytes.be/xiamo-aqara-and-openhab-on-raspberry-pi/</link>
					<comments>https://www.BeatificaBytes.be/xiamo-aqara-and-openhab-on-raspberry-pi/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 16 May 2021 14:00:05 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<category><![CDATA[Xiaomi]]></category>
		<category><![CDATA[ZigBee]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4963</guid>

					<description><![CDATA[A few notes on using Xiaomi Aqara Sensors and Switches with Openhab 3.]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">A few notes on using Xiaomi Aqara Sensors and Switches with Openhab 3.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfc44f1"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b276dfc44f1'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfc44f1" class="collapseomatic_content ">
<p style="text-align: justify;">I am using a Zigbee USB key <a href="https://phoscon.de/en/conbee2" target="_blank" rel="noopener noreferrer">Conbee II</a> from <a href="https://www.dresden-elektronik.de/produkte.html" target="_blank" rel="noopener noreferrer">Dresen Eletronik</a>.</p>
<p style="text-align: justify;">It is plugged into the Raspberry Pi with a USB cable extension to put it away from the other keys used on this RPi, like my Sigma Z-Wave controller.</p>
<p style="text-align: justify;">I am sing OpenHab 3 (previously OpenHab 2).</p>
<p style="text-align: justify;">Opposite to the Sigma Z-Wave USB key, there is not <a href="https://community.openhab.org/t/raspberry-pi-make-serial-usb-ports-persistent-via-symlinks/35847" target="_blank" rel="noopener noreferrer">mount issue</a> after a reboot due to the usb port id increasing&#8230; (See also <a href="https://www.freva.com/fr/2019/06/20/attribuer-des-noms-de-port-usb-fixes-a-votre-raspberry-pi/" target="_blank" rel="noopener noreferrer">a solution</a> in French).</p>
<p style="text-align: justify;">I am using the <a href="https://phoscon.de/en/raspbee2/install#raspbian" target="_blank" rel="noopener noreferrer">Phoscon App</a> to connect and manage devices via the Conbee II key. The App is accessible on the http port 80 of the Raspberry.</p>
<p style="text-align: justify;">To connect a new Xiaomi Aqara device,</p>
<ol style="text-align: justify;">
<li>&#8220;Add a Sensor&#8221; or a &#8220;Add a Switch&#8221; within Phoscon. Pick the type &#8220;Other&#8221;.</li>
<li>Press the reset button for 5 sec. The blue led should turn on and start blinking after 5 sec. Release the button immediately when it starts blinking. The led will then turn on for 2 or 3 sec and then blink 3 times. It means that the connection is established.</li>
<li>A few second later, the device will appear in Phoscon.</li>
</ol>
<p style="text-align: justify;">To get the Things into Openhab, Add the Binding &#8220;Dresen Eletronik DeCONZ Binding&#8221; and &#8220;Scan&#8221; for devices.</p>
<p style="text-align: justify;">I am using with success:</p>
<ul style="text-align: justify;">
<li>Multi Sensors : with values for Temperature, Humidity and Pressure</li>
<li>Door and Window Sensors: with Status Opened / Closed</li>
<li>A Cube : with events Pushed (various direction), Rotation, Shacked</li>
<li>Wireless Mini Switch : One Button Control with 4 events: Single Press, Double Press, Long Press and Long Press Release</li>
</ul>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Notice: </p>
<ul style="text-align: justify;">
<li>after a few month using the Door Sensors on my Garage Door, it stopped to send events&#8230; The problem was that the captor part was attached on a metal upright which ended to be magnetized by the magnet part moving around&#8230;</li>
</ul>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4963" class="pvc_stats total_only  " data-element-id="4963" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/xiamo-aqara-and-openhab-on-raspberry-pi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>USB ports used by openHab&#8217;s Z-Wave Controller change after each reboot on RPI</title>
		<link>https://www.BeatificaBytes.be/usb-ports-used-by-openhabs-z-wave-controller-change-after-each-reboot-on-rpi/</link>
					<comments>https://www.BeatificaBytes.be/usb-ports-used-by-openhabs-z-wave-controller-change-after-each-reboot-on-rpi/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Wed, 07 Apr 2021 12:34:16 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4958</guid>

					<description><![CDATA[Usually, USB keys get assigned a new port such as /dev/ttyACM0, /dev/ttyACM1, etc&#8230;, each time they are unplugged and replugged into the RPI or if [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">Usually, USB keys get assigned a new port such as /dev/ttyACM0, /dev/ttyACM1, etc&#8230;, each time they are unplugged and replugged into the RPI or if the RPI reboots. A solution consists in making these ports permanent via <em>symlinks</em>.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfc59f2"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b276dfc59f2'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfc59f2" class="collapseomatic_content ">
<p style="text-align: justify;">This &#8220;feature&#8221; is a problem as the specified device may not be recognized anymore by configured softwares, like the Z-Wave Binding or openHab.</p>
<p style="text-align: justify;">See a definitive solution <a href="https://community.openhab.org/t/raspberry-pi-make-serial-usb-ports-persistent-via-symlinks/35847" target="_blank" rel="noopener noreferrer">here</a>: make serial USB ports persistent via <em>symlinks</em>.</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4958" class="pvc_stats total_only  " data-element-id="4958" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/usb-ports-used-by-openhabs-z-wave-controller-change-after-each-reboot-on-rpi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Easily Backup openHab into a Shared  Folder</title>
		<link>https://www.BeatificaBytes.be/easily-backup-openhab-into-a-shared-folder/</link>
					<comments>https://www.BeatificaBytes.be/easily-backup-openhab-into-a-shared-folder/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 20 Dec 2020 09:50:38 +0000</pubDate>
				<category><![CDATA[SmartHome]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4883</guid>

					<description><![CDATA[I am running openHab2 on my raspberry pi 4 using openhabian and I wanted to schedule a backup of my config into a shared folder [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">I am running openHab2 on my raspberry pi 4 using openhabian and I wanted to schedule a backup of my config into a shared folder of my Synology.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfc728e"  tabindex="0" title="Backup as root"    >Backup as root</span><span id='swap-id69b276dfc728e'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfc728e" class="collapseomatic_content ">
<p style="text-align: justify;">Openhabian&#8217;s backup solution &#8216;Amanda&#8217; didn&#8217;t convince me to automate such a backup. So I wrote my own backup script and scheduled it with a cron job.</p>
<p style="text-align: justify;">First, create a shared folder named &#8220;backups&#8221; on your Synology via Control Panel &gt; Shared Folder &gt; Create:</p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-4884 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2020/12/Pasted.png" /></p>
<p style="text-align: justify;">Next, create a user account named &#8220;backup&#8221; via Control Panel &gt; User &gt; Create:</p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-4885 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2020/12/Pasted-1.png" /></p>
<p style="text-align: justify;">Grant that account write access on the shared folder &#8220;backups&#8221; via Control Panel &gt; User &gt; backup &gt; Edit &gt; Read/Write</p>
<p style="text-align: justify;"><img decoding="async" class="alignnone wp-image-4887 size-full" src="http://www.beatificabytes.be/wp-content/uploads/2020/12/Pasted-3.png" /></p>
<p style="text-align: justify;">The Synology part being ready, move now to openhabian, on the RPI, using a ssh console (E.g.: Putty) to create and schedule the backup script. Most parts will have to be done as &#8216;root&#8217; (to make it simpler&#8230; but no safer), so type;</p>
<blockquote>
<pre>sudo -i</pre>
</blockquote>
<p style="text-align: justify;">If just like me you previously tried to configure the backup with Amanda, using the command &#8220;sudo openhabian-config&#8221; and then the menu 50 &gt; 52, a mailer daemon (exim4) was probably installed and you want now to remove it&#8230; Check if it&#8217;s running (not with the command &#8220;systemctl &#8211;type=service &#8211;state=running&#8221; but) with:</p>
<blockquote>
<pre>sudo service --status-all</pre>
</blockquote>
<p style="text-align: justify;">If you see a + in front of exim4, disable and remove it</p>
<blockquote>
<pre>sudo systemctl stop exim4<br />sudo systemctl disable exim4<br />sudo apt-get remove exim4 exim4-base exim4-config exim4-daemon-light<br />sudo rm -r /var/log/exim4/</pre>
</blockquote>
<p style="text-align: justify;">You can also next uninstall and remove Amanda</p>
<blockquote>
<pre>sudo apt remove amanda-client<br />sudo apt remove amanda-server<br />sudo rm -r /var/lib/amanda/<br />sudo rm -r /etc/amanda</pre>
</blockquote>
<p style="text-align: justify;">Now, we can start with the preparation of the backup script. Define first a mount point on your RPI. E.g.: &#8220;/mnt/backups&#8221;:</p>
<blockquote>
<p>mkdir /mnt/backups</p>
</blockquote>
<p style="text-align: justify;">Define next the shared folder of your Synology by editing the fstab file:</p>
<blockquote>
<p>sudo nano /etc/fstab </p>
</blockquote>
<p style="text-align: justify;">Add the line here under in that file and save your change with CTRL-o, Enter, CTRL-x:</p>
<blockquote>
<p>//&lt;ip of your Synology&gt;/backups /mnt/backups cifs username=backup,password=&lt;password&gt;,uid=1000,gid=1000,vers=3.0 0 0</p>
</blockquote>
<p style="text-align: justify;">Attention: the network is usually not yet available when the fstab file is used to mount the drives a boot time. So this shared folder will most probably not be mounted automatically!</p>
<p style="text-align: justify;">Create a file:</p>
<blockquote>
<pre>nano /home/openhabian/maintenance.sh</pre>
</blockquote>
<p style="text-align: justify;">with the backup script here under:</p>
<blockquote>
<pre><code>#!/bin/sh</code></pre>
<pre># Backup Openhab of Synology<br />log="/var/log/maintenance.log"<br /><br />echo $(date) "Run openhab maintenance: $0" &gt;&gt; $log<br /><br />if mountpoint -q /mnt/backups<br />then<br />echo $(date) "Synology's backups share is mounted." &gt;&gt; $log<br />else<br /> echo $(date) "Synology's backups share is not mounted. Try to mount as per fstab definition." &gt;&gt; $log<br /> sudo mount /mnt/backups<br /> sleep 3<br /> if mountpoint -q /mnt/backups<br /> then<br />  echo $(date) "Synology's backups share is now successfully mounted." &gt;&gt; $log<br /> else<br />  echo $(date) "Synology's backups share cannot be mounted." &gt;&gt; $log<br /> fi<br />fi<br /><br />if mountpoint -q /mnt/backups<br />then<br /># Keep the 10 last backups<br />rm -f $(ls -1t /mnt/backups/Raspberry/openhab2-backup-* | tail -n +11)<br />cd $OPENHAB_HOME<br />sudo ./runtime/bin/backup /mnt/backups/Raspberry/openhab2-backup-"$(date +"%Y_%m_%d_%I_%M").zip" &gt;&gt; $log<br />echo $(date) "custom backups of openhab completed." &gt;&gt; $log<br />echo "-----------------------------------------------------------------" &gt;&gt; $log<br />fi</pre>
</blockquote>
<blockquote>
<pre> </pre>
</blockquote>
<p style="text-align: justify;">Make that script executable (for all users&#8230;)</p>
<blockquote>
<pre>sudo chmod a+x maintenance.sh</pre>
</blockquote>
<p style="text-align: justify;">To run that script as root on a regular basis, you have to schedule it as root (using now <span style="text-decoration: underline;"><strong>sudo</strong></span> explicitly if you didn&#8217;t type sudo -i earlier) via <a href="https://raspberrytips.com/schedule-task-raspberry-pi/" target="_blank" rel="noopener noreferrer">crontab</a>:</p>
<blockquote>
<pre>sudo crontab -e</pre>
</blockquote>
<p style="text-align: justify;">If it&#8217;s the first time you run crontab, you will have to pick your prefered editor. I advice nano <img src="https://s.w.org/images/core/emoji/15.1.0/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<blockquote>
<pre>Select an editor. To change later, run 'select-editor'.<br />1. /bin/nano &lt;---- easiest<br />2. /usr/bin/vim.basic<br />3. /usr/bin/mcedit<br />4. /usr/bin/vim.tiny<br />5. /bin/ed<br /><br />Choose 1-5 [1]: 1</pre>
</blockquote>
<p style="text-align: justify;">In crontab, add this at the end and ave that change with CTRL-o, Enter, CTRL-x:</p>
<blockquote>
<pre>0 1 * * * /home/openhabian/maintenance.sh</pre>
</blockquote>
<p style="text-align: justify;">Notice: if you want to mount the shared drives at boot, which usually fails as mentioned previously as the network is not yet available when fstab is first called, you can add this in the crontab too:</p>
<blockquote>
<pre>@reboot sleep 300; mount -a</pre>
</blockquote>
<p style="text-align: justify;">You can now try the script with:</p>
<blockquote>
<pre>sh /home/openhabian/maintenance.sh</pre>
</blockquote>
<p style="text-align: justify;">If it works, it should also work when triggered by the cron job.</p>
<p style="text-align: justify;"></div>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfc7329"  tabindex="0" title="Backup as openhabian"    >Backup as openhabian</span><span id='swap-id69b276dfc7329'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfc7329" class="collapseomatic_content ">
<p style="text-align: justify;">To run scripts as root is usually not recommended. But the backup script of openhab may only be run as root&#8230; We could run it with the account &#8216;openhab&#8217;, but the backup files will belongs to the user &#8216;openhabian&#8217;, making the cleanup tricky. I you really don&#8217;t want to run and schedule my script as root, then the best option is to run it with the account &#8220;openhabian&#8221;:</p>
<p style="text-align: justify;">Still being is root mode (sudo -i), create the log file manually and grant access for all users:</p>
<blockquote>
<pre>touch /var/log/maintenance.log<br />chmod a+rw /var/log/maintenance.log</pre>
</blockquote>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Authorize the user &#8220;openhabian&#8221; to execute the backup script &#8220;/usr/share/openhab2/runtime/bin/backup&#8221;. To do this, you have to create a file in the /etc/sudoers.d folder. All files in that folder are used by the &#8220;sudo&#8221; command to authorize configured users to execute specified commands as root, with or without password. You MUST ABSOLUTELY edit that file with the command &#8220;<strong>visudo</strong>&#8220;. This one will check that your changes are valid. If you edit that file with another editor and it contains an error, you won&#8217;t be able to use the &#8220;sudo&#8221; command anymore (you will have to plug the SD card into a USB adapter on another raspberry to fix the issue or to simply delete the invalid file. USB device are automatically mounted under /media/usbxxx if you installed the package usbmount).</p>
<blockquote>
<pre>visudo /etc/sudoers.d/openhab</pre>
</blockquote>
<p style="text-align: justify;">In that file, add the line here under and save your change with CTRL-o, enter, CTRL-x</p>
<blockquote>
<pre># Allow openhabian user to execute the backup script<br />openhabian ALL=(ALL) NOPASSWD: /bin/mount, /usr/share/openhab2/runtime/bin/backup</pre>
</blockquote>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Unschedule the script from root&#8217;s crontab (remove the line added with crontab -e)</p>
<blockquote>
<pre>crontab -e</pre>
<pre><del>0 1 * * * /home/openhabian/maintenance.sh</del></pre>
</blockquote>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">And schedule it now within openhab&#8217;s crontab (has to be done as &#8216;openhabian&#8217;  user)</p>
<blockquote>
<pre>sudo -u openhabian crontab -e</pre>
</blockquote>
<p style="text-align: justify;">And add</p>
<blockquote>
<pre>0 1 * * * /home/openhabian/maintenance.sh</pre>
</blockquote>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Et voilà.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">PS.: If you experience issues when mounting the remote shared folder, try to mount it interactively (using an administration account of  your Synology or an account having a password without symbols such as %, # or !)</p>
<blockquote>
<pre>apt install smbclient <br />smbclient //&lt;remote ip&gt;/&lt;shared folder&gt; -U &lt;user account&gt;</pre>
</blockquote>
<p style="text-align: justify;">You can also check the latest messages from the kernel</p>
<blockquote>
<pre>dmesg | tail -n10</pre>
</blockquote>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4883" class="pvc_stats total_only  " data-element-id="4883" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/easily-backup-openhab-into-a-shared-folder/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Install Java 8 SDK and OpenHab 2 on Raspberry Pi Desktop for RPI 4</title>
		<link>https://www.BeatificaBytes.be/install-java-8-sdk-and-openhab-2-on-raspberry-pi-desktop-for-rpi-4/</link>
					<comments>https://www.BeatificaBytes.be/install-java-8-sdk-and-openhab-2-on-raspberry-pi-desktop-for-rpi-4/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Wed, 15 Jul 2020 21:59:46 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4811</guid>

					<description><![CDATA[I wanted to install OpenHab 2 on my RPI 4 which is running the latest Raspberry Pi Desktop. But I was missing Java 8 which [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">I wanted to install OpenHab 2 on my RPI 4 which is running the latest Raspberry Pi Desktop. But I was missing Java 8 which is a prerequisite and unfortunately not available anymore as a stable version, for Debian 10, due to a security issue.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfcda34"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b276dfcda34'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfcda34" class="collapseomatic_content ">
<p style="text-align: justify;">First, here is the version of Raspberry Pi Desktop I have:</p>
<pre style="padding-left: 40px;"><strong>$ cat /etc/os-release</strong><br />PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"<br />NAME="Raspbian GNU/Linux"<br />VERSION_ID="10"<br />VERSION="10 (buster)"<br />VERSION_CODENAME=buster<br />ID=raspbian<br />ID_LIKE=debian<br />HOME_URL="http://www.raspbian.org/"<br />SUPPORT_URL="http://www.raspbian.org/RaspbianForums"<br />BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"</pre>
<p style="text-align: justify;">Trying to install Java 8 SDK was resulting in errors like:</p>
<pre style="padding-left: 40px;"><strong>$ sudo apt-get install openjdk-8-jdk</strong><br />Reading package lists... Done<br />Building dependency tree<br />Reading state information... Done<br />E: Unable to locate package </pre>
<p style="text-align: justify;">Or like:</p>
<pre style="padding-left: 40px;">Reading package lists... Done<br />Building dependency tree<br />Reading state information... Done<br />Package openjdk-8-jdk is not available, but is referred to by another package.<br />This may mean that the package is missing, has been obsoleted, or<br />is only available from another source<br />However the following packages replace it:<br />openjdk-8-jdk-headless<br />E: Package 'openjdk-8-jdk' has no installation candidate</pre>
<p style="text-align: justify;">My Package sources were:</p>
<pre style="padding-left: 40px;">deb http://ftp.debian.org/debian/ buster main contrib non-free<br />deb http://security.debian.org/ buster/updates main contrib non-free<br />deb http://ftp.debian.org/debian/ buster-updates main contrib non-free</pre>
<p style="text-align: justify;">The solution was to add a <a href="https://www.debian.org/releases/index.en.html" target="_blank" rel="noopener noreferrer">new source</a> with the &#8216;unstable&#8217; arm-hf packages in /etc/apt/sources.list.d/raspi.list (&#8216;sid&#8217; is the codename for unstable):</p>
<pre style="padding-left: 40px;">$ <strong>echo 'deb http://ftp.debian.org/debian sid main' | sudo tee -a /etc/apt/sources.list.d/</strong></pre>
<p style="text-align: justify;">Next, do:</p>
<pre style="padding-left: 40px;">$ sudo apt-get update<br />$ sudo apt install gcc-8-base<br />$ sudo apt-get install openjdk-8-jdk</pre>
<p style="text-align: justify;">NB.: without installing gcc-8-base, you would get an error like this :</p>
<pre style="padding-left: 40px;">Reading package lists... Done<br />Building dependency tree<br />Reading state information... Done<br />Some packages could not be installed. This may mean that you have<br />requested an impossible situation or if you are using the unstable<br />distribution that some required packages have not yet been created<br />or been moved out of Incoming.<br />The following information may help to resolve the situation:<br /><br />The following packages have unmet dependencies:<br />libc6-dev : Breaks: libgcc-8-dev (&lt; 8.4.0-2~) but 8.3.0-6+rpi1 is to be installed<br />E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.</pre>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Now, you can install OpenHab 2:</p>
<pre style="padding-left: 40px;">$ wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -<br />$ sudo apt-get install apt-transport-https<br />$ echo 'deb https://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list<br />$ sudo apt-get update</pre>
<p style="padding-left: 40px; text-align: justify;">If you get an error like this one:</p>
<pre style="padding-left: 80px;">E: The repository 'https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable Release' is not signed.<br />N: Updating from such a repository can't be done securely, and is therefore disabled by default.<br />N: See apt-secure(8) manpage for repository creation and user configuration details.</pre>
<p style="padding-left: 40px; text-align: justify;">Then do:</p>
<pre style="padding-left: 80px;">$ echo 'deb [trusted=yes] https://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list</pre>
<p style="text-align: justify;">Finally, do:</p>
<pre style="padding-left: 40px;">$ sudo apt-get install openhab2<br />$ sudo apt-get install openhab2-addons<br />$ sudo systemctl daemon-reload<br />$ sudo systemctl enable openhab2.service<br />$ sudo adduser openhab dialout<br />$ sudo adduser openhab tty<br /><br /></pre>
<p>Edit /etc/default/openhab2 to add access for Java to the serial ports (ex.:for Zwave keys)</p>
<pre style="padding-left: 40px;">$ nano /etc/default/openhab2 <br /><br />EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"</pre>
<p style="text-align: justify;">It should output:</p>
<pre style="padding-left: 40px;">openhab2.service - openHAB 2 - empowering the smart home<br />Loaded: loaded (/usr/lib/systemd/system/openhab2.service; disabled; vendor preset: enabled)<br />Active: active (running) since Wed 2020-07-15 21:57:07 BST; 28min ago<br />Docs: https://www.openhab.org/docs/<br />https://community.openhab.org<br />Main PID: 26101 (java)<br />Tasks: 101 (limit: 4915)<br />Memory: 212.3M<br />CGroup: /system.slice/openhab2.service<br />└─26101 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/li<br /><br />Jul 15 21:57:07 Helios systemd[1]: Started openHAB 2 - empowering the smart home.</pre>
<p> </p>
<p>As far as I am concerned, I share via smb the various folders</p>
<p>Edit /etc/samba/smb.conf</p>
<p>$ sudo nano /etc/samba/smb.conf</p>
<pre style="padding-left: 40px;">[openHAB2-userdata]comment=openHAB2 userdata<br />path=/var/lib/openhab2<br />browseable=Yes<br />writeable=Yes<br />only guest=no<br />public=no<br />create mask=0777<br />directory mask=0777<br /><br />[openHAB2-conf]comment=openHAB2 site configuration<br />path=/etc/openhab2<br />browseable=Yes<br />writeable=Yes<br />only guest=no<br />public=no<br />create mask=0777<br />directory mask=0777<br /><br />[openHAB2-logs]comment=openHAB2 logs<br />path=/var/log/openhab2<br />browseable=Yes<br />writeable=Yes<br />only guest=no<br />public=no<br />create mask=0777<br />directory mask=0777<br /><br />[openHAB2-backups]comment=oepnHAB2 backups<br />path=/var/lib/openhab2/backups<br />browseable=Yes<br />writeable=Yes<br />only guest=no<br />public=no<br />create mask=0777<br />directory mask=0777</pre>
<p>Restart the Samba service:</p>
<pre style="padding-left: 40px;">$ sudo systemctl restart smbd.service</pre>
<p> </p>
<p>Start openHab with:</p>
<pre style="padding-left: 40px;">$ sudo systemctl start openhab2.service<br />$ sudo systemctl status openhab2.service<br /><br /></pre>
<p style="text-align: justify;">It can take 15&#8242; to be initialized, but soon you should be able to access openHab on your RPI on port 8080!</p>
<p> </p>
<p>Do a backup with:</p>
<pre style="padding-left: 40px;">$ sudo ./usr/share/openhab2/runtime/bin/backup</pre>
<p>Restore a backup with:</p>
<pre style="padding-left: 40px;">$ sudo systemctl stop openhab2.service<br />$ sudo ./usr/share/openhab2/runtime/bin/restore /var/lib/openhab2/backups/openhab2-backup-....<br />$ sudo systemctl start openhab2.service</pre>
<p style="text-align: justify;">It will take long minutes to restart!</p>
<p> </p>
<p>More details about installing openHAb on Linux <a href="https://www.openhab.org/docs/installation/linux.html" target="_blank" rel="noopener noreferrer">on the official page</a>.</p>
<p style="text-align: justify;">Et voilà!</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4811" class="pvc_stats total_only  " data-element-id="4811" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/install-java-8-sdk-and-openhab-2-on-raspberry-pi-desktop-for-rpi-4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Use a Z-Wave Controller USB Key with openHAB in Docker on a RPI 4</title>
		<link>https://www.BeatificaBytes.be/use-a-z-wave-controller-usb-key-with-openhab-in-docker-on-a-rpi-4/</link>
					<comments>https://www.BeatificaBytes.be/use-a-z-wave-controller-usb-key-with-openhab-in-docker-on-a-rpi-4/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Sun, 28 Jun 2020 16:22:09 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">http://www.beatificabytes.be/?p=4803</guid>

					<description><![CDATA[It took me quite some hours to be able to use my Aeotec Z-Stick Gen5 (ZW090) key within my Docker image of openHAB, running on [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">It took me quite some hours to be able to use my Aeotec Z-Stick Gen5 (ZW090) key within my Docker image of openHAB, running on a Raspberry Pi 4 (with a Raspberry Pi OS). Here are all the tips I used.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfcf6be"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b276dfcf6be'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfcf6be" class="collapseomatic_content ">
<p style="text-align: justify;">First, before plugging the controller  in your RPI, configure it to see the Serial Ports. Connect onto your RPI within a SSH Console (ex.: via Putty)  and type the command:</p>
<p style="padding-left: 40px; text-align: justify;">sudo raspi-config</p>
<p style="padding-left: 40px; text-align: justify;">Use &#8220;5 interfacing Options&#8221; &gt; &#8220;P6 Serial&#8221; &gt; &#8220;Yes&#8221; &gt; &#8220;Ok&#8221;</p>
<p style="padding-left: 40px; text-align: justify;">And now reboot.</p>
<p style="text-align: justify;">Next, back into a SSH conscole, check what USB devices already exists with the command:</p>
<p style="padding-left: 40px; text-align: justify;">lsusb</p>
<pre style="padding-left: 40px;">Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub<br />Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</pre>
<p style="text-align: justify;">And flush the kernel and boot logs:</p>
<p style="padding-left: 40px; text-align: justify;">sudo dmesg -c &gt;&gt; ~/dmesg-`date +%d%m%Y`.log</p>
<p style="text-align: justify;">Then, plug your Z-Wave Controller USB Key in a USB Port and check that it&#8217;s detected and mounted properly:</p>
<p style="padding-left: 40px; text-align: justify;">lsusb</p>
<pre style="padding-left: 40px;">Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br />Bus 001 Device 009: ID 0658:0200 Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB<br />Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub<br />Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</pre>
<p style="padding-left: 40px; text-align: justify;">dmesg</p>
<pre style="padding-left: 40px;">[ 3124.779069] usb 1-1.4: new full-speed USB device number 9 using xhci_hcd<br />[ 3124.919928] usb 1-1.4: New USB device found, idVendor=0658, idProduct=0200, bcdDevice= 0.00<br />[ 3124.919942] usb 1-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=1<br />[ 3124.919953] usb 1-1.4: SerialNumber: 32303136-3131-3033-3030-303031383932<br />[ 3124.926704] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device</pre>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">&#8220;lsusb&#8221; should show you a new device. Ex.: Aeotec Z-Stick Gen5 (ZW090) &#8211; UZB.</p>
<p style="text-align: justify;">And &#8220;dmesg&#8221; must should you the mount point: cdc_acm 1-1.4:1.0: <span style="color: #ff0000;">ttyACM0</span>: USB ACM device.</p>
<p style="text-align: justify;">If you don&#8217;t see the mount point, then you possibly have a device not supported by the RPI 4. It seems that it is the case with the old Aeotec &#8220;Z-Stick Gen5&#8221;. &#8220;New Z-Stick Gen5&#8221; and &#8220;Z-Stick Gen5+&#8221; should however be compatible. But <a href="https://github.com/raspberrypi/linux/issues/3027" target="_blank" rel="noopener noreferrer">there is a trick</a>: plug your key on the RPI 4 via a USB HUB (2.0 or 3.0).</p>
<p style="text-align: justify;">I presume that the Docker Image is already up and running. If not, <a href="https://community.openhab.org/t/running-openhab-2-in-docker/14267" target="_blank" rel="noopener noreferrer">install it</a>.</p>
<p style="padding-left: 40px; text-align: justify;">sudo useradd -r -s /sbin/nologin openhab<br />usermod -a -G openhab pi<br />mkdir /opt/openhab<br />mkdir /opt/openhab/conf<br />mkdir /opt/openhab/userdata<br />mkdir /opt/openhab/addons<br />chown -R openhab:openhab /opt/openhab</p>
<p style="text-align: justify;">Check the id of the user openhab with:</p>
<p style="padding-left: 40px; text-align: justify;">id openhab</p>
<pre style="padding-left: 40px;">uid=999(openhab) gid=994(openhab) groups=994(openhab)</pre>
<p style="text-align: justify;">Grant access on the Serial Port for the user &#8216;openhab&#8217;:</p>
<p style="padding-left: 40px; text-align: justify;">sudo chmod 777 /dev/<span style="color: #ff0000;">ttyACM0</span><br />sudo chown openhab /dev/<span style="color: #ff0000;">ttyACM0</span></p>
<p style="text-align: justify;">And use the uid and gid found above in the following command, setting the ttyA* found previously and specifying the version to be used:</p>
<p style="padding-left: 40px; text-align: justify;">docker run &#8211;name openhab &#8211;net=host &#8211;device=/dev/<span style="color: #ff0000;">ttyACM0</span> -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v /opt/openhab/conf:/openhab/conf -v /opt/openhab/userdata:/openhab/userdata -v /opt/openhab/addons:/openhab/addons -d -e USER_ID=&lt;<span style="color: #ff0000;">uid</span>&gt; -e GROUP_ID=&lt;<span style="color: #ff0000;">gid</span>&gt; &#8211;restart=always openhab/openhab:<span style="color: #ff0000;">latest</span></p>
<p style="padding-left: 40px; text-align: justify;"> </p>
<p style="text-align: justify;">Now, using Portainer (because it&#8217;s easy), open a console within openhab&#8230; Portainer is not yet installed ? Do it with:</p>
<p style="padding-left: 40px; text-align: justify;">docker run -d -p 9000:9000 -p 8000:8000 &#8211;name portainer1 &#8211;restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer:/data portainer/portainer:latest</p>
<p style="text-align: justify;">Go to the page http://&lt;Your RPI IP&gt;:9000, open the Containers and click on the &#8220;Exec Console&#8221; icon of &#8216;openhab&#8217; container:</p>
<p style="text-align: justify;" data-wp-editing="1"><a href="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-8.png"><img loading="lazy" decoding="async" class="wp-image-4805  aligncenter" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-8.png" alt="" width="328" height="133" /></a></p>
<p style="text-align: justify;">Grant the same accesses inside the image than on the RPI:</p>
<p style="padding-left: 40px; text-align: justify;">sudo chmod 777 /dev/<span style="color: #ff0000;">ttyACM0</span><br />sudo chown openhab /dev/<span style="color: #ff0000;">ttyACM0</span></p>
<p style="padding-left: 40px; text-align: justify;">chown -R openhab:openhab /opt/openhab</p>
<p style="text-align: justify;">Now restart the &#8216;openhab&#8217; container (with the icon Restart <img src="https://s.w.org/images/core/emoji/15.1.0/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ). It will take some minutes to be available. But once you can get into it, go to the Things and configure the Controller to use the Serial Port <span style="color: #ff0000;">ttyACM0</span>:</p>
<p style="text-align: justify;"><a href="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-9.png"><img loading="lazy" decoding="async" class="wp-image-4806  aligncenter" src="http://www.beatificabytes.be/wp-content/uploads/2020/06/Pasted-9.png" alt="" width="335" height="198" /></a></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Et voilà</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4803" class="pvc_stats total_only  " data-element-id="4803" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/use-a-z-wave-controller-usb-key-with-openhab-in-docker-on-a-rpi-4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>OpenHab: ServiceLocatorImpl has been shut down</title>
		<link>https://www.BeatificaBytes.be/openhab-servicelocatorimpl-has-been-shut-down/</link>
					<comments>https://www.BeatificaBytes.be/openhab-servicelocatorimpl-has-been-shut-down/#respond</comments>
		
		<dc:creator><![CDATA[vletroye]]></dc:creator>
		<pubDate>Tue, 31 Dec 2019 14:18:22 +0000</pubDate>
				<category><![CDATA[SmartHome]]></category>
		<category><![CDATA[OpenHab]]></category>
		<guid isPermaLink="false">https://www.beatificabytes.be/?p=4631</guid>

					<description><![CDATA[I found a weird error by accident in the openhab.log of my Synology. It was due to the &#8220;Localisation&#8221; not configured properly in openHab&#8217;s System.]]></description>
										<content:encoded><![CDATA[
<p style="text-align: justify;">I found a weird error by accident in the openhab.log of my Synology. It was due to the &#8220;Localisation&#8221; not configured properly in openHab&#8217;s System.</p>
<p style="text-align: justify;"><span class="collapseomatic " id="id69b276dfd48a5"  tabindex="0" title="Click to Read More"    >Click to Read More</span><span id='swap-id69b276dfd48a5'  class='colomat-swap' style='display:none;'>Click to Close</span><div id="target-id69b276dfd48a5" class="collapseomatic_content ">
<p style="text-align: justify;">I found that error after stopping and starting manually openHab from a SSH console opened on my Synology to solve another issue.</p>
<p style="text-align: justify;">To stop openHab installed on a Synology as explained <a href="https://www.beatificabytes.be/install-openhab-2-on-synology/" target="_blank" rel="noopener noreferrer">here</a>, via a SSH console run as root (as explained <a href="https://www.beatificabytes.be/launch-a-ssh-console-onto-synology-with-putty/" target="_blank" rel="noopener noreferrer">here</a>), execute:</p>
<ul style="text-align: justify;">
<li>cd /var/packages/openHAB/target</li>
<li>./runtime/bin/stop</li>
</ul>
<p style="text-align: justify;">To restart openHab later execute:</p>
<ul style="text-align: justify;">
<li>./runtime/bin/start</li>
</ul>
<p style="text-align: justify;">NB.: if you execute this command soon after the stop, it won&#8217;t work. You can simply re-execute the command a second time.</p>
<p style="text-align: justify;">Here are more details about the error that I found in the log (located into \\&lt;YourNas&gt;\SmartHome\openHAB\userdata\logs\openhab.log)</p>
<p style="text-align: justify;"><code>javax.servlet.ServletException: javax.servlet.ServletException: A MultiException has 1 exceptions. They are:</code><br /><code>1. java.lang.IllegalStateException: ServiceLocatorImpl(__HK2_Generated_2,3,718060201) has been shut down</code></p>
<p style="text-align: justify;"><code>at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:88) ~[bundleFile:?]</code><br /><code>at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.server.Server.handle(Server.java:494) ~[bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]</code><br /><code>at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]</code><br /><code>at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]</code></p>
<p style="text-align: justify;">This error appears because the location is not set in OpenHAB and your browser probably didn&#8217;t have the permission to pass its own location to openhab.</p>
<p style="text-align: justify;">The issue can be resolved by manually via the PaperUI &gt; Configuration &gt; System &gt; Regional Settings.  There, define your language, your country/region, your Time Zone and your location (with a latitude and longitude &#8211; or &#8211; by moving the openHab pin onto your location).</p>
<p style="text-align: justify;"></div>
<div class="pvc_clear"></div><p id="pvc_stats_4631" class="pvc_stats total_only  " data-element-id="4631" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" version="1.0" viewBox="0 0 502 315" preserveAspectRatio="xMidYMid meet"><g transform="translate(0,332) scale(0.1,-0.1)" fill="" stroke="none"><path d="M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z"/><path d="M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z"/><path d="M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z"/><path d="M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z"/><path d="M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z"/><path d="M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z"/><path d="M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z"/><path d="M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z"/><path d="M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z"/></g></svg></i> <img loading="lazy" decoding="async" width="16" height="16" alt="Loading" src="https://www.BeatificaBytes.be/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p><div class="pvc_clear"></div>]]></content:encoded>
					
					<wfw:commentRss>https://www.BeatificaBytes.be/openhab-servicelocatorimpl-has-been-shut-down/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
