<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Homeautomation on dotnet.work</title>
        <link>https://dotnet.work/tags/homeautomation/</link>
        <description>Recent content in Homeautomation on dotnet.work</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-US</language>
        <managingEditor>dotnet@oles.cloud (Ole Albers)</managingEditor>
        <webMaster>dotnet@oles.cloud (Ole Albers)</webMaster>
        <copyright>Ole Albers</copyright>
        <lastBuildDate>Wed, 04 Feb 2026 18:17:00 +0100</lastBuildDate><atom:link href="https://dotnet.work/tags/homeautomation/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>Use Claude AI in Home Assistant Studio</title>
            <link>https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/</link>
            <pubDate>Wed, 04 Feb 2026 18:17:00 +0100</pubDate><author>dotnet@oles.cloud (Ole Albers)</author>
            <guid>https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/</guid>
            <description>&lt;img src=&#34;https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_37_55-Home-Assistant-Mozilla-Firefox_hu_9daa82fb4ffbfdf5.png&#34; alt=&#34;Featured image of post Use Claude AI in Home Assistant Studio&#34; /&gt;&lt;p&gt;Sometimes you have to configure stuff in Home Assistant the &amp;ldquo;painful&amp;rdquo; way: Working with Yaml-Files instead of using the UI. Therefore Studio Code Server is the first choice for most of us. But Yaml isn&amp;rsquo;t fun. Yaml in hass.io especially isn&amp;rsquo;t fun.&lt;/p&gt;&#xA;&lt;p&gt;But there is ai for the rescue. AI isn&amp;rsquo;t always the solution, but working with ugly configuration formats is exactly where it is good at. So let&amp;rsquo;s add claude to the Studio Code Server&lt;/p&gt;&#xA;&lt;h2 id=&#34;studio-code-server&#34;&gt;&lt;a href=&#34;#studio-code-server&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Studio Code Server&#xA;&lt;/h2&gt;&lt;p&gt;I assume you already have installed the Studio Code Server. If you haven&amp;rsquo;t: It is a simple Add-On. Just follow the official instructions:&#xA;&lt;a class=&#34;link&#34; href=&#34;https://github.com/hassio-addons/addon-vscode/blob/main/vscode/DOCS.md&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://github.com/hassio-addons/addon-vscode/blob/main/vscode/DOCS.md&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Studio Code Server will then be installed as a docker container. (Don&amp;rsquo;t worry. No need to know anything about docker. This works in the background)&lt;/p&gt;&#xA;&lt;h2 id=&#34;preparing&#34;&gt;&lt;a href=&#34;#preparing&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Preparing&#xA;&lt;/h2&gt;&lt;p&gt;Claude needs NodeJs which isn&amp;rsquo;t in the studio code server docker. But don&amp;rsquo;t worry, this is easy to solve. You &lt;em&gt;could&lt;/em&gt; connect to the docker and install the required packages using app-get. But while this works this has two disadvantages. First it is a bit more complicated if you are not at home with Linux Systems and most important: Any update of the Addon would kill NodeJs and you would have to do this all over again.&lt;/p&gt;&#xA;&lt;p&gt;Thankfully the Add-On devs thought of an easy way to do that for you. Just go to &lt;em&gt;Settings - Add-Ons - Studio Code Server&lt;/em&gt;. There go to &lt;em&gt;Configuration&lt;/em&gt; and in the &amp;ldquo;packages&amp;rdquo; enter &amp;ldquo;npm&amp;rdquo; and then &amp;ldquo;nodejs&amp;rdquo;. Do not enter both at the time. Each one of them by enter. After that there should be two bubbles on top:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Setup Page&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;339px&#34; data-flex-grow=&#34;141&#34; data-title-escaped=&#34;Setup Page&#34; height=&#34;298&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_37_55-Home-Assistant-Mozilla-Firefox_hu_9daa82fb4ffbfdf5.png&#34; title=&#34;Setup Page&#34; width=&#34;421&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you prefer editing in yaml, here is your content:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;packages:&#xA;  - nodejs&#xA;  - npm&#xA;init_commands: []&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Save and restart the addon. Don&amp;rsquo;t be alarmed if this takes a LONG time. There will have big packages to be downloaded and installed into that container. This will take minutes even on a fast machine and especially if using a Raspberry Pi.&lt;/p&gt;&#xA;&lt;h2 id=&#34;adding-claude&#34;&gt;&lt;a href=&#34;#adding-claude&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Adding Claude&#xA;&lt;/h2&gt;&lt;p&gt;&lt;img alt=&#34;Install Addon&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;880px&#34; data-flex-grow=&#34;366&#34; data-title-escaped=&#34;Install Addon&#34; height=&#34;260&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_42_17-Studio-Code-Server-Home-Assistant-Mozilla-Firefox_hu_8fee66ef6366d762.png&#34; srcset=&#34;https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_42_17-Studio-Code-Server-Home-Assistant-Mozilla-Firefox_hu_9257303b5683b41e.png 800w, https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_42_17-Studio-Code-Server-Home-Assistant-Mozilla-Firefox_hu_8fee66ef6366d762.png 954w&#34; title=&#34;Install Addon&#34; width=&#34;954&#34;&gt;&#xA;Now you can switch to the code server. Select &lt;em&gt;Extensions&lt;/em&gt; on the left side, enter &amp;ldquo;Claude&amp;rdquo; into the search and install &amp;ldquo;Claude Code for VS Code&amp;rdquo;. After that you should have that typical &amp;ldquo;Claude Star&amp;rdquo; on the top right corner. You will be greeted with the authentication method. Select the one that matches your account. (Most likely Claude.ai Subscription)&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Account selection from Claude&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;152px&#34; data-flex-grow=&#34;63&#34; data-title-escaped=&#34;Account Selection from Claude&#34; height=&#34;878&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_46_17-Studio-Code-Server-Home-Assistant-Mozilla-Firefox_hu_71d79e2b7d9c581c.png&#34; title=&#34;Account Selection from Claude&#34; width=&#34;559&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If after using the Login clicking &amp;ldquo;Open&amp;rdquo; does not work because you get redirected to a local url use the url instead that is shown in the textbox:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Continue in Browser &#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;353px&#34; data-flex-grow=&#34;147&#34; data-title-escaped=&#34;Continue in Browser&#34; height=&#34;365&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_52_54-Studio-Code-Server-Home-Assistant-Mozilla-Firefox_hu_fe7c633de7eebace.png&#34; title=&#34;Continue in Browser&#34; width=&#34;538&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Just copy paste that url manually and paste the returning code into Studio Code.&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-claude&#34;&gt;&lt;a href=&#34;#using-claude&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Using Claude&#xA;&lt;/h2&gt;&lt;p&gt;Now you can open Claude using the star and let him do the work&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Screenshot of Claude analyzing the configuration.yaml&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;281px&#34; data-flex-grow=&#34;117&#34; data-title-escaped=&#34;Claude analyzing the configuration.yaml&#34; height=&#34;839&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_56_46-Studio-Code-Server-Home-Assistant-Mozilla-Firefox_hu_5fc2475700b80717.png&#34; srcset=&#34;https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_56_46-Studio-Code-Server-Home-Assistant-Mozilla-Firefox_hu_fc58830bc1938829.png 800w, https://dotnet.work/blog/use-claude-ai-in-home-assistant-studio/2026-02-04-10_56_46-Studio-Code-Server-Home-Assistant-Mozilla-Firefox_hu_5fc2475700b80717.png 983w&#34; title=&#34;Claude analyzing the configuration.yaml&#34; width=&#34;983&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;That is it. Now you can use claude in Home Assistant Config Files&lt;/p&gt;</description>
        </item><item>
            <title>Setting single Panels on NanoLeaf using Home Assistant</title>
            <link>https://dotnet.work/blog/nanoleaf/</link>
            <pubDate>Sat, 20 Jan 2024 12:00:00 +0100</pubDate><author>dotnet@oles.cloud (Ole Albers)</author>
            <guid>https://dotnet.work/blog/nanoleaf/</guid>
            <description>&lt;p&gt;I went deep into Home Assistant automation currently and - as everybody knows who ever went this road - more ideas came up. So my newest idea was to use the Hex-Panels from Nanoleaf to display some information. For example if the washing machine is ready, I have an appointment, the Smartphone Battery gets low and so on.&lt;/p&gt;&#xA;&lt;!-- image missing: https://github.com/Guacam-Ole/dotnetwork/assets/4692497/eaa1c25f-8b92-420c-b71d-0eee8d6758ab (NanoLeaf with different Colors on the wall) --&gt;&#xA;&lt;p&gt;This entry describes how I managed to do that.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;I collected all this information from different sources. THe most important was from sygys who posted the Home Assistant configuration: &lt;a class=&#34;link&#34; href=&#34;https://community.home-assistant.io/t/nanoleaf-per-tile-light-control-build-in-ha/442720&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://community.home-assistant.io/t/nanoleaf-per-tile-light-control-build-in-ha/442720&lt;/a&gt;&#xA;By the API documentation alone I would not have been able to achieve that.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-hardware&#34;&gt;&lt;a href=&#34;#the-hardware&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;The hardware&#xA;&lt;/h2&gt;&lt;p&gt;I mostly used Nanoleaf Elements in the wooden design. These cannot display any colors but just lighten up. I like the descent appearance of those. Do not want to create an all-rgb-gaming-experience in my living room. I also added three dark black hexagon tiles to it. Those where meant to display the status if needed.&#xA;BTW: The nanoleaf app does not offer any color scenes in this setup because the wooden panels are the &amp;ldquo;main&amp;rdquo; panels. But that does not matter for this scenario.&lt;/p&gt;&#xA;&lt;h2 id=&#34;integrating-in-home-assistant&#34;&gt;&lt;a href=&#34;#integrating-in-home-assistant&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Integrating in Home Assistant&#xA;&lt;/h2&gt;&lt;p&gt;For the main features I used the standard integration for Home Assistant. That allows detecing swipe controls (another advantage of the wooden panels because you don&amp;rsquo;t see fingerprints there) and start mostly anything what the app allows. Which does NOT include adressing single panels&lt;/p&gt;&#xA;&lt;h2 id=&#34;using-the-api&#34;&gt;&lt;a href=&#34;#using-the-api&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Using the API&#xA;&lt;/h2&gt;&lt;p&gt;Currently this can only be done by a REST-Api. Initially you need any tool that can send POST - Commands. You can use Curl if you like to work on the shell, or UI-Tools like Postman.&lt;/p&gt;&#xA;&lt;h3 id=&#34;retrieving-a-secret&#34;&gt;&lt;a href=&#34;#retrieving-a-secret&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Retrieving a secret&#xA;&lt;/h3&gt;&lt;p&gt;The first manual step is to obtain a secret. This is done exactly like when installing the Home Assistant integration. You just pair the Panels by pressing the power button for a few seconds until the LEDs start blnking/moving. Don&amp;rsquo;t worry, this will NOT remove any previous pairings.&#xA;Now while the pairing is active call the following URL:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;POST http://192.168.178.65:16021/api/v1/new&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;(replace the IP by the Nanoleaf IP. Should be visible in your Router for example)&lt;/p&gt;&#xA;&lt;p&gt;This will return just a simple value which contains your secret token. This token will remain valid even if you unpower the Nanoleaf. Make sure you store this secret somewhere, you will need it.&lt;/p&gt;&#xA;&lt;h3 id=&#34;retrieve-the-configuration&#34;&gt;&lt;a href=&#34;#retrieve-the-configuration&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Retrieve the Configuration&#xA;&lt;/h3&gt;&lt;p&gt;Now it is time to test your secret and retrieve the configuration from your Nanoleaf panels. You even can do this in your browser, or still in Postman/Curl:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;http://192.168.178.65:16021/api/v1/thisisthemagicsecretreturnedbefore/&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The most interesting part is the layout/positionData-Part in that response:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;      &amp;#34;layout&amp;#34;: {&#xA;            &amp;#34;numPanels&amp;#34;: 46,&#xA;            &amp;#34;sideLength&amp;#34;: 0,&#xA;            &amp;#34;positionData&amp;#34;: [&#xA;                {&#xA;                    &amp;#34;panelId&amp;#34;: 8172,&#xA;                    &amp;#34;x&amp;#34;: 301,&#xA;                    &amp;#34;y&amp;#34;: 747,&#xA;                    &amp;#34;o&amp;#34;: 360,&#xA;                    &amp;#34;shapeType&amp;#34;: 15&#xA;                },&#xA;                {&#xA;                    &amp;#34;panelId&amp;#34;: 36653,&#xA;                    &amp;#34;x&amp;#34;: 276,&#xA;                    &amp;#34;y&amp;#34;: 703,&#xA;                    &amp;#34;o&amp;#34;: 300,&#xA;                    &amp;#34;shapeType&amp;#34;: 15&#xA;                },&#xA;[..]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I honestly was a bit surprised, because I do NOT have 46 panels. Far from it. The simple truth is: THe wooden Panels have 6 LEDs. each of them has their own ID. So having 7 wooden panels that makes 42 Ids, additional 3 Ids for the three black panels and the control buttons is an additional panel (with id 0)&lt;/p&gt;&#xA;&lt;p&gt;If you do not need to adress all Panels but just a single one, a good hint is to just rotate one of the panels, make that call again and see which panel has a new orientation (&amp;ldquo;o&amp;rdquo; in the json)&lt;/p&gt;&#xA;&lt;p&gt;Now you have to write down all PanelIds. At least those you want to modifiy. Because I mostly want to use the black panels I split the following part in two, but you can also work with one (or even more).&lt;/p&gt;&#xA;&lt;h3 id=&#34;configure-rest-in-home-assistant&#34;&gt;&lt;a href=&#34;#configure-rest-in-home-assistant&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Configure Rest in Home Assistant&#xA;&lt;/h3&gt;&lt;p&gt;Go to your beloved Home Assistant Configuration (configuration.yaml) and add the following entries:&#xA;{% raw %}&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;rest_command:&#xA;  nanoleaf_wood:&#xA;    url: http://192.168.178.65:16021/api/v1/thisisthemagicsecretreturnedbefore/effects&#xA;    method: PUT&#xA;    payload: &amp;gt;&#xA;      { &amp;#34;write&amp;#34; : {&amp;#34;command&amp;#34;: &amp;#34;display&amp;#34;, &amp;#34;animType&amp;#34;: &amp;#34;static&amp;#34;, &amp;#34;animData&amp;#34;:&#xA;      {%- set all = [ 8172,36653,  32365,61100,6889,35368,57498,28763,33051,4570,9112,45913,61802,25003,37099,42,14434,43171,34741,29680,58161,4721,33456,45298,4960,8482,45539,16547,53346,9255,5361,58801,30064,33077,4596,57524,54769,50577,21840,42000,13521,1683] %}&#xA;      {%- set ns = namespace(panels=[panels | count | string]) %}&#xA;      {%- for panel in panels %}&#xA;      {%- set ns.panels = ns.panels + [ &amp;#39;{} 1 {} {} {} 0 20&amp;#39;.format(all[panel.number-1], panel.r, panel.g, panel.b) ] %}&#xA;      {%- endfor %}&#xA;      &amp;#34;{{ ns.panels | join(&amp;#39; &amp;#39;) }}&amp;#34;,&#xA;      &amp;#34;loop&amp;#34;: false, &amp;#34;palette&amp;#34;: [], &amp;#34;colorType&amp;#34;: &amp;#34;HSB&amp;#34;}&#xA;      }&#xA;    content_type: &amp;#34;application/json&amp;#34;&#xA;  nanoleaf_black:&#xA;    url: http://192.168.178.65:16021/api/v1/thisisthemagicsecretreturnedbefore/effects&#xA;    method: PUT&#xA;    payload: &amp;gt;&#xA;      { &amp;#34;write&amp;#34; : {&amp;#34;command&amp;#34;: &amp;#34;display&amp;#34;, &amp;#34;animType&amp;#34;: &amp;#34;static&amp;#34;, &amp;#34;animData&amp;#34;:&#xA;      {%- set all = [ 52732, 44680, 17782 ] %}      &#xA;      {%- set ns = namespace(panels=[panels | count | string]) %}&#xA;      {%- for panel in panels %}&#xA;      {%- set ns.panels = ns.panels + [ &amp;#39;{} 1 {} {} {} 0 20&amp;#39;.format(all[panel.number-1], panel.r, panel.g, panel.b) ] %}&#xA;      {%- endfor %}&#xA;      &amp;#34;{{ ns.panels | join(&amp;#39; &amp;#39;) }}&amp;#34;,&#xA;      &amp;#34;loop&amp;#34;: false, &amp;#34;palette&amp;#34;: [], &amp;#34;colorType&amp;#34;: &amp;#34;HSB&amp;#34;}&#xA;      }&#xA;    content_type: &amp;#34;application/json&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;{% endraw %}&#xA;Replace the IP with your Nenoleaf - IP and the secret with your secret (before &amp;ldquo;/effects&amp;rdquo;). It is up to you if you want one or more different calls. The numbers in the &amp;ldquo;set all&amp;rdquo; - part have to be replaced by the &lt;code&gt;panelId&lt;/code&gt;s you retrieved earlier.&lt;/p&gt;&#xA;&lt;p&gt;What comes next is of course testing your config and then restarting Home Assistant.&lt;/p&gt;&#xA;&lt;h3 id=&#34;automation-examples&#34;&gt;&lt;a href=&#34;#automation-examples&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Automation Examples&#xA;&lt;/h3&gt;&lt;p&gt;Now you can use this in any automation. The number is the number in the array, starting at 1(!) Example for the simple ones:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;alias: Nano_BlackTest&#xA;description: &amp;#34;&amp;#34;&#xA;trigger: []&#xA;condition: []&#xA;action:&#xA;  - service: rest_command.nanoleaf_black&#xA;    data:&#xA;      panels:&#xA;        - number: 1&#xA;          r: 255&#xA;          g: 0&#xA;          b: 0&#xA;        - number: 2&#xA;          r: 0&#xA;          g: 255&#xA;          b: 0&#xA;        - number: 3&#xA;          r: 0&#xA;          g: 0&#xA;          b: 255&#xA;mode: single&#xA;`and an example to light up the three wooden panels (remember. Each panel has 6 LEDs):`&#xA;alias: Nano_WoodTest&#xA;description: &amp;#34;&amp;#34;&#xA;trigger: []&#xA;condition: []&#xA;action:&#xA;  - service: rest_command.nanoleaf_wood&#xA;    data:&#xA;      panels:&#xA;        - number: 31&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 32&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 33&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 34&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 35&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 36&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 19&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 20&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 21&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 22&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 23&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 24&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 1&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 2&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 3&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 4&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 5&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;        - number: 6&#xA;          r: 255&#xA;          g: 255&#xA;          b: 255&#xA;mode: single&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That&amp;rsquo;s it. Have fun with your panels-&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>Tracking fitbit presence under Linux (Raspberry Pi 2)</title>
            <link>https://dotnet.work/blog/tracking-fitbit-presence-under-linux-raspberry-pi-2/</link>
            <pubDate>Sat, 27 Feb 2016 12:00:00 +0100</pubDate><author>dotnet@oles.cloud (Ole Albers)</author>
            <guid>https://dotnet.work/blog/tracking-fitbit-presence-under-linux-raspberry-pi-2/</guid>
            <description>&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/&#34; &gt;As I wrote before&lt;/a&gt; I track the presence of my smartphone using WiFi. Since Android Marshmellow this doesn&amp;rsquo;t work anymore, because when switching to idle mode, the WiFi is disconnected. The easiest way to get around this issue would be to use Bluetooth instead. And in fact: I already decided to go that way. But then my company gave me a nice present: A &amp;ldquo;Fitbit Charge HR&amp;rdquo;. While my company assured, that the HR is not for Human Resource and does not try to track if I am programming enough I decided to give this a try.&lt;/p&gt;&#xA;&lt;p&gt;Being a nerd I am not that much into that &amp;ldquo;fitness&amp;rdquo;-area. But I like the device as a small watch and the vibration alarm is nice too. I will surely sync this with my Appointments lateron. Getting some information about how many steps it takes to get the beer out of the cellar or the chips out of the kitchen is a nice benefit. Not really useful. But at least nerdy :)&lt;/p&gt;&#xA;&lt;p&gt;So I plan to wear this device for a while. So it should be a good idea to use it for tracking my presence. Maybe in combination with a phone-detection as a fall-back. First I tried to use a standard USB-dongle to detect it. But as this device works on Bluetooth Low Energy (BLE) it cannot be detected with normal Bluetooth-Dongles.  So&#xA;&lt;code&gt;hcitool scan&lt;/code&gt;&#xA;or even&#xA;&lt;code&gt;hcitool lescan&lt;/code&gt;&#xA;did not receive any results. Luckily the Fitbit ships with an USB-dongle. And even better, there is a package called &amp;ldquo;&lt;a class=&#34;link&#34; href=&#34;https://bitbucket.org/benallard/galileo&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;galileo&lt;/a&gt;&amp;rdquo; which purpose is to sync the fitbit. Installation is easy:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo apt-get install python-usb python-requests&#xA;sudo pip install galileo&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now install the dongle and restart the raspberry.&lt;/p&gt;&#xA;&lt;p&gt;If you enter the following command&#xA;&lt;code&gt;sudo galileo -v&lt;/code&gt;&#xA;you should see something like&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;2016-02-27 16:28:21,875:INFO: 1 trackers discovered&lt;/code&gt;&#xA;All you have to do now to check if the fitbit is in range automaticly is some bash-magic:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;if galileo -v | grep -q &amp;#39;1 trackers&amp;#39;; then&#xA;  // Do whatever you like if you found it&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
        </item><item>
            <title>Control your Harmony Hub with a Raspberry Pi (Linux)</title>
            <link>https://dotnet.work/blog/control-your-harmony-hub-with-a-raspberry-pi-linux/</link>
            <pubDate>Fri, 15 Jan 2016 12:00:00 +0100</pubDate><author>dotnet@oles.cloud (Ole Albers)</author>
            <guid>https://dotnet.work/blog/control-your-harmony-hub-with-a-raspberry-pi-linux/</guid>
            <description>&lt;img src=&#34;https://dotnet.work/blog/control-your-harmony-hub-with-a-raspberry-pi-linux/hh1_hu_8bb48e2bca1c02c6.png&#34; alt=&#34;Featured image of post Control your Harmony Hub with a Raspberry Pi (Linux)&#34; /&gt;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/&#34; &gt;So my surveillance cam now only records when I am not at home&lt;/a&gt;. But what if I forget to turn off the TV? That should happen automaticly, too! But fear not: There is a solution - at least if you own a harmony hub. With the help of the &amp;ldquo;HarmonyHubControl&amp;rdquo; - tool (written in c++) this is done quite easily.&lt;/p&gt;&#xA;&lt;p&gt;First of all you need to put the source onto the Raspberry. Don&amp;rsquo;t be afraid. No rocket science here. All needed tools should be already on your Linux distribution. The easiest way would be to clone the source via git:&#xA;&lt;code&gt;git clone git://git.code.sf.net/p/harmonyhubcontrol/code harmonyhubcontrol-code&lt;/code&gt;&#xA;If you prefer you may - of course - also use the long way and download those files in a zip file.&lt;/p&gt;&#xA;&lt;p&gt;Now after you have the source code on your Pi you have to compile it. Done with ease. Just a single&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;make&lt;/code&gt;&#xA;and you created the file &amp;ldquo;HarmonyHubControl&amp;rdquo; in that directory. Now all you need to know is the IP-address from your hub. You usually can find it in your WiFi-Router under the name &amp;ldquo;HarmonyHub&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s try if the connection works:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;./HarmonyHubControl \[Login\] \[Password\] \[Ip\]&lt;/code&gt;&#xA;&lt;strong&gt;Warning!&lt;/strong&gt; Double-check your password. If you enter a wrong one, you can still stert the activities, but on the next login in your &amp;ldquo;MyHarmony&amp;rdquo;-application you will be thrown out for a while. Don&amp;rsquo;t ask why this works this way. Better ask Logitech instead.&lt;/p&gt;&#xA;&lt;p&gt;The Login is your email-address. If username and password are right you should see the following result: &lt;img alt=&#34;hh1&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;1720px&#34; data-flex-grow=&#34;716&#34; height=&#34;48&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/control-your-harmony-hub-with-a-raspberry-pi-linux/hh1_hu_8bb48e2bca1c02c6.png&#34; width=&#34;344&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;So let&amp;rsquo;s list all activities:&#xA;&lt;code&gt;./HarmonyHubControl \[Login\] \[Password\] \[Ip\] list\_activies&lt;/code&gt;&#xA;&lt;img alt=&#34;HH2&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;388px&#34; data-flex-grow=&#34;161&#34; height=&#34;213&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/control-your-harmony-hub-with-a-raspberry-pi-linux/HH2_hu_a6c3acb4df58670a.png&#34; width=&#34;345&#34;&gt; As you can see there is an activity with the id &amp;ldquo;-1&amp;rdquo;. This activity shuts down all devices. For testing let&amp;rsquo;s just start an activity:&#xA;&lt;code&gt;./HarmonyHubControl \[Login\] \[Password\] \[Ip\] start\_activity 15231836&lt;/code&gt;&#xA;does start the FireTV in my case,&#xA;&lt;code&gt;./HarmonyHubControl \[Login\] \[Password\] \[Ip\] start\_activity -1&lt;/code&gt;&#xA;does shut em all down.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;hh3&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;3015px&#34; data-flex-grow=&#34;1256&#34; height=&#34;85&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/control-your-harmony-hub-with-a-raspberry-pi-linux/hh3-1_hu_a3fe2e1f9d30a0e1.png&#34; srcset=&#34;https://dotnet.work/blog/control-your-harmony-hub-with-a-raspberry-pi-linux/hh3-1_hu_c0131141837dabc1.png 800w, https://dotnet.work/blog/control-your-harmony-hub-with-a-raspberry-pi-linux/hh3-1_hu_a3fe2e1f9d30a0e1.png 1068w&#34; width=&#34;1068&#34;&gt; If you want to, do some fancy stuff with that possibilities. Use your stereo as an alarm clock? Have fun! (your neighbours, too, btw) :)&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>Automate your Synology Surveillancestation with some simple Linux - commands</title>
            <link>https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/</link>
            <pubDate>Thu, 07 Jan 2016 12:00:00 +0100</pubDate><author>dotnet@oles.cloud (Ole Albers)</author>
            <guid>https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/</guid>
            <description>&lt;img src=&#34;https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/reserveip_hu_ec0476895da7cc0d.png&#34; alt=&#34;Featured image of post Automate your Synology Surveillancestation with some simple Linux - commands&#34; /&gt;&lt;p&gt;I own a Synology diskstation which has the &amp;ldquo;surveillance station&amp;rdquo; on board which records content from any LAN (or WiFi)-enabled webcam and sends an alarm when someone is moving at my home. It is possible to enter time schedules when the camera should be enabled and when it shouldn&amp;rsquo;t. But that does not really work the way I wanted. When I come home earlier or even have a day off I have to disable the camera manually.&lt;/p&gt;&#xA;&lt;p&gt;So I decided that I want to use my smartphone to trigger the surveillance mode. Like most of us I always carry the phone with me. So it should be easy: If the phone is at home, I am, too. So the camera should be off. The same way when I am not at home.&lt;/p&gt;&#xA;&lt;p&gt;The solution for this was surprisingly simple: A small bash-script first checks if the phone is in the network. The Surveillance station cam gets enabled or disabled according to this one condition.&lt;/p&gt;&#xA;&lt;p&gt;But first things first. First of all, you should go to your routers admin interface and make sure, your phone will always have the same IP in your local WiFi. This works different on any reouter. On TP-Link it is called &amp;ldquo;reserve Ip&amp;rdquo;:&lt;img alt=&#34;Reserve IP TPLink&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;316px&#34; data-flex-grow=&#34;131&#34; height=&#34;420&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/reserveip_hu_ec0476895da7cc0d.png&#34; width=&#34;553&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt; &lt;/p&gt;&#xA;&lt;p&gt; &lt;/p&gt;&#xA;&lt;p&gt;Now all you need is a Linux machine. I took a fresh Raspberry for this goal. Any simple distribution should be fine. We won&amp;rsquo;t need any special libraries.&lt;/p&gt;&#xA;&lt;p&gt;After you connected to your Raspberry (or other Linux) create the following shell script via vi (or any other tool you prefer):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;user=&amp;#39;pi&amp;#39;&#xA;pass=&amp;#39;circle&amp;#39;&#xA;server=&amp;#39;sauger:5000&amp;#39;&#xA;phone=&amp;#39;192.168.0.7&amp;#39;&#xA;&#xA;dt=$(date &amp;#39;+%d/%m/%Y %H:%M:%S&amp;#39;);&#xA;cd $(dirname $0)&#xA;touch lgstate.txt&#xA;read oldValue &amp;lt; lgstate.txt&#xA;if ping -c 3 ${phone} | grep &amp;#39;bytes from&amp;#39;; then&#xA;  if \[ $oldValue != &amp;#39;isda&amp;#39; \]; then&#xA;    echo \[${dt}\] &amp;#39;stop recording&amp;#39;&#xA;    echo &amp;#39;isda&amp;#39; &amp;gt;lgstate.txt&#xA;    #login&#xA;    wget -q --keep-session-cookies --save-cookies cookies.txt -O- &amp;#34;http://${server}/webapi/auth.cgi?api=SYNO.API.Auth&amp;amp;method=Login&amp;amp;version=3&amp;amp;account=${user}&amp;amp;passwd=${pass}&amp;#34;&#xA;    #disable&#xA;    wget -q --load-cookies cookies.txt -O- &amp;#34;http://${server}/webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&amp;amp;method=Disable&amp;amp;version=3&amp;amp;cameraIds=1&amp;#34; &amp;gt;dev&amp;gt;null&#xA;    #logout&#xA;    wget -q --load-cookies cookies.txt -O- &amp;#34;http://${server}/webapi/auth.cgi?api=SYNO.API.Auth&amp;amp;method=Logout&amp;amp;version=3&amp;#34; &amp;gt;dev&amp;gt;null&#xA;  else&#xA;    echo \[${dt}\] &amp;#39;still there...&amp;#39;&#xA;  fi&#xA;else&#xA;  if \[ $oldValue != &amp;#39;iswech&amp;#39; \]; then&#xA;    echo \[${dt}\] &amp;#39;start recording&amp;#39;&#xA;    echo &amp;#39;iswech&amp;#39; &amp;gt;lgstate.txt&#xA;    #login&#xA;    wget -q --keep-session-cookies --save-cookies cookies.txt -O- &amp;#34;http://${server}/webapi/auth.cgi?api=SYNO.API.Auth&amp;amp;method=Login&amp;amp;version=3&amp;amp;account=${user}&amp;amp;passwd=${pass}&amp;#34;&#xA;    #enable&#xA;    wget -q --load-cookies cookies.txt -O- &amp;#34;http://${server}/webapi/entry.cgi?api=SYNO.SurveillanceStation.Camera&amp;amp;method=Enable&amp;amp;version=3&amp;amp;cameraIds=1&amp;#34; &amp;gt;dev&amp;gt;null&#xA;    #logout&#xA;    wget -q --load-cookies cookies.txt -O- &amp;#34;http://${server}/webapi/auth.cgi?api=SYNO.API.Auth&amp;amp;method=Logout&amp;amp;version=3&amp;#34; &amp;gt;dev&amp;gt;null&#xA;  else&#xA;    echo \[${dt}\] &amp;#39;still noone at home&amp;#39;&#xA;  fi&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Change &amp;ldquo;user&amp;rdquo; and &amp;ldquo;pass&amp;rdquo; in the beginning of the script with your user credentials. You can create a new user for this or use the &amp;ldquo;admin&amp;rdquo; - user. The user has to have admin rights sadly so don&amp;rsquo;t use this script on any machine that can be accessed by anyone but you.&lt;/p&gt;&#xA;&lt;p&gt;&amp;ldquo;server&amp;rdquo; is your server address enter the hostname (or ip) and port there&lt;/p&gt;&#xA;&lt;p&gt;&amp;ldquo;phone&amp;rdquo; is your phone&amp;rsquo;s IP-address&lt;/p&gt;&#xA;&lt;p&gt;So what does this script do?&lt;/p&gt;&#xA;&lt;p&gt;First it tries to ping your smartphone. If this is successful, it checks if this is the first time that works. If it isn&amp;rsquo;t the first time, nothing has to be done. But if the phone wasn&amp;rsquo;t accessable before it logs onto the synology and disables the camera using the web api.&lt;/p&gt;&#xA;&lt;p&gt;The same way it enables the camera if the phone cannot be contacted anymore.&lt;/p&gt;&#xA;&lt;p&gt;The script does only minimum outputs. If you run into problems, just remove the &amp;ldquo;&amp;gt;dev&amp;gt;null&amp;rdquo;  part on any line to get more information.&lt;/p&gt;&#xA;&lt;p&gt;Before you can start the script you should create an empty file where the state is saved by entereing&#xA;&lt;code&gt;touch lgstate.txt&lt;/code&gt;&#xA;You can run that script by entering &amp;ldquo;./pingPhone.sh&amp;rdquo; on the command line. You can watch the changes live in the Surveillance Station -View of the Synology. Changes are displayed instantly. You do not need to refresh the page.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;cam1&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;426px&#34; data-flex-grow=&#34;177&#34; height=&#34;539&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/cam1_hu_51d66631dbf7787a.png&#34; srcset=&#34;https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/cam1_hu_c4b0e092f271b69f.png 800w, https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/cam1_hu_51d66631dbf7787a.png 957w&#34; width=&#34;957&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you have more than one camera change the value of &amp;ldquo;cameraIds&amp;rdquo; to another value that is needed. You also can select multiple cameras by using commas: &amp;ldquo;&amp;amp;cameraIds=1,4,5&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;Finally if you want to run this script automaticly you can create a simple cronjob for it&lt;/p&gt;&#xA;&lt;p&gt;open&#xA;&lt;code&gt;crontab -e&lt;/code&gt;&#xA;and enter the following line:&#xA;&lt;code&gt;\*/15 \* \* \* \* /home/pi/pingPhone.sh &amp;gt;&amp;gt;/home/pi/pingPhone.log&lt;/code&gt;&#xA;(of course the path may differ on your system)&lt;/p&gt;&#xA;&lt;p&gt;Now the presence will be checked every 15 minutes and the cameras will enabled or disabled accordingly. Now all you have to do is to modify your time schedule in the surveillance station that the camera is always in detection mode.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;cam2&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;443px&#34; data-flex-grow=&#34;184&#34; height=&#34;518&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/cam2_hu_873d5afd6c8b24c9.png&#34; srcset=&#34;https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/cam2_hu_15b29fbd01379668.png 800w, https://dotnet.work/blog/automate-your-synology-surveillancestation-with-some-simple-linux-commands/cam2_hu_873d5afd6c8b24c9.png 957w&#34; width=&#34;957&#34;&gt;&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
