Home Assistant i FoxESS Modbus: integracja i panel energii (cz. 2)
Jak dodać integrację FoxESS Modbus w Home Assistant, sprawdzić połączenie, poznać kluczowe encje i wdrożyć gotowe panele energii w Mushroom oraz apexcharts.

To druga część serii o podłączeniu falownika hybrydowego FoxESS do Home Assistant. Zakłada, że komunikacja fizyczna już działa: falownik rozmawia po Modbus RTU (RS485), a most na ESP32 udostępnia Modbus TCP w sieci LAN. Tutaj dodasz integrację FoxESS Modbus, sprawdzisz, czy dane docierają, poznasz najważniejsze encje i zbudujesz gotowe panele energii (od minimalistycznego po rozbudowany).
Integracja falownika daje duże możliwości sterowania produkcją, sprzedażą i magazynowaniem energii z instalacji PV. Pomaga też zwiększyć autokonsumpcję, zwłaszcza przy rozliczeniu net billing według cen giełdowych. Przykłady dotyczą falownika FoxESS H3.
Wymagania przed startem
- działające połączenie falownika z siecią: RS485 plus ESP32 jako most Modbus TCP (opisane w poprzedniej części serii) albo inny konwerter RS485 na LAN,
- znany adres IP mostu, Device ID falownika (zazwyczaj 247), port (502) i prędkość transmisji (zazwyczaj 9600),
- zainstalowany HACS w Home Assistant,
- do paneli: karta Mushroom, a dla wersji rozbudowanej także karty apexcharts-card, stack-in-card i card_mod oraz sensor cen RCE.
Jak to działa
- Falownik komunikuje się przez Modbus RTU (RS485).
- ESP32 działa jak most i zamienia tę komunikację na Modbus TCP.
- Home Assistant łączy się z ESP32 przez sieć LAN.
Dzięki temu możesz odczytywać dane i sterować falownikiem bez bezpośredniego połączenia RS485 z serwerem. Integrację instaluje się przez HACS z repozytorium: https://github.com/nathanmarlor/foxess_modbus.
Dodawanie integracji krok po kroku
- Po instalacji przez HACS przejdź do Ustawienia → Urządzenia i usługi → Dodaj integrację i wyszukaj FoxESS - Modbus.
- Jako typ połączenia wybierz Ethernet to Modbus/RS485 Adapter.
- W kolejnym kroku ustaw
adapter_modelna other. - Jako protokół wybierz Modbus TCP i wpisz adres IP swojego ESP32. Pozostałe ustawienia możesz zostawić domyślne.
- Jeśli wszystko jest poprawne, zobaczysz listę encji falownika.
Encji jest bardzo dużo. Posłużą do skonfigurowania panelu energii i budowy automatyzacji, do których wracamy w kolejnych częściach.
Jak sprawdzić, czy integracja działa
- po dodaniu integracji pojawia się lista encji,
- wartości takie jak moc, energia czy SOC baterii zmieniają się w czasie,
- encja
Connection Statusma wartość Connected.
Jeśli widzisz aktualizujące się wartości, integracja działa poprawnie.
Najważniejsze encje na początek
Produkcja PV
sensor.foxess_modbus_solar_energy_today- dzienna produkcja,sensor.foxess_modbus_solar_energy_total- całkowita produkcja,sensor.foxess_modbus_pv1_power- aktualna moc PV,sensor.pv_power_foxess_modbus- sumaryczna moc PV.
Bateria
sensor.foxess_modbus_battery_soc- stan baterii (SOC),sensor.foxess_modbus_battery_charge_today- ładowanie dziś,sensor.foxess_modbus_battery_discharge_today- rozładowanie dziś,sensor.foxess_modbus_battery_temp- temperatura baterii.
Zużycie energii
sensor.foxess_modbus_load_power_total- całkowite zużycie,sensor.foxess_modbus_load_energy_today- zużycie dzienne.
Sieć (import i eksport)
sensor.foxess_modbus_feed_in_energy_today- eksport do sieci,sensor.foxess_modbus_grid_consumption_energy_today- pobór z sieci,sensor.foxess_modbus_grid_consumption_energy_total- całkowity pobór.
Falownik i status
sensor.foxess_modbus_invbatpower- moc baterii,sensor.foxess_modbus_inverter_fault_code- błędy falownika,sensor.foxess_modbus_connection_status- status połączenia.
Najczęstsze problemy i ich rozwiązania
| Objaw | Co sprawdzić |
|---|---|
| Brak komunikacji | Zamień przewody A i B. |
| Connection Status = Disconnected | Sprawdź adres IP i port (502). |
| Brak encji | Sprawdź Device ID (zazwyczaj 247). |
| Brak danych mimo połączenia | Sprawdź wspólną masę (GND). |
| Błędy lub timeout | Sprawdź baud rate (zazwyczaj 9600). |
Pomaga też zasada diagnozowania od dołu: najpierw okablowanie i parametry transmisji, potem sieć i adres mostu, na końcu konfiguracja integracji w Home Assistant.
Gotowy panel energii (Mushroom)
Po dodaniu integracji możesz od razu zbudować czytelny panel. Poniżej dwa gotowe przykłady: wersja rozbudowana i minimalistyczna. Pokazują one:
- pobór energii z sieci (import),
- wysyłkę energii do sieci (eksport),
- stan baterii (SOC),
- aktualną produkcję PV.
Wymagana jest zainstalowana w Home Assistant karta Mushroom. Zwróć uwagę na jednostki: wartości mocy w kartach są podpisane ręcznie (w jednym przykładzie kW, w drugim W), więc dopasuj opis do jednostki, w jakiej sensor faktycznie podaje wynik.
Wersja rozbudowana - kod panelu (Lovelace YAML)
type: vertical-stack
cards:
- type: custom:mushroom-title-card
title: Energy Control Panel
subtitle: FoxESS Modbus
- type: grid
columns: 2
square: false
cards:
- type: custom:mushroom-template-card
primary: Grid Import
secondary: "{{ states('sensor.foxess_modbus_grid_consumption_energy_today') }} kWh"
icon: mdi:transmission-tower-import
icon_color: red
layout: vertical
- type: custom:mushroom-template-card
primary: Grid Export
secondary: "{{ states('sensor.foxess_modbus_feed_in_energy_today') }} kWh"
icon: mdi:transmission-tower-export
icon_color: green
layout: vertical
- type: custom:mushroom-template-card
primary: Battery
secondary: "{{ states('sensor.foxess_modbus_battery_soc') }} %"
icon: mdi:battery
layout: vertical
- type: custom:mushroom-template-card
primary: PV Power
secondary: "{{ states('sensor.pv_power_foxess_modbus') }} kW"
icon: mdi:solar-power
icon_color: yellow
layout: vertical
- type: grid
columns: 2
square: false
cards:
- type: custom:mushroom-template-card
primary: PV Today
secondary: "{{ states('sensor.foxess_modbus_solar_energy_today') }} kWh"
icon: mdi:weather-sunny
- type: custom:mushroom-template-card
primary: Battery Power
secondary: "{{ states('sensor.foxess_modbus_invbatpower') }} kW"
icon: mdi:battery-charging
- type: custom:mushroom-template-card
primary: Battery Temp
secondary: "{{ states('sensor.foxess_modbus_battery_temp') }} °C"
icon: mdi:thermometer
- type: custom:mushroom-template-card
primary: Load Today
secondary: "{{ states('sensor.foxess_modbus_load_energy_today') }} kWh"
icon: mdi:home
- type: custom:mushroom-entity-card
entity: select.foxess_modbus_work_mode
name: Work Mode
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_connection_status
name: Status
Wersja minimalistyczna - kod panelu
Ta wersja korzysta dodatkowo z kart stack-in-card i card_mod.
type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: "Moc PV: {{ states('sensor.pv_power_foxess_modbus') }} W"
secondary: >
Dziś: {{ states('sensor.foxess_modbus_solar_energy_today') }} kWh |
Bateria: {{ states('sensor.foxess_modbus_battery_soc') }}%
icon: mdi:solar-panel-large
icon_color: orange
layout: vertical
card_mod:
style: |
ha-card {
--main-align: center;
--secondary-align: center;
border: none;
background: rgba(255, 165, 0, 0.05);
}
- type: grid
columns: 2
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_grid_consumption_energy_today
name: Pobór sieć
icon_color: red
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_feed_in_energy_today
name: Wysyłka
icon_color: blue
Jak dodać panel
- Przejdź do Home Assistant → Dashboard.
- Kliknij Edytuj dashboard.
- Dodaj kartę ręcznie (Manual / YAML).
- Wklej wybrany kod.
Zaawansowany panel energii (widok sections)
Poniższy widok to pełniejszy panel z wykresami w czasie rzeczywistym. Zawiera m.in. wykres rynku RCE z podziałem na tanie, normalne i drogie okna, alerty (błąd falownika, utrata połączenia), wersje oprogramowania, obciążenie i moc na fazach, prąd z przekładników sieciowych (Grid CT), produkcję PV na żywo, wykresy kołowe źródeł energii, sprzedaż energii, bilans mocy i temperaturę baterii oraz napięcia faz.
Co jest potrzebne, aby panel działał
- karty niestandardowe:
apexcharts-card, Mushroom,stack-in-card, - sensor
sensor.rce_electricity_market_pricez atrybutami używanymi w kodzie (prices_today,average,min,max,cheap_mask_today) - kod zakłada ceny w układzie 15-minutowym, - sensor
sensor.pv_sprzedaz_pln_h, użyty w karcie „Sprzedaż energii PV”, który nie pochodzi z integracji FoxESS - musisz go utworzyć samodzielnie (np. jako sensor szablonowy), albo usunąć odpowiednią kartę, - encje FoxESS z prefiksem
foxess_modbus; część z nich (np. kosztowe) zależy od konfiguracji integracji, więc jeśli któraś encja nie istnieje w Twoim systemie, usuń lub podmień odpowiadającą jej kartę.
Kod widoku
views:
- title: FoxESS Premium
path: foxess-premium
icon: mdi:solar-power-variant
type: sections
max_columns: 3
sections:
- type: grid
cards:
- type: custom:apexcharts-card
update_interval: 5min
header:
show: true
title: Rynek RCE - Dzisiaj
show_states: true
colorize_states: true
standard_format: true
graph_span: 24h
span:
start: day
now:
show: true
label: Teraz
apex_config:
chart:
height: 300px
xaxis:
labels:
datetimeUTC: false
fill:
type: gradient
gradient:
type: vertical
shadeIntensity: 0.2
opacityFrom: 0.85
opacityTo: 0.3
stops:
- 0
- 90
- 100
plotOptions:
bar:
borderRadius: 4
columnWidth: 80%
stroke:
show: true
width: 1
colors:
- transparent
series:
- entity: sensor.rce_electricity_market_price
name: Minimalna
show:
in_chart: false
in_header: true
legend_value: false
transform: return entity.attributes.min;
- entity: sensor.rce_electricity_market_price
name: Aktualna
show:
in_chart: false
in_header: true
legend_value: false
data_generator: >
const prices = entity.attributes.prices_today;
const now = new Date();
const index = (now.getHours() * 4) +
Math.floor(now.getMinutes() / 15);
const currentPrice = prices[index];
return [[now.getTime(), currentPrice]];
- entity: sensor.rce_electricity_market_price
name: Maksymalna
show:
in_chart: false
in_header: true
legend_value: false
transform: return entity.attributes.max;
- entity: sensor.rce_electricity_market_price
name: Cena aktualna
type: area
color: '#2196f3'
stroke_width: 2
show:
extremas: false
datalabels: false
in_header: false
hidden_by_default: true
data_generator: >
return entity.attributes.prices_today.map((p, i) => [new
Date().setHours(0,0,0,0) + (i * 15 * 60 * 1000), p]);
- entity: sensor.rce_electricity_market_price
name: Średnia
type: line
color: '#9e9e9e'
stroke_width: 2
show:
legend_value: true
data_generator: >
const avg = entity.attributes.average; return
entity.attributes.prices_today.map((_, i) => [new
Date().setHours(0,0,0,0) + (i * 15 * 60 * 1000), avg]);
- entity: sensor.rce_electricity_market_price
name: 'Drogo '
type: column
color: '#e53935'
show:
in_header: false
legend_value: false
data_generator: |
const prices = entity.attributes.prices_today;
const avg = entity.attributes.average;
const mask = entity.attributes.cheap_mask_today;
return prices.map((p, i) => {
const isCheap = String(mask[i]).toLowerCase() === 'true';
return [new Date().setHours(0,0,0,0) + (i * 15 * 60 * 1000), (p > avg && !isCheap) ? p : 0];
});
- entity: sensor.rce_electricity_market_price
name: 'Normalnie '
type: column
color: '#2196f3'
show:
in_header: false
legend_value: false
data_generator: |
const prices = entity.attributes.prices_today;
const avg = entity.attributes.average;
const mask = entity.attributes.cheap_mask_today;
return prices.map((p, i) => {
const isCheap = String(mask[i]).toLowerCase() === 'true';
return [new Date().setHours(0,0,0,0) + (i * 15 * 60 * 1000), (p <= avg && !isCheap) ? p : 0];
});
- entity: sensor.rce_electricity_market_price
name: 'Tanie okno '
type: column
color: '#4caf50'
show:
in_header: false
legend_value: false
data_generator: |
const prices = entity.attributes.prices_today;
const mask = entity.attributes.cheap_mask_today;
return prices.map((p, i) => {
const isCheap = String(mask[i]).toLowerCase() === 'true';
return [new Date().setHours(0,0,0,0) + (i * 15 * 60 * 1000), isCheap ? p : 0];
});
- type: heading
heading: Alerty i status
- type: conditional
conditions:
- entity: sensor.foxess_modbus_inverter_fault_code
state_not: None
card:
type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_inverter_fault_code
name: Alarm falownika
icon: mdi:alert-octagon
icon_color: red
- type: conditional
conditions:
- entity: sensor.foxess_modbus_connection_status
state_not: Connected
card:
type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_connection_status
name: Status połączenia
icon: mdi:wifi-alert
icon_color: red
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: WERSJE SYSTEMU
secondary: >-
Manager: {{ states('sensor.foxess_modbus_manager_version') }}
| Master: {{ states('sensor.foxess_modbus_master_version') }}
| Slave: {{ states('sensor.foxess_modbus_slave_version') }}
icon: mdi:chip
icon_color: indigo
- type: grid
columns: 3
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_manager_version
name: Manager
icon: mdi:chip
icon_color: blue
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_master_version
name: Master
icon: mdi:memory
icon_color: green
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_slave_version
name: Slave
icon: mdi:integrated-circuit-chip
icon_color: orange
- type: custom:stack-in-card
cards:
- type: custom:apexcharts-card
header:
show: true
title: Obciążenie fazowe live
graph_span: 30m
update_interval: 10s
yaxis:
- decimals: 2
min: auto
series:
- entity: sensor.foxess_modbus_load_power_r
name: Faza R
color: '#ef4444'
type: line
float_precision: 2
group_by:
func: avg
duration: 1min
- entity: sensor.foxess_modbus_load_power_s
name: Faza S
color: '#22c55e'
type: line
float_precision: 2
group_by:
func: avg
duration: 1min
- entity: sensor.foxess_modbus_load_power_t
name: Faza T
color: '#3b82f6'
type: line
float_precision: 2
group_by:
func: avg
duration: 1min
apex_config:
chart:
height: 230px
stroke:
width: 2
curve: smooth
dataLabels:
enabled: false
legend:
show: true
position: bottom
- type: custom:apexcharts-card
header:
show: true
title: Moc falownika na fazach
graph_span: 30m
update_interval: 10s
apex_config:
chart:
height: 230px
stroke:
width: 2
curve: smooth
dataLabels:
enabled: false
legend:
show: true
position: bottom
series:
- entity: sensor.foxess_modbus_inv_power_r
name: Inverter R
color: '#f97316'
type: line
group_by:
func: avg
duration: 1min
- entity: sensor.foxess_modbus_inv_power_s
name: Inverter S
color: '#14b8a6'
type: line
group_by:
func: avg
duration: 1min
- entity: sensor.foxess_modbus_inv_power_t
name: Inverter T
color: '#8b5cf6'
type: line
group_by:
func: avg
duration: 1min
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: GRID CT & ENERGY FLOW
secondary: >-
Grid total: {{
states('sensor.foxess_modbus_grid_consumption_energy_total')
}} | Feed-in total: {{
states('sensor.foxess_modbus_feed_in_energy_total') }}
icon: mdi:transmission-tower-export
icon_color: red
- type: custom:apexcharts-card
header:
show: true
title: Grid CT fazy
graph_span: 1h
update_interval: 10s
apex_config:
chart:
height: 220px
stroke:
width: 2
curve: smooth
dataLabels:
enabled: false
legend:
show: true
position: bottom
series:
- entity: sensor.foxess_modbus_grid_ct_r
name: CT R
color: '#dc2626'
type: line
group_by:
func: avg
duration: 1min
- entity: sensor.foxess_modbus_grid_ct_s
name: CT S
color: '#16a34a'
type: line
group_by:
func: avg
duration: 1min
- entity: sensor.foxess_modbus_grid_ct_t
name: CT T
color: '#2563eb'
type: line
group_by:
func: avg
duration: 1min
- type: grid
columns: 2
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_grid_consumption_energy_today
name: Grid dziś
icon: mdi:download-network
icon_color: red
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_feed_in_energy_today
name: Eksport dziś
icon: mdi:upload-network
icon_color: green
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_grid_consumption_energy_total
name: Grid total
icon: mdi:transmission-tower
icon_color: red
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_feed_in_energy_total
name: Eksport total
icon: mdi:transmission-tower-export
icon_color: green
- type: grid
cards:
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: FOXESS ENERGY OVERVIEW
secondary: >-
Status: {{ states('sensor.foxess_modbus_connection_status') }}
| Tryb: {{ states('select.foxess_modbus_work_mode') }}
icon: mdi:solar-power-variant
icon_color: amber
- type: grid
columns: 2
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.pv_power_foxess_modbus
name: PV teraz
icon: mdi:solar-power
icon_color: yellow
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_battery_soc
name: SoC
icon: mdi:battery-high
icon_color: green
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_load_energy_today
name: Dom dziś
icon: mdi:home-lightning-bolt
icon_color: blue
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_grid_consumption_energy_today_cost
name: Koszt dziś
icon: mdi:cash-minus
icon_color: red
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: LIVE PV OUTPUT
secondary: >-
PV1: {{ states('sensor.foxess_modbus_pv1_power') }} | Napięcie
PV1: {{ states('sensor.foxess_modbus_pv1_voltage') }} V
icon: mdi:weather-sunny
icon_color: yellow
- type: custom:apexcharts-card
graph_span: 3h
update_interval: 10s
header:
show: true
title: Produkcja PV na żywo
apex_config:
chart:
height: 230px
stroke:
width: 3
curve: smooth
dataLabels:
enabled: false
series:
- entity: sensor.pv_power_foxess_modbus
name: PV Power
color: '#facc15'
type: area
group_by:
func: avg
duration: 1min
- type: grid
columns: 2
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_solar_energy_today
name: PV dziś
icon: mdi:solar-power
icon_color: yellow
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_solar_energy_total
name: PV total
icon: mdi:chart-line
icon_color: amber
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: SYSTEM CONTROL & DAILY MIX
secondary: >-
Yield dziś: {{
states('sensor.foxess_modbus_total_yield_today') }} | Input
dziś: {{ states('sensor.foxess_modbus_input_energy_today') }}
icon: mdi:chart-donut
icon_color: blue
- type: custom:apexcharts-card
chart_type: donut
header:
show: true
title: Źródła energii dziś
series:
- entity: sensor.foxess_modbus_solar_energy_today
name: PV
color: '#facc15'
- entity: sensor.foxess_modbus_grid_consumption_energy_today
name: Grid
color: '#f87171'
- entity: sensor.foxess_modbus_battery_discharge_today
name: Bateria
color: '#fb923c'
- type: grid
columns: 2
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_grid_consumption_energy_today_cost
name: Koszt dziś
icon: mdi:cash-minus
icon_color: red
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_feed_in_energy_total_compensation
name: Kompensacja
icon: mdi:cash-plus
icon_color: green
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_total_yield_today
name: Yield dziś
icon: mdi:chart-line
icon_color: green
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_input_energy_today
name: Input dziś
icon: mdi:transmission-tower-import
icon_color: cyan
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: TODAY VS TOTALS
secondary: >-
Load dziś: {{ states('sensor.foxess_modbus_load_energy_today')
}} | Solar total: {{
states('sensor.foxess_modbus_solar_energy_total') }}
icon: mdi:chart-box
icon_color: purple
- type: custom:apexcharts-card
chart_type: donut
header:
show: true
title: Statystyki całkowite
series:
- entity: sensor.foxess_modbus_solar_energy_total
name: Solar Total
color: '#eab308'
- entity: sensor.foxess_modbus_grid_consumption_energy_total
name: Grid Total
color: '#ef4444'
- entity: sensor.foxess_modbus_feed_in_energy_total
name: Feed-in Total
color: '#3b82f6'
- entity: sensor.foxess_modbus_battery_charge_total
name: Charge Total
color: '#14b8a6'
- entity: sensor.foxess_modbus_battery_discharge_total
name: Discharge Total
color: '#f97316'
- type: grid
columns: 2
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_solar_energy_total
name: Solar total
icon: mdi:solar-power
icon_color: yellow
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_total_yield_total
name: Yield total
icon: mdi:chart-line
icon_color: green
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_battery_charge_total
name: Charge total
icon: mdi:battery-plus
icon_color: teal
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_battery_discharge_total
name: Discharge total
icon: mdi:battery-minus
icon_color: orange
- type: grid
cards:
- type: custom:apexcharts-card
header:
show: true
title: Sprzedaż energii PV
show_states: true
colorize_states: true
graph_span: 12h
update_interval: 5min
series:
- entity: sensor.pv_sprzedaz_pln_h
name: Przychód
type: column
color: '#00E396'
opacity: 0.8
group_by:
duration: 1h
func: max
show:
datalabels: true
apex_config:
chart:
height: 250px
toolbar:
show: false
plotOptions:
bar:
borderRadius: 6
columnWidth: 70%
fill:
type: gradient
gradient:
type: vertical
shadeIntensity: 0.1
opacityFrom: 0.8
opacityTo: 0.3
xaxis:
labels:
datetimeUTC: false
yaxis:
decimalsInFloat: 2
stroke:
show: false
grid:
borderColor: '#333'
strokeDashArray: 4
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: ENERGY STORAGE & THERMALS
secondary: >-
Bateria: {{ states('sensor.foxess_modbus_battery_temp') }}°C |
SoC min/max: {{ states('sensor.foxess_modbus_min_soc') }} / {{
states('sensor.foxess_modbus_max_soc') }}
icon: mdi:battery-high
icon_color: green
- type: custom:apexcharts-card
graph_span: 12h
header:
show: true
title: Balans Mocy Baterii
apex_config:
chart:
height: 230px
stroke:
width: 2
curve: smooth
dataLabels:
enabled: false
legend:
show: true
position: bottom
series:
- entity: sensor.foxess_modbus_battery_charge
name: Ładowanie (+)
color: '#22c55e'
type: area
group_by:
func: avg
duration: 5min
- entity: sensor.foxess_modbus_battery_discharge
name: Rozładowanie (-)
color: '#ef4444'
type: area
invert: true
group_by:
func: avg
duration: 5min
- type: grid
columns: 2
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_battery_soc
name: Poziom SoC
icon_color: green
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_battery_temp
name: Temp. baterii
icon_color: orange
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_battery_charge_today
name: Ładowanie dziś
icon: mdi:battery-plus
icon_color: green
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_battery_discharge_today
name: Rozładowanie dziś
icon: mdi:battery-minus
icon_color: red
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: BATTERY PERFORMANCE
secondary: >-
Charge total: {{
states('sensor.foxess_modbus_battery_charge_total') }} |
Discharge total: {{
states('sensor.foxess_modbus_battery_discharge_total') }}
icon: mdi:battery-charging-high
icon_color: teal
- type: custom:apexcharts-card
graph_span: 24h
header:
show: true
title: Temperatura baterii
apex_config:
chart:
height: 220px
stroke:
width: 3
curve: smooth
dataLabels:
enabled: false
series:
- entity: sensor.foxess_modbus_battery_temp
name: Battery Temp
color: '#fb923c'
type: line
group_by:
func: avg
duration: 10min
- type: grid
columns: 3
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_invbatpower
name: Moc baterii
icon: mdi:battery-sync
icon_color: cyan
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_min_soc
name: Min SoC
icon: mdi:battery-low
icon_color: orange
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_max_soc
name: Max SoC
icon: mdi:battery-high
icon_color: green
- type: custom:mushroom-select-card
entity: select.foxess_modbus_work_mode
name: Aktywny tryb pracy
icon_color: blue
- type: custom:stack-in-card
cards:
- type: custom:mushroom-template-card
primary: NAPIĘCIE FAZ (L1 / L2 / L3)
secondary: >-
R: {{ states('sensor.foxess_modbus_grid_voltage_r') }} V | S:
{{ states('sensor.foxess_modbus_grid_voltage_s') }} V | T: {{
states('sensor.foxess_modbus_grid_voltage_t') }} V
icon: mdi:flash
icon_color: yellow
- type: grid
columns: 3
square: false
cards:
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_grid_voltage_r
name: Faza R
icon: mdi:sine-wave
icon_color: red
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_grid_voltage_s
name: Faza S
icon: mdi:sine-wave
icon_color: green
- type: custom:mushroom-entity-card
entity: sensor.foxess_modbus_grid_voltage_t
name: Faza T
icon: mdi:sine-wave
icon_color: blue
- type: custom:apexcharts-card
header:
show: true
title: Napięcie faz (wykres)
graph_span: 1m
update_interval: 10s
apex_config:
chart:
height: 300px
stroke:
width: 2
curve: smooth
dataLabels:
enabled: false
legend:
show: true
position: bottom
yaxis:
min: 210
max: 260
series:
- entity: sensor.foxess_modbus_grid_voltage_r
name: Faza R
color: '#ef4444'
type: line
- entity: sensor.foxess_modbus_grid_voltage_s
name: Faza S
color: '#22c55e'
type: line
- entity: sensor.foxess_modbus_grid_voltage_t
name: Faza T
color: '#3b82f6'
type: line
Typowe błędy przy budowie paneli
- Karta „Custom element doesn't exist”. Brakuje zainstalowanej karty niestandardowej (Mushroom, apexcharts-card, stack-in-card lub card_mod) - doinstaluj ją, np. przez HACS.
- Puste wartości lub „unknown”. Nazwa encji w Twoim systemie różni się od użytej w kodzie albo integracja jest rozłączona - sprawdź listę encji w Narzędziach deweloperskich.
- Zły format wcięć. YAML jest wrażliwy na wcięcia; wklejaj kod bez zmian struktury.
- Wykres RCE bez danych. Sensor cen nie ma oczekiwanych atrybutów lub nie istnieje.
FAQ
Czy muszę mieć ESP32, żeby użyć tej integracji?
Nie. Potrzebujesz dowolnego sposobu na udostępnienie Modbus TCP, np. gotowego konwertera RS485 na LAN. ESP32 jest tylko jedną z opcji.
Jakie ustawienia wybrać w integracji?
Typ połączenia Ethernet to Modbus/RS485 Adapter, adapter_model równe other, protokół Modbus TCP oraz adres IP mostu. Resztę zostaw domyślną.
Integracja dodana, a encji brak. Co robić?
Sprawdź Device ID falownika (zwykle 247), port 502 oraz to, czy most jest widoczny w sieci i ma poprawny adres IP.
Czy mogę użyć tylko wersji minimalistycznej panelu?
Tak. Wersje są niezależne - wersja minimalistyczna wymaga jedynie Mushroom, stack-in-card i card_mod, a rozbudowany widok dodatkowo apexcharts-card oraz sensora cen RCE.
Podsumowanie i następne kroki
Masz już działającą integrację FoxESS Modbus w Home Assistant, listę kluczowych encji oraz gotowe panele energii. Kolejny krok to automatyzacja: ładowanie baterii przy taniej energii oraz sterowanie zużyciem (np. bojlerem) w zależności od cen prądu. Warto też zapoznać się z poradnikami o bezpośrednim odczycie rejestrów przez ESPHome oraz o podłączeniu innych modeli FoxESS bez osobnego konwertera RS485.


