<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Federico Imberti on Medium]]></title>
        <description><![CDATA[Stories by Federico Imberti on Medium]]></description>
        <link>https://medium.com/@federicoimberti?source=rss-965f9b800e65------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Fh_OkrZwppufY6SwzrSXYQ.jpeg</url>
            <title>Stories by Federico Imberti on Medium</title>
            <link>https://medium.com/@federicoimberti?source=rss-965f9b800e65------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:32:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@federicoimberti/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to use YouTube more intentionally]]></title>
            <link>https://medium.com/@federicoimberti/how-to-use-youtube-more-intentionally-a09bea4a5026?source=rss-965f9b800e65------2</link>
            <guid isPermaLink="false">https://medium.com/p/a09bea4a5026</guid>
            <category><![CDATA[intentional-living]]></category>
            <category><![CDATA[youtube]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[deep-work]]></category>
            <dc:creator><![CDATA[Federico Imberti]]></dc:creator>
            <pubDate>Mon, 03 Nov 2025 14:03:23 GMT</pubDate>
            <atom:updated>2025-11-03T14:03:23.867Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A remote turning off the youtube algorithm" src="https://cdn-images-1.medium.com/max/1024/1*WSm4PFog7-yh1iEZN_nhQA.png" /></figure><p>I have been a YouTube user for many years and as of today it is still my main medium for consuming visual content, both for entertainment and educational purposes. But i have noticed one thing in the last years that really has made my relationship with the platform a challenging one: the recommendation algorithm is very good at making my brain secrete dopamine! So good in fact that the majority of the times i would open the app i would just stop at the homepage because i was captured by the series of recommendations, partly pulled from my subscriber feed and my playlists but mostly from the topics YouTube understood i enjoyed. I decided to take back control and in this article i will show you how i did it. My approach is articulated in 3 points:</p><ol><li>Turn off the recommendation algorithm to stop the source of dopamine at its source;</li><li>Make better use of your subscriber feed to create a selection of videos that are not “pushed” at you but rather “pulled in” by your interests;</li><li>Use the Watch Later playlist as a way to delay the moment you decide when to watch a recommended video.</li></ol><h3>But First a Short Premise</h3><p>I have never posted a video on YouTube or some other social platform. I don’t use TikTok and on all social media i am subscribed i am mostly a passive user so i don’t know what it’s like being on the other side of the barricade and hoping that my content is pushed to as many people as possible. Through the years, recommendation algorithms sometimes worked positively, helping me discover creators that today i watch with interest and dedication; the problem is when the only approach i had with the platform was mediated by its algorithm, where content was constantly “pushed” at me rather than hand-selected and expanded by recommendations coming from the creators i follow or from my friends. These human-centric recommendations are just what Kyle Chyka suggests in <a href="https://www.kylechayka.com/filterworld">Filterworld</a>, a book that was paramount in developing the alternative approach to YouTube presented here.</p><h3>A More Intentional Approach</h3><p>I have now established why my rapport with the algorithm was bad, i could have also said that consuming content in that manner lowered my attention span, but the word i want to focus on is “<strong>intentionality</strong>” because when you solely rely on computer-generated recommendations you lose intentionality in how you choose what content to watch. This is bad because it makes you develop a preference for what is immediately available rather than investing your time and attention in developing knowledge or even in being entertained better, if entertainment is what you seek. How many times have we watched a video that we were not really interested in just because we were too <strong>hooked</strong> by recommendations to just log off? In my case, too many times, and it was time to stop that!</p><h3>Turn Off the YouTube Algorithm</h3><p>Yes, this is the most painful step, but it is the only real way to brake the addiction. You could try to limit consumption or attempting to ignore it, but the temptation will always be there. Cal Newport, in a recent blog <a href="https://calnewport.com/what-neuroscience-teaches-us-about-reducing-phone-use/">article</a> and <a href="https://podcasts.apple.com/it/podcast/deep-questions-with-cal-newport/id1515786216?l=en-GB&amp;i=1000731580317">podcast episode</a>, goes deep (pun intended) in describing which techniques work and don’t work when curbing once dependency on technology: turning off recommendations is one of the most effective ways to do so as it removes the reward signals that your brain used to form the habit. I will not go much into details since there are many articles online on how to do this (<a href="https://www.popsci.com/diy/how-to-reset-youtube-algorithm/">here</a> is one straight to the point that you can follow), but the basic idea is that you want to access your <a href="https://myaccount.google.com/data-and-privacy">Google Account settings</a>, delete your watch history and then turn it off, so that YouTube does not have the inputs it needs to recommend content. In the end you will find the homepage beautifully desolate, just with a prompt pleading you to turn the watch history back on (nice try, Google!). A very positive bonus is that the dreadful “Shorts” page is also deactivated. Now that you will not see recommendations anymore you may ask: how will i keep in touch with the creators I enjoy? and how will i discover new ones i might like? I will answer this questions soon, starting from the first one.</p><h3>The Subscriptions Feed is Your Friend</h3><p>You can think of the Subscriptions page as a sort personal algorithm, tailored to you by none other than yourself. Technically it as a reverse chronology of the videos that the channels you subscribed to have published, where the latest ones are shown first. When i turned off my algorithm and started using this page more often i noticed that i kept skipping many of the videos in this feed (mostly because i haven’t cleaned my subscriptions list in a while) as many channels put out videos i was not really interested in anymore. That is why i created my “<strong>Subscription feed cleanliness rule</strong>”: if there is a channel in my list of which i have ignored at least 3 videos in a row, then i unsubscribe. Maybe they made one video on a topic that interested me but since then have made content i don’t find appealing; that’s alright, no hard feelings! But i must keep my feed clean, which means that i must be excited to see every new videos that pop up there.</p><h3>Meet the Watch Later Playlist &amp; Delayed Recommendations</h3><p>You may have noticed that even after turning off and deleting the watch history the algorithm is still lurking around, but its power is greatly diminished, to a point where we can use it to our advantage. One place where it still dwells is on the right side of the video you are watching, recommending others with similar topics to that one. That is something we cannot escape, but once again: that recommendation is just loosely tailored to us, it has far less power than the algorithm we learned to fear from the homepage and we can tame its influence using the Watch Later playlist. This is a private playlist that all profiles have by default, videos can be added to it in order to… you guessed it: be watched later! Here comes my second rule, which i called the “<strong>delayed recommendations rule</strong>”: we must resist clicking the recommendation right away and instead save it to the Watch Later playlist so as to defer the moment when we will click it. This way we can be much more intentional (that word again!) because when we will browse our Watch Later playlist we will encounter the video again and decide if it is worth our time or it was just something that we thought might interest us, but didn&#39;t hold up to the test of time. Another good indicator that a video really interests us is finding ourselves actually opening YouTube to watch that specific video the moment we decide to watch something on the platform. By applying this rule we can use the recommendations wisely to dig deeper into the topic that the original video talked about, without being controlled by the recommendation.</p><h3>Bonus: Do Yourself a Favor and Pay For the Premium Subscription</h3><p>No, no, don’t worry, YouTube didn&#39;t pay me for this. I decided to upgrade way before switching off the algorithm simply because the <strong>ads</strong> i was presented were either brain rot-enducing or some guy trying to convince me my life is worthless as i didn’t create a company when i was 8 or some other weird guy with a badly tailored suit and a rented Lamborghini trying to steal my money with some stupid online course. Moreover watching those ads caused me to shift my attention away from what i was trying to enjoy, making me more susceptible to consume short-form content and more distracted overall (<a href="https://neurolaunch.com/context-switching-psychology/">context shifts are terrible for the attention</a>). Finally i decided to bite the bullet and pay to get rid of the problem and now I can’t imagine going back (yes, i know i am paying YouTube to solve a problem that they created). Moreover you get YouTube Music ad-free which is a pretty decent music streaming service. Of course if you think paying for this service is useless or you are trying to reduce your number of subscriptions it’s perfectly fine to skip it!</p><h3>In Conclusion</h3><p>Since i have applied this framework my relationship with the platform is have become much more constructive as i don’t find myself mindlessly browsing the homepage searching for something “good” to watch but rather i look in my subscriptions feed to see if there is something new. If not i check the Watch Later playlist and if i don’t find anything there that i genuinely care about, i just log off!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a09bea4a5026" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Repurposing an Old Kobo eReader into a non-distracting, low maintenance, Home Assistant Dashboard]]></title>
            <link>https://medium.com/@federicoimberti/repurposing-an-old-kobo-ereader-into-a-non-distracting-low-maintenance-home-assistant-dashboard-d04579a315b0?source=rss-965f9b800e65------2</link>
            <guid isPermaLink="false">https://medium.com/p/d04579a315b0</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[home-assistant]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Federico Imberti]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 16:25:55 GMT</pubDate>
            <atom:updated>2025-04-29T16:25:55.654Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iT1SnxkQvjWNsJsxGSSBLw.jpeg" /></figure><p>Around 2011 my father bought for himself an eReader, more specifically a <a href="https://en.wikipedia.org/wiki/Kobo_Touch">Kobo Touch N905B</a>, equipped with a 900x800 pixels eInk display, Wifi and many other features that at that time were pretty neat. The device itself is compact and incredibly light; it’s built with a kind of rubberised plastic that makes it pleasant to hold in the hand and is light as a feather. After many years resting in a drawer i re-discovered it and was surprised to see it power on; i wanted to find a good use for it since i find it too small to read books. Here is what i built. but first let me write a bit of my love for eInk.</p><h3>eInk Displays Look Amazing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vFFqobR7QLQ6BE8K5nBug.jpeg" /></figure><p>I always had a fascination with eInk technology. It is very different from LED and OLED where the image is drawn not by using pixels but by moving around black and white pigment particles inside microcapsules. I just love the way they look: the contrast is absolute, there is no such thing as “angles of vision”, they are kind on the eyes…</p><p>I had been thinking about putting a dashboard on my desk but I didn’t want the hassle of another glowing screen on my workspace so eInk was the perfect solution since this model lacks a backlight making it only visible when light is reflected upon it. Furthermore the lack of active illumination does not catch my eye when i am working since <strong>the display disappears in my peripheral vision</strong> and it appears only when i want to glance at it.</p><p>Honestly, for non-distracting, low-maintenance dashboards, I can’t imagine a better technology than eInk!</p><h3>My Design Choices</h3><p>My idea behind the design of the elements was to bring continuity with my current setup. Those of you who use the widgets in Apple products would have certainly recognised the design of the weather and calendar: the latter is inspired from the widget of the iPhone’s standby mode and the former from the one in MacOS. Since i have both a Mac and an iPhone on my desk i love how this dashboard stylistically integrates with them. <br>The rest of the elements are quite simple:</p><ul><li>On the top there are a 24h clock and an indication of the people who are currently home represented with the initial of their names to indicate presence (luckily everyone who lives with me has names with different initials!);</li><li>On the bottom i display my public IP address mostly as an indication that i am connected to the internet. Below there are two indicators for the download and upload rates on my network compared to the maximum i could achieve. This is helpful to monitor if the network is saturated so that i can go punish the culprit (it’s usually me).</li></ul><h3>The First issue</h3><p>Kudos to the folks at <a href="https://www.kobo.com/">Rakuten Kobo Inc</a>. who kept updating this device long after its release date, something that in the years we have seen many other companies not doing. Along with software updates came some “Beta Features” — as they are called in the OS — the likes of a not very useful sketchpad, but also of a far more interesting web browser. My first idea was to write a simple <strong>HTML</strong> page with some JavaScript to fetch sensor data and CSS to make it look pretty, but after some testing, bad news ensued… <br>The Kobo mounts a version of Android Browser 4 of which i will leave some spec for the browser nerds out there</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BK2fUJL7uO8vgSfgL--C3w.png" /></figure><p>I am sure the more eagle-eyed of you immediately noticed one thing: <strong>JavaScript is disabled</strong> (and there is no option to enable it), which means we cannot run scripts locally, which is actually good when you mindlessly go on <a href="https://www.whatismybrowser.com/">whatismybrowser.com</a> using a 15 years old device, but complicates my plans for the dashboard. Good news though: <strong>CSS works</strong>.</p><h3>The Solution</h3><p>Now that my naïve idea was marooned on the shores of reality i had to find a less lazy solution: building a <strong>server</strong> that takes care of fetching data from Home Assistant, generates the HTML markup and returns a generated <strong>static HTML page</strong> so that the Kobo would just need to display it without the need to run any further script.</p><p>Is this the best solution out there? I don’t know. Did it work? Sure it did!</p><h3>The Code</h3><p>I chose Python as the programming language for the project since i like it and… is Python… you get me. What the code does is quite straightforward:</p><ol><li>Get the data from Home Assistant;</li><li>Format it with HTML tags, linking them to CSS where needed;</li><li>Return a static HTML page when someone makes a GET request.</li></ol><p>Don’t expect to find any fancy coding , but i am quite satisfied of the final result. I put in as many comments as i could to guide you through it so that you can modify it as much as you please. It’s available on GitHub alongside all you need to deploy it using <strong>Docker</strong> and <strong>Docker Compose</strong>.</p><p><a href="https://github.com/FI-153/eInk_dashboard">GitHub - FI-153/eInk_dashboard: Code for displaying an Home Assistant dashboard on low end and obsolete hardware. It works best on eInk displays.</a></p><h3>What Could Be Made Better</h3><p>A part of the code i am not very proud of is the following &lt;meta&gt; tag</p><pre>&lt;meta http-equiv=&#39;refresh&#39; content=60&gt;</pre><p>it <strong>refreshes the whole page every 60 seconds</strong> to make the clock on the left corner work and update the sensor values. Since i cannot use JavaScript to only update that little square i have to request a new page every minute, luckily the Kobo is smart enough that if some elements did’t change then the whole page is not fully redrawn but rather only the parts that changed, so that the screen does not catch my eye every time it updates. If I din’t put in the clock then i would have probably set the page to update every 5 minutes or so, since if i need fresh informations immediately i can just reload manually.</p><p>Another thing to notice is that <strong>everyone on the LAN can get the dashboard</strong> since there is no authentication. This could be solved easily but in my case i didn’t need it so i left it open.</p><p>Finally a good idea is to <strong>isolate the Kobo from the internet</strong>, for instance with a firewall rule that blocks incoming and outgoing traffic since we are talking about a very old device that hasn’t received any security updates in a long while.</p><h3>But why is it backwards?</h3><p>Oh, great question keen-eyed reader! If you snooped around the CSS file i am sure you have noticed that the HTML page is flipped 180 degrees, this is simply because so i can run a cable that keeps the Kobo connected to power, since the sync/charge port is on the bottom. If you are in a different situation just remove the styling of the HTML tag.</p><h3>Further development</h3><p>This dashboard is perfect for my needs and as of today i have been using it for a couple of months with great satisfaction. I don’t plan to modify it in the coming future but i suppose it would be cool to add some buttons to trigger scripts or scenes. It would be easy: add a method to send POST requests to HA and swap out some of the elements to add the buttons.</p><p>I would also like to remove the browser’s UI, but it does not bother me too much for now.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d04579a315b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Speech To Phrase + LLM: the best of both worlds on low power hardware]]></title>
            <link>https://medium.com/@federicoimberti/speech-to-phrase-llm-the-best-of-both-worlds-on-low-power-hardware-a2e96b16027b?source=rss-965f9b800e65------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2e96b16027b</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[home-automation]]></category>
            <category><![CDATA[home-assistant]]></category>
            <dc:creator><![CDATA[Federico Imberti]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 13:49:10 GMT</pubDate>
            <atom:updated>2025-04-21T14:06:52.041Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5RXcaBcZYqCCvXB62Cg8yg.jpeg" /></figure><p>During and after “The Year of Voice” in 2023 the folks at the Open Home Foundation and Nabu Casa worked hard to bring voice control to Home Assistant and after 2 years the project has realised a truly open voice assistant that is easy to use, quite powerful and that can be run fully local. You can even use it to converse with an LLM the likes of GPT from OpenAI, Gemini from Google, models run locally on Ollama and so on. And wow! having a powerful LLM capable of interpreting commands is truly life changing in the home automation scene: phrases like “I have an headache, adapt the lights in this room” can be processed by the AI into contextually meaningful adaptation of once devices.</p><h3>But it comes with a caveat…</h3><p>To run this fully local, or even just a part of it, is computationally expansive, especially when considering the hardware needed to run a big enough LLM to provide good answers in reasonable time. As for myself i run my instance of HA as HAOS on a capable but still low powered Raspberry Pi 5 with 4GB of memory, so running and LLM locally is out of the question, but, hey! Models like GPT 4 o1-mini can be run very cheaply though the API and provides good enough responses for what we need them to do in home automation: a full day of heavy testing when i was experimenting with them costed me something like 0.2$, and that was a lot since most days i don’t go over 0.02$–0.05$. So i could bite the bullet and have a “half local” system outsourcing the LLM heavy lifting to a remote server paying pennies for it, and that’s what i did! now, let’s see, mmh… something easy… got it! “Ok Nabu, turn on the lights in the lab”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1nDiZGdicwpI_3th9ERXfg.png" /><figcaption>On Rbpi 5 4GB: Whisper (base-int8) + LLM (GPT 4o-mini) + Piper (en-US-libritts_r-medium)</figcaption></figure><p>Not too bad even if it didn&#39;t properly time the Text-to-speech which i would say took around 1s before the speaker started speaking, so in total we can say it took around 3s since i stopped talking. And this was a best case scenario: since my system is so low powered i need to run a small model for Speech-to-text (base-int8 on Whisper), factor in my italian accent and many times the system doesn&#39;t really get what i am saying… for instance: “Ok Nabu, turn on the lights”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LFGjCFU6Lhyt4SbM9xsVcg.png" /><figcaption>On Rbpi 5 4GB: Whisper (base-int8) + LLM (GPT 4o-mini) + Piper (en-US-libritts_r-medium)</figcaption></figure><p>You see? it took more than 5s to process the audio, which was sent wrongly to GPT which luckily interpreted it correctly (probably based on the context of my past interactions) and tuned on the lights in my lab. All of this took more than 7s, would you wait all this time to have the lights on? I hope not! In this time you could have walked the whole room a couple times, made yourself a coffee and pondered about existence… in darkness of course. But don’t worry because there is a solution to this…</p><h3>And the solution is…</h3><p>A nifty little add-on presented at the <a href="https://www.home-assistant.io/blog/2025/02/13/voice-chapter-9-speech-to-phrase/">Year of Voice chapter 9</a> called “<a href="https://github.com/OHF-voice/speech-to-phrase">Speech-to-phrase</a>”. It is not an open ended Speech-to-text system and the documentation says it best:</p><blockquote>Instead of answering the question “what did the user say?”, it answers “which of the phrases I know did the user say?”</blockquote><p>to make it very simple there are a series of template phrases which are adapted to the devices, entities, zones and the such that you exposed to Assist creating a dataset of phrases which defines everything the AI can do in you house. So instead of trying to transcribe whatever you said it tries to find the best match over the collection of phrases it assembled on startup. As you can imagine, this is way faster than what we have seen before. Now, let’s install the Add-on, create a new assistant and try again (hint: don’t blink!): “Ok Nabu, lights on”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kksRMuRQANW7PVGoOwUmQw.png" /><figcaption>On Rbpi 5 4GB: Speech-To-Phrase + Home Assistant + Piper (en-GB-alan-medium)</figcaption></figure><p>Whoa! Around half a second since i finished speaking! And it didn’t have any issues with my accent! Now this is what a useful assistant does on a daily basis, when we want our commands to be executed promptly and precisely: i am talking about lights, switches, scenes, timers and other very basic commands. But what about those situations when an LLM would really come in handy?</p><h3>Here comes Speech-To-Phrase + LLM!</h3><p>I have decided that in my smart home i am going to run two distinct voice pipelines. The first one will be based on Speech-To-Phrase and will be my preferred configuration on my Voice Assistant PE and other satellites i will buy in the future, while a second pipeline will integrate with an LLM (i chose GPT 4o-mini) and handle more complex commands or queries i may have. So for the first pipeline — Speech-To-Phrase— here is my configuration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYu4w5HM69341OO-VdwVEA.png" /><figcaption>Home Assistant as Conversation agent + Speech-to-text using Speech-To-Phrase + Text-to-speech using the medium version of Alan</figcaption></figure><p>and for the the second one — Home Assistant + GPT — here is what i decided upon</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DSoMCSNrCk-v2Ri9T8apfA.png" /><figcaption>ChatGPT (w/ web search and location sharing) as Conversation agent + Speech-to-text using Whisper + Text-to-speech using the medium version of Alan</figcaption></figure><p>now we must find a way to invoke either one or the other. For this example I’m using the <a href="https://www.home-assistant.io/voice-pe/">Home Assistant Voice Preview Edition</a> but with some tweaking of the script i suppose it’s going to also work with other ESP Home compliant smart speakers like the various ESP32-based devices around, but I haven’t tested it so take it as an semi-educated guess. What remains to do is actually quite simple since we are just going to write a <a href="https://www.home-assistant.io/integrations/script/">script</a> which changes the assistant on the satellite to “Home Assistant + GPT”, starts a conversation with it to compute our LLM-powered request, waits for it to finish and finally resets “Speech-To-Phrase” as voice assistant on the Voice PE. Here are all the the scripts you will need:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec955ed501e203f6f514ddeaf5969c91/href">https://medium.com/media/ec955ed501e203f6f514ddeaf5969c91/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fe0e18612ba966bf5abedda45ef0199/href">https://medium.com/media/3fe0e18612ba966bf5abedda45ef0199/href</a></iframe><p>of course you will need to change the device_ids and entity_ids but the rest should work out smoothly. Pay particular attention in the “wait_for_trigger” action to select the correct entity_id since it wasn&#39;t so straight forward for me. In the same action also notice that i have setup a timeout of 1 minute so if something goes wrong with the request i am sure that “Speech-To-Phrase” will be always reset automatically. A final note: to distinguish between the two agents i at first setup two different voices but i noticed it slowed down Piper a bit so i decided to change the colour of the LED ring: white for Speech-To-Phrase and green for LLM.</p><h3>That’s all good, but how do i trigger it?</h3><p>Nice question, the answer is also nice: create an automation that <a href="https://www.home-assistant.io/voice_control/custom_sentences/">adds a custom sentence</a> to the list of sentences recognised by Speech-To-Phrase and set it to trigger the script you just created. Just be mindful to restart the Speech-To-Phrase add-on before you try to invoke the automation to be sure it is in its database. Another option is of course to use a shortcut button or other triggers you find fits in your life.</p><h3>Going the Home Assistant Cloud way</h3><p>In this article i haven’t talked about it yet but there is also a <a href="https://www.nabucasa.com/">subscription</a> that Nabu Casa offers for 7.5 euros a month (for the EU) where, among many other perks, you can have all your requests processed on the Nabu Casa’s cloud. It is a good solution of course and the money you pay help finance the HA project, but here i decided to focus on how to get the best out of your local low power hardware.</p><h3>Conclusion</h3><p>So here we are, now that you gave multiple personality disorder to your home i’d say you should be quite proud of yourself! Now your day to day requests can be processed lightning fast and you have the option to query an LLM only when you really need it. Thanks for the time you dedicated me, have a nice one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2e96b16027b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting HomePod’s Temperature and Humidity Sensors to Home Assistant]]></title>
            <link>https://medium.com/@federicoimberti/connecting-homepods-temperature-and-humidity-sensors-to-home-assistant-952398a1a2be?source=rss-965f9b800e65------2</link>
            <guid isPermaLink="false">https://medium.com/p/952398a1a2be</guid>
            <category><![CDATA[home-automation]]></category>
            <category><![CDATA[homepod-mini]]></category>
            <category><![CDATA[home-assistant]]></category>
            <category><![CDATA[homepod]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Federico Imberti]]></dc:creator>
            <pubDate>Sun, 20 Apr 2025 04:14:19 GMT</pubDate>
            <atom:updated>2025-04-20T20:37:35.997Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fmOdotSITD6wrKFem50oQw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jaimemarrero?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Jaime Marrero</a> on <a href="https://unsplash.com/photos/a-close-up-of-three-different-speakers-on-a-table-NFkP62Z85Jk?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><h3>Connecting HomePod’s Temperature and Humidity Sensors into Home Assistant</h3><p>At the beginning of 2023 Apple surprised its customers with a software update for its HomePod Mini and newly (re)released HomePod which exposed two temperature and humidity sensors to HomeKit. For various reason until then there hasn&#39;t been an official integration in Home Assistant (HA) which allows users to integrate them outside of HomeKit. The solution until then has been using a couple of workarounds that i would like to illustrate in this post alongside some considerations emerged in more than 2 years of usage. The method i will present have been illustrated in this (looong) discussion from the Community</p><p><a href="https://community.home-assistant.io/t/how-to-integrate-homepod-mini-sensors-into-home-assistant-when-direct-integration-isnt-possible/665074">How-to integrate HomePod Mini Sensors into Home Assistant When Direct Integration Isn&#39;t Possible</a></p><p>Specifically i will focus on a slight variation of “Method B” with a couple of options on how to trigger the switch that tells HomeKit to send the data to HA. I tried to link as many resources as possible and to make it as comprehensible as i can, of course some tinkering may still be needed but i think that’s part of the fun!</p><h3>Some issues emerged over the years</h3><p>Let’s get straight to it: sometimes Apple updates the HomePod’s OS and breaks the automation we so carefully setup and… we cannot really do anything about it until a new update fixes the problem! With “breaking” i mean that the automation still runs smoothly but for some reason the data sent to HA with the POST request is not what is read by the sensor but rather values like 0% for humidity or some other wrong information. But if you go the Home App you can see that the problem is not in the sensors themselves since they correctly display their values in the app. As of April 2025 it all works well but we just had 3 months of the automation not working due to some random Apple update. I read around that if you set as home hub an Apple TV the issue is resolved but i didn’t try it since i’m still rocking a 4th generation Apple TV HD which does not receive updates anymore. Situations like these have happened 3–4 times over the last years and Apple is usually fast enough at solving them, but still there is this possibility of frustration…</p><h3>Requirements</h3><ul><li>A working HA instance reachable on your home network, its IP address, Port and an <a href="https://community.home-assistant.io/t/how-to-get-long-lived-access-token/162159">API token</a> which you will need to authenticate when posting the sensor’s data;</li><li>Access to your config/configuration.yaml file. There are many ways to access it and <a href="https://www.home-assistant.io/docs/configuration/">this article</a> will surely help;</li><li>A HomePod 2nd generation or any HomePod Mini connected to your network.</li></ul><h3>The procedure in short</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*0yLT3n9dQfgBxoAahPGX3Q.jpeg" /><figcaption>A brief schematic</figcaption></figure><p>What we are going to do is pretty simple: we are about to set up an automation on the Home App that once a switch turns on reads the values of humidity and sensor from the HomePod and sends a <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/POST">POST</a> request to HA at</p><pre>http://HA_IP:HA_PORT/api/events/EVENT_TO_LISTEN_TO</pre><p>Where HA_IP and HA_PORT are your HA’s server IP address and port and EVENT_TO_LISTEN_TO is what the template sensor we are going to create on HA will listen to. In may case for instance i have</p><pre>http://10.0.0.2:8123/api/events/bedrooom_homepod_temperature</pre><p>As i was saying the final step is simply creating a template temperature sensor which reacts to the event we defined and updates its value. Once it’s done you’ll have your sensors displayed in HA as normal!</p><h3>The Procedure</h3><h4>The Dummy Switch</h4><p>The first thing we are going to setup is the switch that the automation on the Home App will react to by sending data to HA. The method presented in the community thread is to create it using the HA integration for HomeKit and then create an automation that turns it on for some time and then off. This is all good if you want to stay fully on HA and i will invite you to read <a href="https://community.home-assistant.io/t/how-to-integrate-homepod-mini-sensors-into-home-assistant-when-direct-integration-isnt-possible/665074">their explanation</a> on how to set it up. Since on my home server i also run <a href="https://homebridge.io/">HomeBridge</a> i followed a different — and in my opinion easier — route where i used the plugin <a href="https://github.com/kbrashears5/typescript-homebridge-schedule#readme">HomeBridge Schedule</a> configured as such:</p><pre>{<br>    &quot;name&quot;: &quot;HomePod Tmp &amp; Hum Log&quot;,<br>    &quot;serial&quot;: &quot;23451235&quot;,<br>    &quot;interval&quot;: 5,<br>    &quot;_bridge&quot;: {<br>        &quot;username&quot;: &quot;0E:DA:64:12:5E:27&quot;,<br>        &quot;port&quot;: 38233<br>    },<br>    &quot;accessory&quot;: &quot;Schedule&quot;<br>}</pre><p>Which means that every 5 minutes the switch named “HomePod Tmp &amp; Hum Log” is turned on and then immediately off. The configuration does not require to write any YAML since it can be done from the UI. Of course there other solutions and plugins but i can say that in the last 2 years this one served me well. Now you will have a dummy switch on your Home App and we can continue to the most annoying part of the setup!</p><h4>Setting up the automation in the Home App</h4><p>Why did i call this the most annoying part? Because we are going to use Apple’s clunky Shortcuts interface to build the automation that reads the data from the HomePods and sends it to HA; since we cannot copy-paste the blocks or call custom procedures from the Home App we are going to type more than necessary…<br>Putting aside my love-hate relationship with Shortcuts here’s what we are going to do:</p><ol><li>From the Home App we are going to create an automation for when “An Accessory is Controlled” and we’re going to select our dummy switch listening for when it turns on. Then scrolling down in the next page and tapping “Convert To Shortcut”;</li><li>Add the block “Get State” and set it to return the temperature of the targeted HomePod, then you can save it to a variable for better readability. Do the same for the humidity. Repeat this step for as many HomePods you have. You could also create separate automatons for separate HomePods reacting to the same switch, this is up to you. I have 2 HomePods and i put everything into a single automation;</li><li>Add the “Text” block and write Bearer YOUR_BEARER_TOKEN being mindful to put a single space in between the two words and no spaces at the end of at the beginning. YOUR_BEARER_TOKEN is the API token from HA that you obtained as a requirement. Then set a variable to contain the text’s value since we are going to use it multiple times;</li><li>Finally we have to send the POST request to HA. Confusingly, we are now going to add the “Get contents of” block even if we are doing a POST request instead of a GET (I&#39;m a stickler, i know). As address input <a href="http://HA_IP:HA_PORT/api/events/EVENT_TO_LISTEN_TO">http://HA_IP:HA_PORT/api/events/EVENT_TO_LISTEN_TO</a> as described above and as a method select “POST”. Then under “Headers” add a new header called “Authorization” having as value the variable created at the end of step 3. Finally select “JSON” as Request Body and insert the 3 fields displayed in the code block at the end of this session. You will not be able to copy-paste the code and will have to manually add the three fields rewriting everything for every request (see? Annoying…)</li><li>It’s done! Now when the automation is run the humidity and temperature values are sent to HA. To test it on HA you can go to “Developer tools &gt;&gt; Events” and listen to EVENT_TO_LISTEN_TO . Now when you fire the automation on the Home App you should see the data that was sent.</li></ol><pre>#Body of the JSON request to add in the Home App automation<br>{<br>  state: TEMPERATURE_VARIABLE_SET_IN_STEP_2<br>  device_class: measurement<br>  state_class: temperature<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*sSYTKWBJEoPwvuRsWdYFRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*Q7VibGMjmTz5gm4Wf_9Sqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*N1_qiNvg9zZQZmLzyYrCfw.png" /><figcaption>Steps 1 and 2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*PkeQ3ZlDq8NeKP4vFTvzGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*U0ifbXa81oeuKeXQhodyJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*a6VUSQ-VGG7NvsKUB7JqvA.png" /><figcaption>Steps 3 and 4</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*LCGiVLasiI_4LOUPabIJCw.png" /><figcaption>Step 5: Example of the received event on HA</figcaption></figure><h4>Setting up the template sensors in Home Assistant</h4><p>Now that the suffering is over we can go back to our beloved Home Assistant and play around with some lovely <a href="https://www.youtube.com/@paulhibbert"><em>BESPOKE CONFIGURATION .YAML FILES</em></a>. <br>We are going to edit the configuration.yaml file under the /config/ folder of our HA installation. In my case i run HAOSS so i used the brilliant add-on <a href="https://github.com/hassio-addons/addon-ssh">Advanced SSH and Web Terminal</a>. We are going to create a template sensor for each HomePod’s temperature and humidity sensor by pasting this cute snippet for the temperature (if you already have setup other templates then don’t paste the “template:” part):</p><pre>template:<br>  - trigger:<br>     - platform: event<br>       event_type: &quot;EVENT_TO_LISTEN_TO&quot;<br>    sensor:<br>      - name: &quot;Bedroom temperature&quot;<br>        unique_id: &quot;dbe354ter&quot;<br>        state: &quot;{{ trigger.event.data.state }}&quot;<br>        unit_of_measurement: °C<br>        device_class: temperature<br>        state_class: measurement</pre><p>And for the humidity, of course putting in the correct EVENT_TO_LISTEN_TO</p><pre>  - trigger:<br>     - platform: event<br>       event_type: &quot;EVENT_TO_LISTEN_TO&quot;<br>    sensor:<br>      - name: &quot;Bedroom humidity&quot;<br>        unique_id: &quot;3464564634&quot;<br>        state: &quot;{{ trigger.event.data.state }}&quot;<br>        unit_of_measurement: &quot;%&quot;<br>        device_class: humidity<br>        state_class: measurement</pre><p>Now you are done and HA will take care of displaying the new sensors and keep track of the changes in their values. I would suggest setting up an automation that purges the database of old temperature and humidity readings to avoid it becoming too large, but you do you.</p><h3>Conclusion</h3><p>All is done now and we find ourselves with out sensors correctly integrated in HA. I understand this technique is not too straightforward but as of today is the best we can do, hoping that in the future Apple will make it easier to integrate their stuff into HA, but their whole dedication to privacy (at least on paper) makes me skeptical about this ever happening.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=952398a1a2be" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>