<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>RDS on Smart Home? Sure — But Secure!</title><link>https://smarthome-aber-sicher.de/en/tags/rds/</link><description>Recent content in RDS on Smart Home? Sure — But Secure!</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Thu, 03 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://smarthome-aber-sicher.de/en/tags/rds/index.xml" rel="self" type="application/rss+xml"/><item><title>My Radio Mutes Its Own Ads</title><link>https://smarthome-aber-sicher.de/en/blog/2026/09/03/radiowerbung-stummschalten/</link><pubDate>Thu, 03 Sep 2026 00:00:00 +0000</pubDate><guid>https://smarthome-aber-sicher.de/en/blog/2026/09/03/radiowerbung-stummschalten/</guid><description>&lt;img src="https://smarthome-aber-sicher.de/blog/2026/09/03/radiowerbung-stummschalten/cover.jpeg" alt="Featured image of post My Radio Mutes Its Own Ads" /&gt;&lt;p&gt;Half past six, bathroom, the radio is on. Music, news, traffic report — and then the first ad jingle of the day. It cuts off after a blink. Nobody pressed a button. The speaker muted itself.&lt;/p&gt;
&lt;p&gt;Behind it is no language model detecting ads, no audio fingerprinting, no subscription service. Behind it is an automation with two triggers — and a station that voluntarily announces when ads are playing.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s the actual joke of the thing: I didn&amp;rsquo;t have to build the detection at all. &lt;strong&gt;SWR1 delivers it for free.&lt;/strong&gt;&lt;/p&gt;
&lt;!-- Insert YouTube embed once the video is live --&gt;
&lt;!-- &lt;div class="video-wrapper"&gt;
&lt;div class="video-placeholder" data-embed="https://www.youtube-nocookie.com/embed/VIDEOID?autoplay=1" onclick="loadYtIframe(this)"&gt;
&lt;img src="https://smarthome-aber-sicher.de/img/sas_youtube.png" alt="YouTube Video" loading="lazy"&gt;
&lt;div class="play-button"&gt;&lt;/div&gt;
&lt;div class="privacy-notice"&gt;
To load the video, please click the image. Please note that by doing so, data will be transmitted to YouTube.
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
--&gt;
&lt;h2 id="the-station-gives-it-away-itself"&gt;The station gives it away itself
&lt;/h2&gt;&lt;p&gt;Every radio station sends a small text channel alongside the audio. On FM, this is known as RDS radio text; on an internet stream, the same text arrives as title metadata. Whether the station taps the same source internally, I don&amp;rsquo;t know — all that matters to us is that the same text arrives at the speaker.&lt;/p&gt;
&lt;p&gt;The crucial point: this text field is &lt;strong&gt;not a static station name&lt;/strong&gt;. It changes constantly. On SWR1, a sample from a single morning included this, among other things:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Walk of life / Dire Straits
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get lucky / Daft Punk feat. Pharrell Williams
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I don&amp;#39;t like Mondays / The Boomtown Rats
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Something stupid / Robbie Williams &amp;amp; Nicole Kidman
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Guten Morgen Baden-Württemberg mit Cora Klausnitzer &amp;amp; Matthias
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SWR1 Baden-Württemberg Verkehrsservice
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SWR1 Stau-Hotline: 0711-929 10 100
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Aktuelle Nachrichten auch auf swr1.de
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Nachricht über die SWR1 App
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SWR1 Baden-Württemberg
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Werbung in SWR1 ← the marker everything listens for
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Song title, artist, presenter, traffic report, phone numbers — and right in the middle, the announcement that ads are currently playing. The station says so because the field is maintained anyway. Nobody thought that someone would build a mute automation on top of it.&lt;/p&gt;
&lt;p&gt;My Sonos speaker reads this metadata from the stream, and the Sonos integration passes it into Home Assistant as the &lt;code&gt;media_title&lt;/code&gt; attribute. That makes the ad block a perfectly normal state change in the system — and everything Home Assistant can do with state changes now works for radio ads too.&lt;/p&gt;
&lt;p&gt;The signal chain is short:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SWR1 broadcast
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └─ Radio text in the stream (&amp;#34;Werbung in SWR1&amp;#34;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └─ Sonos speaker reads the stream metadata
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └─ Sonos integration exposes it as the media_title attribute
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └─ Automation triggers on the exact text
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └─ media_player.volume_mute
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id="step-1-find-your-stations-marker"&gt;Step 1: Find your station&amp;rsquo;s marker
&lt;/h2&gt;&lt;p&gt;This is the most important section of this article, because &lt;code&gt;Werbung in SWR1&lt;/code&gt; works &lt;strong&gt;exclusively for SWR1 Baden-Württemberg&lt;/strong&gt;. Other stations phrase it differently, or don&amp;rsquo;t send a marker at all. Before you build anything, you need to check what your station actually sends.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s how:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Play your target station on the speaker you want to control later.&lt;/li&gt;
&lt;li&gt;In Home Assistant, open &lt;strong&gt;Developer Tools → States&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Find your media player entity, e.g. &lt;code&gt;media_player.bathroom&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Watch the &lt;code&gt;media_title&lt;/code&gt; attribute column while an ad block plays.&lt;/li&gt;
&lt;li&gt;Note the text &lt;strong&gt;exactly&lt;/strong&gt;: capitalization, spaces, special characters. The trigger compares character by character.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Faster: use &lt;strong&gt;Developer Tools → Template&lt;/strong&gt;. This line shows you the live radio text without hunting through a long attribute list:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-jinja" data-lang="jinja"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;state_attr&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;media_player.bathroom&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;media_title&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="x"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If you don&amp;rsquo;t want to sit next to the screen and wait for the next ad block, mirror the radio text into a template sensor. It then shows up in history, and you can review at your leisure what ran through over the day:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;sensor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Radio Text Bathroom&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;{{ state_attr(&amp;#39;media_player.bathroom&amp;#39;, &amp;#39;media_title&amp;#39;) }}&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;If you can&amp;rsquo;t find a usable marker, that&amp;rsquo;s where it ends — your station simply doesn&amp;rsquo;t send the information. Annoying, but honestly the more likely outcome. I got lucky with SWR1.&lt;/p&gt;
&lt;h2 id="step-2-two-triggers-one-if"&gt;Step 2: Two triggers, one &lt;code&gt;if&lt;/code&gt;
&lt;/h2&gt;&lt;p&gt;Now comes the ingredient many people don&amp;rsquo;t have on their radar: &lt;strong&gt;Home Assistant can trigger on an attribute change, not just on a state change.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The state of my speaker is &lt;code&gt;playing&lt;/code&gt; the entire time. It doesn&amp;rsquo;t change when the ad starts — audio keeps playing, after all. What changes is the &lt;code&gt;media_title&lt;/code&gt; attribute. That&amp;rsquo;s exactly what the trigger listens for via the line &lt;code&gt;attribute: media_title&lt;/code&gt;. Without it, the automation would never fire. If you&amp;rsquo;re still missing the trigger basics, start with &lt;a class="link" href="https://smarthome-aber-sicher.de/en/post/ha-az/01-automationen/" &gt;Home Assistant A-Z: A for Automations&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The second trick is symmetry:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;to: Werbung in SWR1&lt;/code&gt; — the radio text changes &lt;strong&gt;to&lt;/strong&gt; the marker: ads start, mute.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;from: Werbung in SWR1&lt;/code&gt; — the radio text changes &lt;strong&gt;away from&lt;/strong&gt; the marker: ads are over, audio back on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Two triggers, two IDs, one &lt;code&gt;if&lt;/code&gt;. That&amp;rsquo;s all there is to it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;span class="lnt"&gt;19
&lt;/span&gt;&lt;span class="lnt"&gt;20
&lt;/span&gt;&lt;span class="lnt"&gt;21
&lt;/span&gt;&lt;span class="lnt"&gt;22
&lt;/span&gt;&lt;span class="lnt"&gt;23
&lt;/span&gt;&lt;span class="lnt"&gt;24
&lt;/span&gt;&lt;span class="lnt"&gt;25
&lt;/span&gt;&lt;span class="lnt"&gt;26
&lt;/span&gt;&lt;span class="lnt"&gt;27
&lt;/span&gt;&lt;span class="lnt"&gt;28
&lt;/span&gt;&lt;span class="lnt"&gt;29
&lt;/span&gt;&lt;span class="lnt"&gt;30
&lt;/span&gt;&lt;span class="lnt"&gt;31
&lt;/span&gt;&lt;span class="lnt"&gt;32
&lt;/span&gt;&lt;span class="lnt"&gt;33
&lt;/span&gt;&lt;span class="lnt"&gt;34
&lt;/span&gt;&lt;span class="lnt"&gt;35
&lt;/span&gt;&lt;span class="lnt"&gt;36
&lt;/span&gt;&lt;span class="lnt"&gt;37
&lt;/span&gt;&lt;span class="lnt"&gt;38
&lt;/span&gt;&lt;span class="lnt"&gt;39
&lt;/span&gt;&lt;span class="lnt"&gt;40
&lt;/span&gt;&lt;span class="lnt"&gt;41
&lt;/span&gt;&lt;span class="lnt"&gt;42
&lt;/span&gt;&lt;span class="lnt"&gt;43
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;blueprint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Mute Sonos on Ads&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Mutes playback when the RDS stream reports an ad marker&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;automation&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;media_player&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Media Player&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;The media player entity to control&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;entity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;media_player&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;platform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;state&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;entity_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- !&lt;span class="l"&gt;input media_player&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;attribute&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;media_title&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Werbung in SWR1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;mute&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;platform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;state&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;entity_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- !&lt;span class="l"&gt;input media_player&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;attribute&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;media_title&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Werbung in SWR1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;unmute&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;if&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;trigger&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="l"&gt;mute&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;then&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;media_player.volume_mute&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;is_volume_muted&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;entity_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;!&lt;span class="l"&gt;input media_player&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="nt"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;media_player.volume_mute&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;is_volume_muted&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;entity_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;!&lt;span class="l"&gt;input media_player&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;To install it, drop the file into your Home Assistant configuration under &lt;code&gt;blueprints/automation/&amp;lt;your-name&amp;gt;/sonos_ad_mute.yaml&lt;/code&gt;, reload blueprints under &lt;strong&gt;Settings → Automations &amp;amp; Scenes → Blueprints&lt;/strong&gt;, and create automations from it. How blueprints work in general is covered in &lt;a class="link" href="https://smarthome-aber-sicher.de/en/post/ha-az/02-blueprints/" &gt;Home Assistant A-Z: B for Blueprints&lt;/a&gt;. You can also just paste the content from &lt;code&gt;trigger:&lt;/code&gt; onward as a normal automation and replace &lt;code&gt;!input media_player&lt;/code&gt; with your entity.&lt;/p&gt;
&lt;p&gt;Two notes on the code that I don&amp;rsquo;t want to withhold:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The syntax is the classic one.&lt;/strong&gt; &lt;code&gt;platform:&lt;/code&gt; and &lt;code&gt;service:&lt;/code&gt; are the older form; newer Home Assistant versions prefer &lt;code&gt;triggers:&lt;/code&gt; and &lt;code&gt;actions:&lt;/code&gt;. The old form still works, and since this is my blueprint running in production, I&amp;rsquo;m showing it exactly as it sits on my system.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The &lt;code&gt;else&lt;/code&gt; branch is deliberately simple — and exactly for that reason a dead end.&lt;/strong&gt; It unmutes on every trigger that isn&amp;rsquo;t &lt;code&gt;mute&lt;/code&gt;. With exactly two triggers, that&amp;rsquo;s clean. As soon as you add a third, it unmutes too, and you get a bug that takes a while to find. Anyone extending this should turn the &lt;code&gt;if/else&lt;/code&gt; into a &lt;code&gt;choose&lt;/code&gt; beforehand. I collect this kind of pitfall in &lt;a class="link" href="https://smarthome-aber-sicher.de/en/post/ha-5-automation-fehler/" &gt;5 Automation Mistakes Everyone Makes in Home Assistant&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="if-your-station-isnt-quite-so-unambiguous"&gt;If your station isn&amp;rsquo;t quite so unambiguous
&lt;/h2&gt;&lt;p&gt;For SWR1, the text is always identical, so an exact comparison is enough. If your station sends varying text — say, with an appended timestamp or changing wording — you need a trigger that checks for a text fragment instead of the whole string:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;span class="lnt"&gt;7
&lt;/span&gt;&lt;span class="lnt"&gt;8
&lt;/span&gt;&lt;span class="lnt"&gt;9
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;trigger&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;platform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;template&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;value_template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="sd"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; {{ &amp;#39;Werbung&amp;#39; in (state_attr(&amp;#39;media_player.bathroom&amp;#39;, &amp;#39;media_title&amp;#39;) or &amp;#39;&amp;#39;) }}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;mute&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- &lt;span class="nt"&gt;platform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;template&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;value_template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="sd"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt; {{ &amp;#39;Werbung&amp;#39; not in (state_attr(&amp;#39;media_player.bathroom&amp;#39;, &amp;#39;media_title&amp;#39;) or &amp;#39;&amp;#39;) }}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;unmute&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; this variant is &lt;em&gt;not&lt;/em&gt; running for me — I don&amp;rsquo;t need it. It&amp;rsquo;s the obvious path, but untested. If you build it, check especially that the word doesn&amp;rsquo;t accidentally show up in song titles or programme announcements too. Otherwise your radio happily mutes itself during a segment about advertising agencies.&lt;/p&gt;
&lt;h2 id="one-automation-per-speaker"&gt;One automation per speaker
&lt;/h2&gt;&lt;p&gt;The blueprint is instantiated five times for me — once per room:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Room&lt;/th&gt;
&lt;th&gt;Entity&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Office&lt;/td&gt;
&lt;td&gt;&lt;code&gt;media_player.office&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bedroom&lt;/td&gt;
&lt;td&gt;&lt;code&gt;media_player.bedroom&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bathroom&lt;/td&gt;
&lt;td&gt;&lt;code&gt;media_player.bathroom&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Living room&lt;/td&gt;
&lt;td&gt;&lt;code&gt;media_player.living_room&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Terrace&lt;/td&gt;
&lt;td&gt;&lt;code&gt;media_player.terrace&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Looks like unnecessary copy-paste, but it&amp;rsquo;s necessary: &lt;strong&gt;on Sonos, muting is a property of the individual speaker.&lt;/strong&gt; Even when several speakers are grouped together, each one has to be muted separately. Which is exactly what a blueprint is for — click five times, pick an entity five times, done. What else those five speakers draw in standby power, and how I switch them off at night, is covered in &lt;a class="link" href="https://smarthome-aber-sicher.de/en/post/5-energiespar-tipps/" &gt;5 Smart Home Automations: Saving Power with Home Assistant&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="ten-days-of-recording-what-does-it-actually-do"&gt;Ten days of recording: what does it actually do?
&lt;/h2&gt;&lt;p&gt;An automation like this quietly runs in the background, and after a few weeks you no longer notice whether it&amp;rsquo;s actually doing anything. So I evaluated my Home Assistant database, period &lt;strong&gt;August 17–27, 2026&lt;/strong&gt;, i.e. ten days.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Result: 73 detected ad blocks — and the automation has worked reliably since it was set up.&lt;/strong&gt; Not a single case where the marker was in the radio text and the mute didn&amp;rsquo;t fire.&lt;/p&gt;
&lt;p&gt;Nearly all triggers cluster between 6 and 9 a.m.:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hour&lt;/th&gt;
&lt;th&gt;Ad blocks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;06:00&lt;/td&gt;
&lt;td&gt;44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;07:00&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;08:00&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12:00&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13:00&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;18:00&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Before you conclude that SWR1 airs particularly heavy morning advertising: these numbers don&amp;rsquo;t show that. They only show when I have the radio on — almost exclusively in the morning, as an alarm and breakfast companion. I have no data on how many hours I listen at which time of day, and without that denominator, the distribution isn&amp;rsquo;t evidence of ad timing, just a picture of my listening habits. What the numbers do show: whenever the radio is on, the automation fires reliably.&lt;/p&gt;
&lt;p&gt;On block length: for 31 blocks a clean end could be measured, 30 of which fell within a plausible range.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Median: 117 seconds&lt;/strong&gt; — just under two minutes per ad block&lt;/li&gt;
&lt;li&gt;Mean: 97 seconds&lt;/li&gt;
&lt;li&gt;Range: 17 to 150 seconds&lt;/li&gt;
&lt;li&gt;Sum of these 30 blocks: roughly &lt;strong&gt;49 minutes of silence over ten days&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Scaling the median up to all 73 blocks lands around two hours — but that&amp;rsquo;s an estimate, not a measurement, so I&amp;rsquo;d rather quote the 49 minutes that actually show up in the data.&lt;/p&gt;
&lt;p&gt;One quirk from the evaluation I&amp;rsquo;m keeping: one block clocked in at 2216 seconds, over 36 minutes. No ad block is that long. What actually happened: the speaker was switched off mid-ad, the radio text stayed put, and the end was only registered the next time it was switched on. Not a bug in the automation, but a good example of why you shouldn&amp;rsquo;t dump raw recorder data into a statistic unfiltered.&lt;/p&gt;
&lt;h2 id="where-the-limits-are"&gt;Where the limits are
&lt;/h2&gt;&lt;p&gt;So you know what you&amp;rsquo;re signing up for — five real limitations:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. The marker is hard-coded and station-specific.&lt;/strong&gt; &lt;code&gt;Werbung in SWR1&lt;/code&gt; applies to SWR1 Baden-Württemberg and nowhere else. Whether other SWR stations use the same text, I haven&amp;rsquo;t tested. That&amp;rsquo;s why the observation step above comes so early: it&amp;rsquo;s the actual work of rebuilding this.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. It mutes, it doesn&amp;rsquo;t skip.&lt;/strong&gt; The ad time keeps running, it&amp;rsquo;s just silent. On a live stream there&amp;rsquo;s no other way — there&amp;rsquo;s nothing to skip to.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Only radio streams with metadata.&lt;/strong&gt; Spotify, music from your own library, or line-in have no such field. The whole approach depends entirely on a station voluntarily sending something.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. One automation per speaker&lt;/strong&gt;, as above.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. The automation is in charge of the mute.&lt;/strong&gt; If you mute your speaker yourself for your own reasons and an ad block ends during that time, the automation lifts your mute. That happens rarely and doesn&amp;rsquo;t really hurt, but the interaction isn&amp;rsquo;t thought through.&lt;/p&gt;
&lt;p&gt;And one number I checked with a stopwatch instead of estimating: latency. How many seconds of ads get through before the audio drops depends on how quickly the speaker updates the stream metadata and the integration passes the event on. For me that&amp;rsquo;s on average &lt;strong&gt;one to two seconds&lt;/strong&gt; — the ad jingle is just barely audible, then it&amp;rsquo;s quiet.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;The appeal of this automation isn&amp;rsquo;t the automation itself. It&amp;rsquo;s trivial: two triggers, one branch, two lines of action.&lt;/p&gt;
&lt;p&gt;The appeal is that a problem that sounds like it needs machine learning and audio analysis dissolves into thin air the moment you look in the right place. The information was there the whole time. It just sat in a field nobody looks at.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s a pattern that works more often in smart homes than you&amp;rsquo;d think: before you start detecting something, check whether someone is already telling you. Entity attributes are an underrated goldmine for this — and the fact that Home Assistant can trigger on them directly makes them immediately usable.&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s in your &lt;code&gt;media_title&lt;/code&gt; when your station plays ads? Tell me in the comments — I&amp;rsquo;m curious which stations else deliver this.&lt;/p&gt;</description></item></channel></rss>