Get motion for last 60 minutes

Your issue is that the History node is from the Home Assistant Node Red package and as such most people on here would not have access to it or have used it.

Yes it is quite possilbe to extract something from the incoming message

Do some screenshots of the following

  1. Debug Window when an incoming messages comes from the History node - make sure you open up the object/message details so we can see what they contain

Craig

So presumably saying this another way - you want to access the Object in the screenshot you put above - but what are you interested in - all state changes, the last On state (even if there is an off after it) or the last element in the array and what state that sets ?

This is your problem with using the History node - it gives you this unlimited data stream and it is up to you to parse it and try to decide to do something with it - i think it is the wrong approach - can you explain what data you would extract out of this object/array to made the decisions that you have wanted ?

It would seem to me your would have to cycle through all the elements in the array and return the last on state - then get the time for that - then look to see if there are any Off states after that time ?

Very convoluted way of doing it

Craig

It is now working, I understood it wrong, but with this explanation it is now clear to me and this flow is working, I will now implement it in my own flow.

Thank for you help and time.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.