f
freude
Automation

Home Assistant

A long-running setup that leans on YAML automations, Jinja2 templating, and a fair amount of CSS to make the dashboards look less like a spreadsheet.

YAML Jinja2 card_mod Telegram ApexCharts Blueprints

Dashboards with card_mod

Default Lovelace cards are fine, but card_mod gets dashboards closer to how they should look — custom styling on entity, tile, gauge and horizontal-stack cards rather than accepting the defaults.

Gotcha: card_mod on a horizontal-stack has to be applied to each child card individually — styling the stack itself does nothing. Some tile-card shadow-DOM styling is still easier with the browser dev tools open than guessed blind.
card_mod:
  style: |
    ha-card {
      border-radius: 14px;
      background: rgba(20, 24, 34, 0.9);
    }

Automations & notifications

Most automations are plain YAML with Jinja2 templates doing the formatting — ordinal date suffixes, friendly names for zones, that kind of thing — and a Telegram bot for anything that deserves an immediate ping: alarm zone activity, battery state-of-charge, and the odd database-size alert when something's growing faster than expected.

- alias: Telegram – Zone Alert
  trigger:
    - platform: state
      entity_id: binary_sensor.alarm_zone_1
      to: "on"
  action:
    - service: telegram_bot.send_message
      data:
        message: >-
          {{ zone_names[trigger.entity_id] }} triggered at
          {{ now().strftime('%H:%M') }}

Energy & battery monitoring

A solar/battery inverter integration feeds ApexCharts for the day-to-day graphs, alongside speedtest monitoring for the network side of things. The more interesting work has been in the automations around charge scheduling — getting AC-charge rate, discharge rate and time windows all pulling in the same direction rather than fighting each other.

Lesson learned: Home Assistant's logbook timestamps are UTC, while some third-party inverter exports and schedule entities report local time. Worth converting explicitly before trusting a timeline that spans both.