<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sepehr</title>
    <description>The latest articles on DEV Community by Sepehr (@sabbagh-pour).</description>
    <link>https://dev.to/sabbagh-pour</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4005123%2F6c00072d-81f8-49b5-a4fe-ac5957624e66.png</url>
      <title>DEV Community: Sepehr</title>
      <link>https://dev.to/sabbagh-pour</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sabbagh-pour"/>
    <language>en</language>
    <item>
      <title>I hooked up Trading212 to Home Assistant and now Alexa tells me if I'm up or down every morning</title>
      <dc:creator>Sepehr</dc:creator>
      <pubDate>Sat, 27 Jun 2026 09:47:27 +0000</pubDate>
      <link>https://dev.to/sabbagh-pour/i-hooked-up-trading212-to-home-assistant-and-now-alexa-tells-me-if-im-up-or-down-every-morning-230m</link>
      <guid>https://dev.to/sabbagh-pour/i-hooked-up-trading212-to-home-assistant-and-now-alexa-tells-me-if-im-up-or-down-every-morning-230m</guid>
      <description>&lt;p&gt;I've been using Home Assistant for a few years and Trading212 for longer than that. It was inevitable these two things would end up connected.&lt;/p&gt;

&lt;p&gt;The Trading212 API is surprisingly good — portfolio value, individual positions, pies, dividends, all there. So I wrote a custom integration to pull it all into HA as sensors, then a Lovelace card to make it actually look decent on a dashboard rather than a wall of entity rows.&lt;/p&gt;

&lt;p&gt;The card does zero-config auto-discovery which was the bit I spent the most time on. You drop it on a dashboard and it finds your sensors automatically — no copying entity IDs, no manual config unless you want it. Five card types: portfolio overview with a sparkline, scrollable positions list, pies with goal progress, and a combined one if you want everything in one card.&lt;/p&gt;

&lt;p&gt;The sparkline was fiddly. HA's recorder only writes state changes, not regular samples, so if your portfolio value is flat between polls the chart has gaps. Had to smooth over those client-side.&lt;/p&gt;

&lt;p&gt;The part I use most though is the automations. Every weekday at 8am Alexa tells me where I stand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;notify.alexa_media_kitchen&lt;/span&gt;
    &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="s"&gt;Portfolio is worth &lt;/span&gt;
        &lt;span class="s"&gt;{{ states('sensor.trading212_total_value') | float | round(0) | int }} pounds. &lt;/span&gt;
        &lt;span class="s"&gt;Today you are &lt;/span&gt;
        &lt;span class="s"&gt;{% if states('sensor.trading212_pnl_today') | float &amp;gt;= 0 %}up{% else %}down{% endif %} &lt;/span&gt;
        &lt;span class="s"&gt;{{ states('sensor.trading212_pnl_today') | float | abs | round(2) }} pounds.&lt;/span&gt;
      &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And Friday at 6pm I get the weekly version with P&amp;amp;L for the week and which position moved the most. I like that it just &lt;em&gt;tells&lt;/em&gt; me — if the market's had a bad week I'd probably avoid opening the app, but Alexa doesn't give me the option to ignore it.&lt;/p&gt;

&lt;p&gt;Both the integration and the card are on GitHub. The card is in HACS as a custom repo while it waits for default catalogue approval:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://github.com/Smart-Home-Assistant-UK/lovelace-trading212-card&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I wrote up the full setup with all the automation YAML here if you want to copy the whole thing: &lt;a href="https://smarthomeassistant.co.uk/articles/home-automation/trading212-home-assistant-dashboard" rel="noopener noreferrer"&gt;full guide on smarthomeassistant.co.uk&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyone else doing anything interesting with broker APIs and home automation? Curious if anyone's got alerts wired up to physical things — lights, displays, that kind of thing.&lt;/p&gt;

</description>
      <category>homeassistant</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
