Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: Strom - Nulleinspeisung
- description: ""
- trigger:
- - platform: state
- entity_id:
- - sensor.shellypro3em_xxx_total_active_power
- - platform: state
- entity_id:
- - sensor.hm_400_p_ac
- enabled: false
- condition:
- - condition: or
- conditions:
- - condition: numeric_state
- entity_id: sensor.shellypro3em_xxx_total_active_power
- above: 50
- - condition: numeric_state
- entity_id: sensor.shellypro3em_xxx_total_active_power
- below: -5
- action:
- - service: mqtt.publish
- data:
- qos: 0
- retain: false
- topic: inverter/ctrl/limit/1
- payload_template: >-
- {% set newSolarLimit = 0 %} {% set minSolarLimit = 0 %} {% set noLimit
- = 100 %} {% set curGridUsage =
- states('sensor.shellypro3em_xxx_total_active_power') | int %}
- {% set curSolarProd = states('sensor.hm_400_p_ac') | int %}
- {% if curGridUsage >= 400 %}
- {{ noLimit }}
- {% elif curGridUsage >= 0 %}
- {% set newSolarLimit = (curGridUsage + curSolarProd - 20) | int %}
- {% if newSolarLimit <= 0 %}
- {% set newSolarLimit = minSolarLimit %}
- {{ newSolarLimit }}
- {% elif newSolarLimit > minSolarLimit %}
- {{ newSolarLimit | int }}W
- {% endif %}
- {% endif %}
- mode: single
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement