# Template filter states <=0
- trigger:
platform: state
entity_id:
- sensor.l1_voltage
sensor:
name: "l1_voltage_filtered"
unit_of_measurement: 'V'
device_class: voltage
state: >-
{{ iif((states('sensor.l1_voltage') | float(0) > 0), (states('sensor.l1_voltage') | float(0)), (states('sensor.l1_voltage_filtered') | float(0)))}}
- trigger:
platform: state
entity_id:
- sensor.l2_voltage
sensor:
name: "l2_voltage_filtered"
unit_of_measurement: 'V'
device_class: voltage
state: >-
{{ iif((states('sensor.l2_voltage') | float(0) > 0), (states('sensor.l2_voltage') | float(0)), (states('sensor.l2_voltage_filtered') | float(0)))}}
- trigger:
platform: state
entity_id:
- sensor.l3_voltage
sensor:
name: "l3_voltage_filtered"
unit_of_measurement: 'V'
device_class: voltage
state: >-
{{ iif((states('sensor.l3_voltage') | float(0) > 0), (states('sensor.l3_voltage') | float(0)), (states('sensor.l3_voltage_filtered') | float(0)))}}
- trigger:
platform: state
entity_id:
- sensor.l1_current
sensor:
name: "l1_current_filtered"
unit_of_measurement: 'A'
device_class: current
state: >-
{{ iif((states('sensor.l1_current') | float(0) > 0), (states('sensor.l1_current') | float(0)), (states('sensor.l1_current_filtered') | float(0)))}}
- trigger:
platform: state
entity_id:
- sensor.l2_current
sensor:
name: "l2_current_filtered"
unit_of_measurement: 'A'
device_class: current
state: >-
{{ iif((states('sensor.l2_current') | float(0) > 0), (states('sensor.l2_current') | float(0)), (states('sensor.l2_current_filtered') | float(0)))}}
- trigger:
platform: state
entity_id:
- sensor.l3_current
sensor:
name: "l3_current_filtered"
unit_of_measurement: 'A'
device_class: current
state: >-
{{ iif((states('sensor.l3_current') | float(0) > 0), (states('sensor.l3_current') | float(0)), (states('sensor.l3_current_filtered') | float(0)))}}
- trigger:
platform: state
entity_id:
- sensor.l1_power
sensor:
name: "l1_power_filtered"
unit_of_measurement: 'W'
device_class: power
state: >-
{{ iif((states('sensor.l1_power') | float(0) > 0), (states('sensor.l1_power') | float(0)), (states('sensor.l1_power_filtered') | float(0)))}}
- trigger:
platform: state
entity_id:
- sensor.l2_power
sensor:
name: "l2_power_filtered"
unit_of_measurement: 'W'
device_class: power
state: >-
{{ iif((states('sensor.l2_power') | float(0) > 0), (states('sensor.l2_power') | float(0)), (states('sensor.l2_power_filtered') | float(0)))}}
- trigger:
platform: state
entity_id:
- sensor.l3_power
sensor:
name: "l3_power_filtered"
unit_of_measurement: 'W'
device_class: power
state: >-
{{ iif((states('sensor.l3_power') | float(0) > 0), (states('sensor.l3_power') | float(0)), (states('sensor.l3_power_filtered') | float(0)))}}