#How do you trigger the record off

1 messages · Page 1 of 1 (latest)

fossil siren
#

You made no mention of off, just on

vagrant prawn
#

If plug has been off for 96 hours then turn it on.

#

when on for 24 hrs turn it off.

fossil siren
#

Take the same approach? You could even use the same datetime

#

Set it forward 24 hours when you turn it on, and if it's on when the automation runs turn it off, if it's off turn it on

vagrant prawn
#

that is my challenge i don't know how to make the automation record a value into the helper object I created. You said make it record the date/time it was last turned off to prevent issues when its rebooted. But how do i force that into a the helper variable and record the value of when it was last turned off and last turned on.

fossil siren
vagrant prawn
#

do you have an example somewhere that I can go off of.

#

Found this maybe this will be close enough to get me headed in the right direction.

#

I just setup something that works but may not be the best I check if the time is midnight if so it goes to condition to check if condition of charger is off for 96 hrs if so turn it on. In my case I checked if if twas off for 2 minutes and when it hit 10:45 pm.

#

With being new not sure I am ready for templates and the complexities until i get a little more time with HA

fossil siren
#

You've been here for nearly three years 😛

That said, #templates-archived can help you, and to get you started:

- service: input_datetime.set_datetime
  data:
    entity_id: input_datetime.towel_timer
    timestamp: >-
      {{ as_timestamp(states.switch.towel_switch.last_changed + timedelta(hours=96))|int(0) }}
vagrant prawn
#

I have been in HA for 3 yrs but just started using it to any degree I have installed it in the past and used it to control some tplink plugs i got 3 years ago and after that never really did anything with it. it sat and I never used it.