I have this automation to trigger my heatpump hot water production when I produce over 3kw of excess solar energy. For that I use a numerical value trigger.
I also want to add a time condition that it would only do so when it is after 12.00 and before 17.00 to avoid the peek electricity price.
The problem is that if it is a sunny day and the excess production was already above 3kw before 12.00 then the automation is not triggered.
Does anybody has a idea how to work around that?
Pierre
alias: solar water on
description: ""
trigger:
- platform: numeric_state
entity_id:
- sensor.smart_gateways_smart_meter_power_produced
for:
hours: 0
minutes: 5
seconds: 1
above: 3
condition:
- condition: time
after: "12:00:00"
before: "17:00:00"
action:
- metadata: {}
data: {}
target:
entity_id:
- switch.ctc_hotwater_mode_comfort
- switch.ctc_price_mode
action: switch.turn_on
mode: single
No, it will trigger again once above 3 and then pass and run the action.
So basically:
It triggers once at 12.00 by one of the triggers.
Checks if the time is 12.00-17.00 AND that the numeric state is above 3.
If yes, then it runs your action.
If numeric state at 12.00 is below 3, it will not run the action.
Then if for example the time is 13.05 and the numeric state goes above 3, then the automation is triggered again by the numeric state trigger.
Once again it checks the conditions, and since both returns true then the action runs.
Edit: think of this in this way, an automation can be triggered by multiple different triggers but the action will only run if all conditions pass.
Edit2: when I wrote “set another trigger” I mean set one additional trigger. So you trigger at both 12.00 and above 3