#Transfer Variable between two Automations

1 messages · Page 1 of 1 (latest)

maiden goblet
#

How can I save the current time in one automation and then output how much time has passed since the saved time in a second automation?
Like „Time passed: 3 Hours and 28 Minutes“

upbeat vapor
#

You'd need to store the value in a help of your choice

maiden goblet
bright umbraBOT
upbeat vapor
#

You really need to share more of what you're doing for anything more detailed

maiden goblet
# upbeat vapor You really need to share more of what you're doing for anything more detailed

That is my goal:
I have two automations that I want to call up with my voice assistant. One automation saves the time when I go to bed and the other is supposed to retrieve the time when I went to bed and thus output how long I slept.

So automation "good night" saves the current time and automation "good morning" calculates the difference between now and the saved time and reads it out.

I use "Set conversation response" for reading out in the automations

upbeat vapor
#

So:

  1. Save the time in an input_datetime
  2. Use a #1284966664357810196 for the announcement that provides the time between then and now
maiden goblet
#

Okay, I'm one step further. I have now created a datetime helper. The current time is already saved in my "good night" automation.

How can I output the time difference to now in the "good morning" automation? Or how can I now access the time in the helper?