Hello everyone,
I copied the following automation from this page and customized it to fit my entities.
alias: SolarFlow Nulleinspeisung adaptiv
triggers:
- seconds: /3
trigger: time_pattern
conditions:
- condition: state
entity_id: input_boolean.solarflow_nulleinspeisung
state: "on"
actions:
- data:
entity_id: number.solarflow_800_pro_outputlimit
value: >
{% set grid = states('sensor.shellypro3em_ac151877a150_power') |
float(0) %} {% set current =
states('number.solarflow_800_pro_outputlimit') | float(0) %} {% set
abs_grid = grid | abs %}
{% set hysterese = 20 %} {% set min_limit = 0 %} {% set max_limit = 800
%}
{% if abs_grid <= hysterese %}
{% set target = current %}
{% elif abs_grid <= 50 %}
{% set step = 10 %}
{% set target = current + (step if grid > 0 else -step) %}
{% elif abs_grid <= 120 %}
{% set step = 20 %}
{% set target = current + (step if grid > 0 else -step) %}
{% else %}
{% set target = current + grid %}
{% endif %}
{{ [min_limit, [target, max_limit] | min] | max | round(0) }}
action: number.set_value
mode: single
Unfortunately, when I try to save it (even if I don’t change anything in the automation), I get the following error:
Error parsing YAML: missing comma between flow collection entries (line: 13, column: 10)
Maybe someone has an idea what the problem might be. My knowledge of YAML is unfortunately very limited, if not nonexistent. ![]()
Thanks for your time,
Wolle