Hallo
ich habe folgenden Code von Z-Master42 zur verfügung . Stehe aber auf dem Schlaf wo genau es rein muss mit welcher Einrückung
alias: SolarFlow Power-Sensoren nullen
description: >-
Wenn sich der Wert eines Power-Sensors innerhalb der letzten drei Minuten
nicht geändert hat, wird er auf 0 W gesetzt.
trigger:
- platform: template
value_template: >-
{{ (as_timestamp(now()) -
as_timestamp(states.sensor.solarflow_pack_input_power.last_changed)) > 180
}}
id: packInputPower
- platform: template
value_template: >-
{{ (as_timestamp(now()) -
as_timestamp(states.sensor.solarflow_output_pack_power.last_changed)) > 180
}}
id: outputPackPower
- platform: template
value_template: >-
{{ (as_timestamp(now()) -
as_timestamp(states.sensor.solarflow_solar_input_power.last_changed))
> 180 }}
id: solarInputPower
- platform: template
value_template: >-
{{ (as_timestamp(now()) -
as_timestamp(states.sensor.solarflow_output_home_power.last_changed)) > 180
}}
id: outputHomePower
- platform: template
value_template: >-
{{ (as_timestamp(now()) -
as_timestamp(states.sensor.solarflow_solar_power_1.last_changed)) > 180 }}
id: solarPower1
- platform: template
value_template: >-
{{ (as_timestamp(now()) -
as_timestamp(states.sensor.solarflow_solar_power_2.last_changed)) > 180 }}
id: solarPower2
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- packInputPower
- condition: numeric_state
entity_id: sensor.solarflow_pack_input_power
above: 0
sequence:
- service: mqtt.publish
data:
qos: "0"
topic: <appKey>/<deviceID>/state
payload: "{\"packInputPower\":0}"
- conditions:
- condition: trigger
id:
- outputPackPower
- condition: numeric_state
entity_id: sensor.solarflow_output_pack_power
above: 0
sequence:
- service: mqtt.publish
data:
qos: "0"
topic: <appKey>/<deviceID>/state
payload: "{\"outputPackPower\":0}"
- conditions:
- condition: trigger
id:
- solarInputPower
- condition: numeric_state
entity_id: sensor.solarflow_solar_input_power
above: 0
sequence:
- service: mqtt.publish
data:
qos: "0"
topic: <appKey>/<deviceID>/state
payload: "{\"solarInputPower\":0}"
- conditions:
- condition: trigger
id:
- outputHomePower
- condition: numeric_state
entity_id: sensor.solarflow_output_home_power
above: 0
sequence:
- service: mqtt.publish
data:
qos: "0"
topic: <appKey>/<deviceID>/state
payload: "{\"outputHomePower\":0}"
- conditions:
- condition: trigger
id:
- solarPower1
- condition: numeric_state
entity_id: sensor.solarflow_solar_power_1
above: 0
sequence:
- service: mqtt.publish
data:
qos: "0"
topic: <appKey>/<deviceID>/state
payload: "{\"solarPower1\":0}"
- conditions:
- condition: trigger
id:
- solarPower2
- condition: numeric_state
entity_id: sensor.solarflow_solar_power_2
above: 0
sequence:
- service: mqtt.publish
data:
qos: "0"
topic: <appKey>/<deviceID>/state
payload: "{\"solarPower2\":0}"
mode: parallel
brauche da mal Hilfe bitte