Hi everyone,
I need some help creating a trigger for an automation that recognizes when my electricity tariff from my supplier changes from positive to negative and vice versa.
For the insiders: I live in Holland and use Zonneplan as my electricity supplier. In HA, I have a sensor that displays the current tariff. The tariff changes every hour. It is not necessary to trigger for every change within the spectrum (positive or negative). What I want is a trigger that detects when the current tariff goes negative and when it goes positive again.
I tried it with the code below, but that doesn’t work. Who can help me?
triggers:
- trigger: state
entity_id:
- sensor.zonneplan_current_electricity_tariff
to:
- "-"
id: Naar negatief
- trigger: state
entity_id:
- sensor.zonneplan_current_electricity_tariff
id: Naar positief
from:
- "-"
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- Naar negatief
sequence:
- type: turn_off
device_id: 6a913ee349c8cc266a0a0e9eff66d3b3
entity_id: 55168ce46a49558f1fab98fdb78c6899
domain: switch
- action: notify.mobile_app_pixel_6
metadata: {}
data:
message: Omvormer uitgezet vanwege negatieve prijzen!
- conditions:
- condition: trigger
id:
- Naar positief
sequence:
- type: turn_on
device_id: 6a913ee349c8cc266a0a0e9eff66d3b3
entity_id: 55168ce46a49558f1fab98fdb78c6899
domain: switch
- action: notify.mobile_app_pixel_6
metadata: {}
data:
message: Omvormer aangezet vanwege positieve prijzen!
mode: single