#condition:

1 messages ยท Page 1 of 1 (latest)

digital moon
#

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.

keen mesa
hearty bone
#

This will not fire on the time pattern, as the actions are trigger_id conditioned

digital moon
#

So, you only care about the HVAC coming on when it's warm and the door is closed?

keen mesa
#

Yep

#

And going "OFF" when door is opened for more than x seconds, but for now I'd like to make it work first ๐Ÿ™‚

keen mesa
#

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

digital moon
#

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.

keen mesa
#

On it

digital moon
#

Well? Any luck?

keen mesa
#

Just added it.

digital moon
#

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).

keen mesa
#

The current temp is above 27

digital moon
#

IT HAS TO CHANGE ๐Ÿ™‚

keen mesa
#

28.06 to be precise

digital moon
#

Then set it to 28.07

#

Trust the process lol

keen mesa
#

I did

digital moon
#

And?

keen mesa
#

Not triggering

#

Trying to set it below 27 then back up

hearty bone
#

Please share the trace

keen mesa
#

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

hearty bone
#

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?

digital moon
#

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.

keen mesa
#

I get what you're saying, and I really appreciate the sarcasm ๐Ÿ™‚ But hear me out

digital moon
#

If the temp doesn't change, the automation shouldn't fire.

keen mesa
#

It triggered some time last night

#

for whatever reason it didn't work

hearty bone
#

That's no sarcasm, but an analogy

keen mesa
#

then x hours, temp was well over 27

#

and that particular automation didn't trigger again

digital moon
#

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.

keen mesa
#

Is the code you've shared manually done, or via interface and exported?

digital moon
#

Manually

#

But, I just tested it here and it fired every time I set the state manually.

keen mesa
#

Roger.

#

Well - thanks a lot to both of you. On to adding the door open condition and break this even further.

#

trigger

#

not condition ๐Ÿ™‚

digital moon
#

lol so,

- platform: state
  entity_id: 
    - binary_sensor.door
  to: "on"
  from: "off"
keen mesa
#

On that, should I try to include the "door open, turn off hvac" in this automation, or make another one specific for that case

digital moon
#

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.

hearty bone
#

Start simple, add complexity later

digital moon
#

TBF, I'd actually take this one and break it into 2. That way you can test it easier.

keen mesa
#

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
keen mesa
#

โค๏ธ

keen mesa
#

@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 ๐Ÿ™‚

digital moon
#

That's odd. What was the error that was popping up?

#

Oh, duh. I see now. undefined default???

#

Ahhhh, default(0) didn't cover unavailalbe and unknown.