Switch node for multiple criteria

For what ever reason, I cannot wrap my head around the logic on NodeRed…

I am trying to combine a battery state of charge value and a time since last fully charged value and decide if the last full charge was X number of days ago, increase charge rate, otherwise use my calculated value.

Said another way, I have 2 input numbers, if input 1 is 50, output 50, else, output value 2. But, I don’t want the output bouncing back and forth between 50 and value 2.

I have been playing around with joins and switches and changes, etc but the logic escapes me.

If the 2 numbers come from different sources, you either need a way to combine them - which is generally hard since you probably cannot predict when they arrive - or you will need to temporarily store one or both in context variables so that you can retrieve them when you actually need them.

As you want to do a time-based calculation as well, you will also need some way of tracking that as well.

It is hard to advise with so little to go on. But don't worry about the debounce part to begin with, get the basics right first.

Are you tracking the last full charge time simply by monitoring the current charge? And how is the current charge arriving? Are you polling for that, getting it on a regular or irregular feed?

I might have an answer to your question, but I’m not sure I’m tracking what you’re trying to do. Can you post your flow as an example?