truesince in a watch keeps triggering a scene

Hi,

I am using a truesince(Watts new > 1000, 300) in a watch for a scene and that keeps firing until the watts has dropped below 1000 again. The wattage is constantly fluctuating a bit when over 1000, so I cannot simply look at the last changed timestamp. How do I make it fire just once?

BTW, this is on openLuup.

Cheers Rene

[quote=“reneboer, post:1, topic:195213”]Hi,

I am using a truesince(Watts new > 1000, 300) in a watch for a scene and that keeps firing until the watts has dropped below 1000 again. The wattage is constantly fluctuating a bit when over 1000, so I cannot simply look at the last changed timestamp. How do I make it fire just once?

BTW, this is on openLuup.

Cheers Rene[/quote]

I am not fully understanding your question. Maybe you can share exactly the expression you use and a luup log in DEBUG mode so we can follow what happens exactly.

what trueSince(new > 1000, 300) will achieve is new must be >1000 and stay that way ( even if new value changes ) for at least the duration of the timer 300s. when the timer expires, if new >1000 it will fire the scene
if within the timer duration new changes and new > 1000 becomes false, it will cancel the whole thing, timer & scene will not run

Hi amg0,

When the wattage remains above the 1000 threshold, but is fluctuating (1200, 1250, 1800, 1150…) the scene keeps getting triggered for as long as the wattage stays over 1000. So if it stays over 1000 for 30 minutes, it seems to fire every five minutes or so. All I have in the watch for the scenes is trueSince(new > 1000, 300) on the watts value of a power meter.

What I would like to happen is like on the Vera (although that lacks trueSince) is that the trigger only fires once if the wattage went over 1000 watts and stayed above 1000 for 5 minutes or more.

Maybe trueSince(new > 1000 and old < 1000, 300) works? I am doubting that because of the wattage changing all the time, so on the next change both new and old will be above 1000 and cancel the trueSince condition.

Cheers Rene

[quote=“reneboer, post:3, topic:195213”]Hi amg0,

When the wattage remains above the 1000 threshold, but is fluctuating (1200, 1250, 1800, 1150…) the scene keeps getting triggered for as long as the wattage stays over 1000. So if it stays over 1000 for 30 minutes, it seems to fire every five minutes or so. All I have in the watch for the scenes is trueSince(new > 1000, 300) on the watts value of a power meter.

What I would like to happen is like on the Vera (although that lacks trueSince) is that the trigger only fires once if the wattage went over 1000 watts and stayed above 1000 for 5 minutes or more.

Maybe trueSince(new > 1000 and old < 1000, 300) works? I am doubting that because of the wattage changing all the time, so on the next change both new and old will be above 1000 and cancel the trueSince condition.

Cheers Rene[/quote]

hummm I get it now. truesince() fires , then all is reset and a new truesince() is programmed so it leads to a fire every 5min ( = your 300 s ) time. I have to think about a potential solution.

NB; maybe not related but I found a bug in that area as I was investigating your point, so expect tonight a new version of ALTUI.lua in github to fix a bug with the code dealing with timers…