#condition:
1 messages ยท Page 1 of 1 (latest)
Remove the and. Conditions are and by default.
And... no... paste in the conditions I posted.
You don't want to check the trigger id in the conditions because you don't need to care about them there. You only need to worry about the trigger id in your actions.
This will not fire on the time pattern, as the actions are trigger_id conditioned
So, you only care about the HVAC coming on when it's warm and the door is closed?
Yep
And going "OFF" when door is opened for more than x seconds, but for now I'd like to make it work first ๐
Yep, just noticed that
But if I remove the time_pattern (which I just did), the automation won't trigger
As it's already over 27 C in the room where the sensor is
That is literally all you need.
Crap. There's a typo on line 14. It should be (states('sensor.office_temperature_sensor_temperature')|default(0))|float
Create a new automation, edit in YAML, and paste iit in and change your entities and values.
On it
Well? Any luck?
Just added it.
Ok, now, go to Developer States > States, find your temp sensor and change the state to 27 and see if it triggers (obvs make sure the door is closed).
The current temp is above 27
IT HAS TO CHANGE ๐
28.06 to be precise
I did
And?
Please share the trace
It did trigger now.
But only after setting it below 27 which is the trigger treshold
So my problem is - how do I have HA check for the Sensor temp constantly or every x mins
Because this way, it doesn't behave as I want it to
Do you press the light switch every minute, when you want the room to be bright? Or just if it is off and it is dark?
You don't need it to constantly check. You should only want it to change when the temp changes. The trigger already checks every time the sensor reports a state change.
I get what you're saying, and I really appreciate the sarcasm ๐ But hear me out
If the temp doesn't change, the automation shouldn't fire.
That's no sarcasm, but an analogy
then x hours, temp was well over 27
and that particular automation didn't trigger again
Ok, so we figured out the old version of the automation wasn't working due to conditions. Therefore, yeah, the old automation may have triggered, but wouldn't have fired.
The triggers in the new automation should handle that.
Basically, the new triggers subscribe to events. If the sensor changes, an event is fired and the condition in the trigger is evaluated.
Is the code you've shared manually done, or via interface and exported?
Manually
But, I just tested it here and it fired every time I set the state manually.
Roger.
Well - thanks a lot to both of you. On to adding the door open condition and break this even further.
trigger
not condition ๐
lol so,
- platform: state
entity_id:
- binary_sensor.door
to: "on"
from: "off"
On that, should I try to include the "door open, turn off hvac" in this automation, or make another one specific for that case
That's really up to you... since you're kinda new, I'd say go with a separate automation before going with bigger ones with additional logic.
Start simple, add complexity later
TBF, I'd actually take this one and break it into 2. That way you can test it easier.
Now to figure out why the SMB share isn't mounting properly and why the backup service craps out
Thanks a lot guys !

โค๏ธ
@digital moon - I was getting some errors in the log for the value_template: code you shared (it was working, just benign error for undefined default)
I asked chatgpt and it fixed it with this:
- platform: template
value_template: >
{% set temp = states('sensor.sensor_name') %} {{ temp !=
'unavailable' and (temp | float(0)) >= 27 }}```
cleaner log ๐