Ability to manipulate dates/times

Hi everyone,

I don’t know if this would be of great interest to you (but it means a lot to me ^^): would it be useful to be able to have date/time type values. Or even several types:

  • date
  • year
  • month
  • day
  • hour
  • minutes
  • timestamp

I can see the usefulness for me to manage the timing for turning some devices on/off.
For example, for my pool pump, I’d like to be able in Gladys (without using Node-RED, which sometimes requires knowledge I don’t have to create script snippets and functions) to create this kind of scene:

  • Trigger at 8:00 AM
  • Start filtration
  • Retrieve pool temperature
  • operation T° piscine / 2 > gives a value X (this gives me the required filtration duration in hours)
  • Convert this value to minutes if needed
  • Wait X minutes
  • Stop filtration

I imagine there are many other use cases, particularly for managing durations.

I’m 100% for it too!! I’m exactly in the same situation, or almost!!
My probe gives me an ideal daily filtration time that changes depending on the water temperature and the treatment (between 30 minutes per day and 3:00).
But on my side, that’s also linked to another feature request to be able to write values from scenes…

Anyway I vote :wink::wink:

1 Like

Hello, date handling is a good idea.
J’aimerais travailler sur le sujet, il se trouve que je suis également intéressé par des appareils pouvant stocker une date+heure (le timestamp seems the most suitable since it’s an integer type that can be easily saved), dans mon cas ce serait plutôt pour afficher des informations dans le dashboard (in x minutes, in y hours…)
Can you tell me what you think is missing in your use case? Because in the scenario you describe above and that I’m trying to picture, the only thing missing to me are timestamp devices.
Let me explain, in the example you give :

However, the « wait X minutes » could be replaced by « wait until such date at such time » (in your scene it’s now + 2h for example) then trigger a second turn-off scene when we reach the timestamp time. I suggest this because imagine Gladys restarts during these 2-3 hours of waiting — how do we resume the scene where it left off.
Of course we’ll need to add

  • a way to trigger a scene on timestamp devices (a bit like calendar events essentially)
  • a way to retrieve the current date and time in the « control a device » block
    For the date/time manipulation part, we already have the ability to do calculations in scenes — wouldn’t that answer your request if we associate it with a timestamp device?
    What do you think?

Wait X minutes, X may be random ( between W and Y)

+1 for not using Node-Red

We might need to edit/recreate this request, because I don’t see anything concrete in the request :sweat_smile:

Est-ce que si on devait écrire une seule ligne sur cette demande, la demande ne serait pas :

« Be able to inject a variable into the "Wait" action »:

![Screenshot 2023-09-15 at 15.10.36|690x403](upload://wwvj2rEvmDoVn5wDZGV

Shoot, I tried to be clear… :face_with_open_eyes_and_hand_over_mouth: I guess it’s not that clear in my head!

The thing is, when I see your proposal it seems very coherent to me, but where does this variable come from?

In my example, I want to retrieve a temperature, apply a basic mathematical calculation to it to: divide, convert a time value (hour / minute / etc…) and then use that value in the WAIT block.

I don’t know what that kind of thing would entail.

Maybe I need to look at it more broadly and what I need is just a CALCULATION block that takes a base value and transforms it into a variable that we use later?

Look at the “control a device” action, you can perform a mathematical operation directly in the field :slight_smile:

So it’s the same for “wait”, we could add variable injection and calculation

Actually I wrote the message after checking…
So there may be something I didn’t understand.

If we allow variable injection in the WAIT field, can the scenario I described be applied in the scenes?

EDIT : I misread your message so I’ll start again :

For me what’s intuitive is to retrieve a value, apply a calculation to it, and then use it.
In what you propose, we retrieve a value, and it’s when using it (in the WAIT block) that we’ll apply the calculation to it, am I right?

Yes, that’s what I’m proposing! Same functionality as in “control a device”

1 Like

So in my scene I could do it like this (non-exhaustive example):

  • get pool temperature
  • WAIT block > calculated value > {{ temperature piscine }} / 2 * 60

Am I right? Sorry, it looks like my brain is on strike today

Yes, exactly! If that works for you, I suggest recreating a request with a title that says exactly that?

Yes, of course — I was just about to ask you that. I’ll do it right away.

OK, are you good with me closing this one?

Yes, of course! People will have to change their votes :wink:

New request: