you mean as in, if it going to a ‘to’ it should be coming from a ‘from’…? Which would of course only apply in case of a binary.
i did this, believing to be useful because Id be ruling out all the attributes changes triggering the state…
as with the set of trigger.to templates. see @petro s solution here : More than one to: in a state trigger? - #10 by petro
Mostly that rules out it fires when coming from a state is was in. A very elegant way of preventing it to fire on each value being above the threshold. Or being the same, as in people being home.
I understand how to do this with the regular threshold binary,
binary_sensor:
- platform: threshold
name: 'ZP Opbrengst threshold'
entity_id: sensor.zp_actuele_opbrengst
upper: 1500
hysteresis: 300
btw, does this go both ways?
but how to do that with the input i use:
- platform: template
sensors:
zp_opbrengst_threshold_input:
friendly_name: 'ZP Opbrengst threshold input'
value_template: >
{{(states('sensor.zp_actuele_opbrengst') | float) >
(states('input_number.zp_opbrengst_threshold') | float)}}
Im trying to understand 100%…
previously, when testing the templates. I changed the number and quoted it, (to compare it with the states, being a string…) but now see I should have made the strings into numbers with |int or |float.
cool, thanks for the very clear explanation!