Guten Morgen,
evtl. kann mir jemand den nötige Schubs geben
Es geht um eine Solax Wechselrichter-Integration. Ich habe einen WemodD1Mini an dem ein einzeln steuerbarer LED-Strip mit NeoPixelBus eingebunden ist. 8 LEDs, in einem Bilderrahmen als Statusdisplay. Hier werden Entitäten angezeigt (Unwetterwarnung, etc.), aber es sollen auch Parameter der Solaranlage angezeigt werden. Beispiele sind aktueller Hausverbrauch, Solarerzeugung, Batteriestand. Das in Abhängigkeit der Werte der Entitäten, liegt bspw. die Hauslast <500W grün, drüber Gelb bis hin zu rot. So weit, so gut. Ich verzweifle aber an dem Code Ich habe zwei Varianten gebaut, bei ersterer nimmt er immer nur die erste Bedingung, ist die nicht erfüllt geht er in den Else-Zweig
Code: Alles auswählen
alias: Energy_Solarerzeugung
description: StatusLED schalten Solarertrag
trigger:
- platform: state
entity_id: sensor.solax_pv_power_total
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: sensor.solax_pv_power_total
state: "0"
sequence:
- service: light.turn_off
entity_id: light.statusled_statusdisplay2
- conditions:
- condition: not
conditions:
- condition: state
entity_id: sensor.solax_pv_power_total
state: "0"
sequence:
- service: light.turn_on
entity_id: light.statusled_statusdisplay2
data_template:
color_name: >
{%- if states("sensor.solax_pv_power_total")|int<=500 -%}red {%-
elif states("sensor.solax_pv_power_total")|int>=501 and
states("sensor.solax_pv_power_total")|int<=2000 -%}orange (%-
elif states("sensor.solax_pv_power_total")|int>2001 and
states("sensor.solax_pv_power_total")|int<=5000 -%}yellow {%-
elif states("sensor.solax_pv_power_total")|int>5001 -%}green {%-
else -%}white{%- endif -%}
default: []
mode: single
Denn habe ich eine Abwandlung gebaut, hier "hängt" er immer in der ersten Bedingung:
Code: Alles auswählen
alias: Energie_Solarertrag_Display
description: StatusLED 3 zeigt Solarertrag
trigger:
- platform: state
entity_id: sensor.solax_house_load
condition: []
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.solax_house_load
above: 0
below: 501
sequence:
- service: light.turn_on
entity_id: light.statusled_statusdisplay3
data:
brightness: 120
rgb_color:
- 0
- 139
- 4
- conditions:
- condition: numeric_state
entity_id: sensor.solax_house_load
above: 501
below: 1000
sequence:
- service: light.turn_on
entity_id: light.statusled_statusdisplay3
data:
brightness: 120
rgb_color:
- 255
- 145
- 0
- conditions:
- condition: numeric_state
entity_id: sensor.solax_house_load
above: 1001
below: 2000
sequence:
- service: light.turn_on
entity_id: light.statusled_statusdisplay3
data:
brightness: 120
rgb_color:
rgb_color:
- 255
- 48
- 48
- conditions:
- condition: numeric_state
entity_id: sensor.solax_house_load
below: 1
sequence:
- type: turn_off
device_id: 13ac0452663a516db813be842f510f13
entity_id: b6c54b74560b558120d9a98c666b8859
domain: light
mode: single
Hat jemand einen Tip für mich wo mein Fehler liegt? Bin für jeden Hinweis dankbar
Grüße Tedious