Trading212를 Home Assistant에 연결했는데 이제 Alexa가 매일 아침 일어나는지 내리는지 알려줍니다.

작성자

카테고리:

← 피드로
DEV Community · Sepehr · 2026-06-27 개발(SW)

Sepehr

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.

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.

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.

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.

The part I use most though is the automations. Every weekday at 8am Alexa tells me where I stand:

action:
  - action: notify.alexa_media_kitchen
    data:
      message: >
        Portfolio is worth 
        {{ states('sensor.trading212_total_value') | float | round(0) | int }} pounds. 
        Today you are 
        {% if states('sensor.trading212_pnl_today') | float >= 0 %}up{% else %}down{% endif %} 
        {{ states('sensor.trading212_pnl_today') | float | abs | round(2) }} pounds.
      data:
        type: tts

Enter fullscreen mode Exit fullscreen mode

And Friday at 6pm I get the weekly version with P&L for the week and which position moved the most. I like that it just tells 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.

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:

https://github.com/Smart-Home-Assistant-UK/lovelace-trading212-card

I wrote up the full setup with all the automation YAML here if you want to copy the whole thing: full guide on smarthomeassistant.co.uk

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.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다