Add HA dashboard, configuration template and update README

This commit is contained in:
MrSossidge 2026-05-18 14:39:07 +01:00
parent 35d37e1fe8
commit cd534c4d0b
3 changed files with 183 additions and 1 deletions

View File

@ -194,3 +194,40 @@ Managed automatically by PlatformIO:
## Licence
MIT
---
## Home Assistant Dashboard
A ready-made dashboard card is included in `home-assistant/dashboard.yaml`.
Requires these HACS frontend plugins:
- [Mushroom](https://github.com/piitaya/lovelace-mushroom)
- [Mini Graph Card](https://github.com/kalkih/mini-graph-card)
To use: **Dashboard → Edit → Add Card → Manual** and paste the contents.
## Template Sensors
Optional calculated sensors are in `home-assistant/configuration_template.yaml`:
- **Garage Net Battery Power** — battery current × voltage in watts (positive = charging)
- **Garage Battery Status** — Charging / Discharging / Idle text sensor
Add the `template:` block to your `configuration.yaml` and reload YAML.
## Project Structure
```
├── home-assistant/
│ ├── dashboard.yaml # Ready-made HA dashboard card
│ └── configuration_template.yaml # Optional template sensors
├── include/
│ ├── config.h # Your config (excluded from git)
│ ├── example.config.h # Template — copy to config.h
│ └── victron_ble.h # BLE parser header
├── src/
│ ├── main.cpp # Main firmware
│ └── victron_ble.cpp # AES decryption and parser
└── platformio.ini # PlatformIO build config
```

View File

@ -0,0 +1,32 @@
# ─────────────────────────────────────────────────────────────
# Victron SmartSolar MPPT — Home Assistant configuration.yaml
#
# Add the template section below to your configuration.yaml
# to create calculated sensors from the MPPT data.
#
# The MQTT sensors are created automatically via discovery —
# no manual MQTT config needed.
# ─────────────────────────────────────────────────────────────
template:
- sensor:
# Net power in/out of battery (positive = charging, negative = discharging)
- name: "Garage Net Battery Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: >
{{ (states('sensor.victron_smartsolar_mppt_battery_current') | float *
states('sensor.victron_smartsolar_mppt_battery_voltage') | float) | round(1) }}
# Simple charging status text
- name: "Garage Battery Status"
state: >
{% set current = states('sensor.victron_smartsolar_mppt_battery_current') | float %}
{% if current > 0.1 %}
Charging
{% elif current < -0.1 %}
Discharging
{% else %}
Idle
{% endif %}

113
dashboard.yaml Normal file
View File

@ -0,0 +1,113 @@
# ─────────────────────────────────────────────────────────────
# Victron SmartSolar MPPT — Home Assistant Dashboard
#
# Requires:
# - custom:mushroom-entity-card (HACS → Mushroom)
# - custom:mushroom-title-card (HACS → Mushroom)
# - custom:mini-graph-card (HACS → Mini Graph Card)
#
# To use: Dashboard → Edit → Add Card → Manual → paste this YAML
# ─────────────────────────────────────────────────────────────
type: vertical-stack
cards:
- type: custom:mushroom-title-card
title: ⚡ Garage Solar
subtitle: Victron MPPT Monitor
- type: custom:mushroom-title-card
title: Power Overview
subtitle: Solar generation and battery status
- type: horizontal-stack
cards:
- type: custom:mushroom-entity-card
entity: sensor.victron_smartsolar_mppt_pv_power
name: Solar In
icon: mdi:solar-power
primary_info: name
secondary_info: state
- type: custom:mushroom-entity-card
entity: sensor.garage_net_battery_power
name: Net Battery
icon: mdi:battery-charging
primary_info: name
secondary_info: state
- type: custom:mushroom-entity-card
entity: sensor.garage_battery_status
name: Status
icon: mdi:battery
primary_info: name
secondary_info: state
- type: custom:mini-graph-card
entities:
- entity: sensor.victron_smartsolar_mppt_pv_power
name: Solar
color: '#f5a623'
- entity: sensor.victron_smartsolar_mppt_external_load_power
name: Load
color: '#e74c3c'
- entity: sensor.victron_smartsolar_mppt_battery_voltage
name: Battery V
y_axis: secondary
color: '#2ecc71'
name: Power History (24h)
hours_to_show: 24
points_per_hour: 6
line_width: 2
fill: fade
show:
labels: true
points: false
legend: true
- type: horizontal-stack
cards:
- type: custom:mushroom-entity-card
entity: sensor.victron_smartsolar_mppt_battery_voltage
name: Voltage
icon: mdi:lightning-bolt
primary_info: name
secondary_info: state
- type: custom:mushroom-entity-card
entity: sensor.victron_smartsolar_mppt_battery_current
name: Current
icon: mdi:current-dc
primary_info: name
secondary_info: state
- type: custom:mushroom-entity-card
entity: sensor.victron_smartsolar_mppt_yield_today
name: Yield Today
icon: mdi:weather-sunny
primary_info: name
secondary_info: state
- type: horizontal-stack
cards:
- type: custom:mushroom-entity-card
entity: sensor.victron_smartsolar_mppt_external_load
name: Load Current
icon: mdi:current-ac
primary_info: name
secondary_info: state
- type: custom:mushroom-entity-card
entity: sensor.victron_smartsolar_mppt_external_load_power
name: Load Power
icon: mdi:lightning-bolt
primary_info: name
secondary_info: state
- type: horizontal-stack
cards:
- type: custom:mushroom-entity-card
entity: sensor.victron_smartsolar_mppt_charge_state
name: Charge State
icon: mdi:ev-station
primary_info: name
secondary_info: state
- type: custom:mushroom-entity-card
entity: sensor.victron_smartsolar_mppt_error_code
name: Error Code
icon: mdi:alert-circle
primary_info: name
secondary_info: state