Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: Boiler Solar - Control unificat (v3.2 – non-blocking)
- description: >
- Controlează boilerul de 2.5 kW în funcție de producția solară, surplus și
- starea bateriei. Evită consumul din rețea și descărcarea bateriei, include
- histerezis pe timp (helpers) și diagnostic clar în Telegram. Fără delay-uri
- blocante.
- triggers:
- - alias: Pornire boiler - surplus mare
- trigger: numeric_state
- entity_id: sensor.surplus_power
- above: 2.8
- for:
- minutes: 1
- - alias: Oprire boiler - surplus scăzut
- trigger: numeric_state
- entity_id: sensor.surplus_power
- below: 1.2
- for:
- seconds: 30
- - alias: Oprire boiler - consum mare
- trigger: numeric_state
- entity_id: sensor.house_power_consumption
- above: 5
- for:
- seconds: 15
- conditions: []
- actions:
- - choose:
- - conditions:
- - condition: state
- entity_id: switch.boiler_tasmota_priza_1_2
- state: "off"
- - condition: numeric_state
- entity_id: sensor.surplus_power
- above: 2.8
- - condition: numeric_state
- entity_id: sensor.house_power_consumption
- below: 5
- - condition: numeric_state
- entity_id: sensor.inverter_input_power
- above: 2.5
- - condition: numeric_state
- entity_id: sensor.batteries_charge_discharge_power
- above: -0.1
- - condition: template
- value_template: "{{ states('sensor.power_meter_active_power')|float(0) > -0.3 }}"
- - condition: template
- value_template: |
- {% set luna = now().month %} {% if luna in [11, 12, 1, 2, 3] %}
- {{ states('sensor.batteries_state_of_capacity')|float(0) >= 70 }}
- {% else %}
- true
- {% endif %}
- - condition: template
- value_template: |
- {{ now().timestamp() -
- (as_timestamp(states('input_datetime.ultima_pornire_boiler')) or 0) > 600 }}
- - condition: template
- value_template: |
- {{ now().timestamp() -
- (as_timestamp(states('input_datetime.ultima_oprire_boiler')) or 0) > 300 }}
- sequence:
- - action: switch.turn_on
- target:
- entity_id: switch.boiler_tasmota_priza_1_2
- - action: input_datetime.set_datetime
- target:
- entity_id: input_datetime.ultima_pornire_boiler
- data:
- datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- - action: telegram_bot.send_message
- data:
- chat_id: -4624694357
- message: >
- ✅ *Boiler pornit automat* la {{ now().strftime('%H:%M:%S') }} ☀️
- • Producție solară: {{
- (states('sensor.inverter_input_power')|float)|round(2) }} kW
- • Surplus: {{ (states('sensor.surplus_power')|float)|round(2) }}
- kW
- • Putere baterii: {{
- (states('sensor.batteries_charge_discharge_power')|float)|round(2)
- }} W
- • Consum casă: {{
- (states('sensor.house_power_consumption')|float)|round(2) }} kW
- ⏱️ Histerezis timp: min. 10 min între două porniri.
- - conditions:
- - condition: state
- entity_id: switch.boiler_tasmota_priza_1_2
- state: "on"
- - condition: or
- conditions:
- - condition: numeric_state
- entity_id: sensor.house_power_consumption
- above: 5
- - condition: numeric_state
- entity_id: sensor.surplus_power
- below: 0.8
- - condition: numeric_state
- entity_id: sensor.inverter_input_power
- below: 2.5
- - condition: numeric_state
- entity_id: sensor.batteries_charge_discharge_power
- below: 0
- - condition: template
- value_template: "{{ states('sensor.power_meter_active_power')|float(0) < 0.1 }}"
- sequence:
- - action: switch.turn_off
- target:
- entity_id: switch.boiler_tasmota_priza_1_2
- - action: input_datetime.set_datetime
- target:
- entity_id: input_datetime.ultima_oprire_boiler
- data:
- datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- - action: telegram_bot.send_message
- data:
- chat_id: -4624694357
- message: >
- ⚠️ *Boiler oprit automat* la {{ now().strftime('%H:%M:%S') }}
- ☀️ Producție solară: {{
- (states('sensor.inverter_input_power')|float)|round(2) }} kW
- ☀️ Surplus: {{ (states('sensor.surplus_power')|float)|round(2)
- }} kW
- 🔋 Putere baterii: {{
- (states('sensor.batteries_charge_discharge_power')|float)|round(2)
- }} W
- ⚡ Active power: {{ states('sensor.power_meter_active_power') }}
- W
- ⏱️ Timp de funcționare respectat (min. 5 min) în majoritatea
- scenariilor; în caz de urgență (consum mare/import) oprirea
- poate fi imediată.
- default:
- - action: telegram_bot.send_message
- data:
- chat_id: -4624694357
- message: >
- {% set surplus = states('sensor.surplus_power')|float(0) %} {% set
- import = states('sensor.power_meter_active_power')|float(0) %} {%
- set solar = states('sensor.inverter_input_power')|float(0) %} {% set
- battery = states('sensor.batteries_charge_discharge_power')|float(0)
- %} {% set soc =
- states('sensor.batteries_state_of_capacity')|float(0) %} {% set
- house = states('sensor.house_power_consumption')|float(0) %} {% set
- luna = now().month %} {% set iarna = luna in [11, 12, 1, 2, 3] %}
- {% if battery < 0 %}
- 🔴 *Avertisment:* Bateria descarcă! Boiler oprit recomandat.
- {% elif import < 0 %}
- 🔴 *Avertisment:* Consum din rețea detectat!
- {% elif solar < 2.5 %}
- 🟠 *Atenție:* Producție solară insuficientă.
- {% elif surplus < 1 %}
- 🟠 *Atenție:* Surplus scăzut, risc de import.
- {% elif iarna and soc < 70 %}
- 🟦 *Mod iarnă:* SOC baterie sub 70% (acum {{ soc|round(0) }}%). Boiler nu pornește.
- {% else %}
- 🟢 *Totul OK:* Funcționare normală.
- {% endif %}
- 🔎 *Diagnostic Boiler* (no action la {{ now().strftime('%H:%M:%S')
- }})
- 🟢 *Switch:* {{ states('switch.boiler_tasmota_priza_1_2') }}
- ☀️ *Producție solară:* {{ solar|round(2) }} kW ☀️ *Surplus:* {{
- surplus|round(2) }} kW 🔋 *Baterii:* {{ battery|round(2) }} W 🔋
- *SOC:* {{ soc|round(0) }}% 🏠 *Consum casă:* {{ house|round(2) }} kW
- ⚡ *Active power:* {{ import|round(2) }} W
- ❄️ *Iarnă (Nov–Mar):* {{ 'DA' if iarna else 'NU' }} | Prag SOC
- iarnă: 70%
- ⏱️ *Timp pornire OK:* {{
- '✅' if (
- now().timestamp() -
- (as_timestamp(states('input_datetime.ultima_pornire_boiler')) or 0)
- ) > 600 else '⛔'
- }}
- ⏱️ *Timp oprire OK:* {{
- '✅' if (
- now().timestamp() -
- (as_timestamp(states('input_datetime.ultima_oprire_boiler')) or 0)
- ) > 300 else '⛔'
- }}
- 🧠 *Start ready:* {{
- '✅' if (
- is_state('switch.boiler_tasmota_priza_1_2','off') and
- (surplus >= 2.8) and
- (solar >= 2.5) and
- (battery >= -0.1) and
- (house < 5) and
- (import >= -0.3) and
- ( (not iarna) or (soc >= 70) ) and
- ( now().timestamp() -
- (as_timestamp(states('input_datetime.ultima_pornire_boiler')) or 0)
- > 600 ) and
- ( now().timestamp() -
- (as_timestamp(states('input_datetime.ultima_oprire_boiler')) or 0)
- > 300 )
- ) else '⛔'
- }}
- mode: restart
Advertisement