diff --git a/ha-configs/solcast_automations_g12w_v7_soc_fix.yaml b/ha-configs/solcast_automations_g12w_v7_soc_fix.yaml new file mode 100644 index 0000000..4c90d72 --- /dev/null +++ b/ha-configs/solcast_automations_g12w_v7_soc_fix.yaml @@ -0,0 +1,303 @@ +# ============================================ +# SOLCAST + TARYFA G12W +# Inteligentne ładowanie baterii +# Żarki, 5.0 kWp +# +# WAŻNE: Program 1 musi być 00:00 (nie 22:00!) +# Deye nie rozpoznaje 22:00 jako aktywnego o północy +# ============================================ + +- alias: "Solcast - Raport poranny" + description: "Dzienny raport o 7:00" + trigger: + - platform: time + at: "07:00:00" + action: + - service: notify.persistent_notification + data: + title: "☀️ Prognoza PV" + message: | + Dziś: {{ states('sensor.solcast_pv_forecast_prognoza_na_dzisiaj') }} kWh + Jutro: {{ states('sensor.solcast_pv_forecast_prognoza_na_jutro') }} kWh + Bateria: {{ states('sensor.inverter_deye_battery') }}% + +# ============================================ +# DNI POWSZEDNIE (Pn-Pt) +# Ładowanie: 00:00-06:00 (taryfa nocna G12W) +# ============================================ + +- alias: "Solcast G12W - Bardzo pochmurnie (Pn-Pt)" + description: "Maksymalne ładowanie gdy < 3 kWh" + trigger: + - platform: time + at: "21:30:00" + condition: + - condition: time + weekday: [mon, tue, wed, thu, fri] + - condition: numeric_state + entity_id: sensor.solcast_pv_forecast_prognoza_na_jutro + below: 3 + - condition: numeric_state + entity_id: sensor.inverter_deye_battery + below: 95 + action: + - service: switch.turn_on + target: + entity_id: switch.inverter_deye_battery_grid_charging + + # Program 1: Ładowanie od 00:00 (północ!) + - service: select.select_option + target: + entity_id: select.inverter_deye_program_1_charging + data: + option: "Grid" + - service: time.set_value + target: + entity_id: time.inverter_deye_program_1_time + data: + time: "00:00:00" + - service: number.set_value + target: + entity_id: number.inverter_deye_program_1_soc + data: + value: 100 + + # Program 2: Stop o 06:00, rozładowanie do 15% + - service: select.select_option + target: + entity_id: select.inverter_deye_program_2_charging + data: + option: "Disabled" + - service: time.set_value + target: + entity_id: time.inverter_deye_program_2_time + data: + time: "06:00:00" + - service: number.set_value + target: + entity_id: number.inverter_deye_program_2_soc + data: + value: 15 + + # Program 3: Dodatkowe okno 13:00-15:00 (G12W tania!) + - service: select.select_option + target: + entity_id: select.inverter_deye_program_3_charging + data: + option: "Grid" + - service: time.set_value + target: + entity_id: time.inverter_deye_program_3_time + data: + time: "13:00:00" + - service: number.set_value + target: + entity_id: number.inverter_deye_program_3_soc + data: + value: 100 + + # Program 4: Stop o 15:00 + - service: select.select_option + target: + entity_id: select.inverter_deye_program_4_charging + data: + option: "Disabled" + - service: time.set_value + target: + entity_id: time.inverter_deye_program_4_time + data: + time: "15:00:00" + + - service: notify.persistent_notification + data: + title: "🌧️ G12W: Bardzo pochmurnie!" + message: "Prognoza: {{ states('sensor.solcast_pv_forecast_prognoza_na_jutro') }} kWh. Ładowanie 00-06 + 13-15!" + +- alias: "Solcast G12W - Pochmurnie (Pn-Pt)" + description: "Standardowe ładowanie nocne gdy 3-6 kWh" + trigger: + - platform: time + at: "21:30:00" + condition: + - condition: time + weekday: [mon, tue, wed, thu, fri] + - condition: numeric_state + entity_id: sensor.solcast_pv_forecast_prognoza_na_jutro + above: 3 + below: 6 + - condition: numeric_state + entity_id: sensor.inverter_deye_battery + below: 95 + action: + - service: switch.turn_on + target: + entity_id: switch.inverter_deye_battery_grid_charging + + # Program 1: Ładowanie od 00:00 (północ!) + - service: select.select_option + target: + entity_id: select.inverter_deye_program_1_charging + data: + option: "Grid" + - service: time.set_value + target: + entity_id: time.inverter_deye_program_1_time + data: + time: "00:00:00" + - service: number.set_value + target: + entity_id: number.inverter_deye_program_1_soc + data: + value: 100 + + # Program 2: Stop o 06:00, rozładowanie do 15% + - service: select.select_option + target: + entity_id: select.inverter_deye_program_2_charging + data: + option: "Disabled" + - service: time.set_value + target: + entity_id: time.inverter_deye_program_2_time + data: + time: "06:00:00" + - service: number.set_value + target: + entity_id: number.inverter_deye_program_2_soc + data: + value: 15 + + # Wyłącz pozostałe programy + - service: select.select_option + target: + entity_id: select.inverter_deye_program_3_charging + data: + option: "Disabled" + - service: select.select_option + target: + entity_id: select.inverter_deye_program_4_charging + data: + option: "Disabled" + + - service: notify.persistent_notification + data: + title: "🌥️ G12W: Pochmurnie" + message: "Prognoza: {{ states('sensor.solcast_pv_forecast_prognoza_na_jutro') }} kWh. Ładowanie 00-06." + +# ============================================ +# WEEKEND +# Sobota: ZERO ładowania (PV wystarczy) +# Niedziela: Ładowanie na poniedziałek +# ============================================ + +- alias: "Solcast G12W - Sobota: Bez ładowania" + description: "W sobotę wieczorem nie ładuj - ZERO wyjątków!" + trigger: + - platform: time + at: "21:30:00" + condition: + - condition: time + weekday: + - sat + action: + # Wyłącz ładowanie z sieci + - service: switch.turn_off + target: + entity_id: switch.inverter_deye_battery_grid_charging + + # Program 1: Disabled + - service: select.select_option + target: + entity_id: select.inverter_deye_program_1_charging + data: + option: "Disabled" + + - service: notify.persistent_notification + data: + title: "☀️ G12W: Sobota - relaks" + message: | + 🌤️ Prognoza niedz: {{ states('sensor.solcast_pv_forecast_prognoza_na_jutro') }} kWh + 🔋 Bateria: {{ states('sensor.inverter_deye_battery') }}% + 💤 ZERO ładowania - G12W weekend! + 📉 Rozładowanie do 15% = OK! + 💡 Niedziela 21:30: Ładowanie na poniedziałek + +- alias: "Solcast G12W - Niedziela: Ładowanie na poniedziałek" + description: "W niedzielę wieczorem ładuj na poniedziałek" + trigger: + - platform: time + at: "21:30:00" + condition: + - condition: time + weekday: + - sun + - condition: numeric_state + entity_id: sensor.inverter_deye_battery + below: 90 + action: + - service: switch.turn_on + target: + entity_id: switch.inverter_deye_battery_grid_charging + + # Program 1: Ładowanie od 00:00 (północ!) + - service: select.select_option + target: + entity_id: select.inverter_deye_program_1_charging + data: + option: "Grid" + - service: time.set_value + target: + entity_id: time.inverter_deye_program_1_time + data: + time: "00:00:00" + - service: number.set_value + target: + entity_id: number.inverter_deye_program_1_soc + data: + value: 100 + + # Program 2: Stop o 06:00 (poniedziałek), rozładowanie do 15% + - service: select.select_option + target: + entity_id: select.inverter_deye_program_2_charging + data: + option: "Disabled" + - service: time.set_value + target: + entity_id: time.inverter_deye_program_2_time + data: + time: "06:00:00" + - service: number.set_value + target: + entity_id: number.inverter_deye_program_2_soc + data: + value: 15 + + - service: notify.persistent_notification + data: + title: "🌙 G12W: Niedziela → Poniedziałek" + message: | + 🔋 Bateria: {{ states('sensor.inverter_deye_battery') }}% + ☀️ Prognoza pon: {{ states('sensor.solcast_pv_forecast_prognoza_na_jutro') }} kWh + ⚡ Ładowanie 00:00-06:00 (6h) + 🎯 Cel: 100% SOC na poniedziałek + 💰 Koszt: ~4.50 zł (weekend=tania!) + +# ============================================ +# RAPORT WIECZORNY +# ============================================ + +- alias: "Solcast G12W - Raport poranny" + description: "Raport 07:00 z taryfą" + trigger: + - platform: time + at: "07:00:00" + action: + - service: notify.persistent_notification + data: + title: "☀️ Prognoza + G12W" + message: | + Dziś: {{ states('sensor.solcast_pv_forecast_prognoza_na_dzisiaj') }} kWh + Jutro: {{ states('sensor.solcast_pv_forecast_prognoza_na_jutro') }} kWh + Bateria: {{ states('sensor.inverter_deye_battery') }}% + {% if now().weekday() < 5 %}Taryfa: 00-06, 13-15 tania{% else %}Weekend: Cała doba tania!{% endif %}