Script - Mimic No Update State
-
Haha, no I am not interested in that logic I half baked with my google fu.
Your code is so much nicer, I'll use that instead.
-
Hey Phil,
I don't think I tested your code last time, and now I'm realizing the code doesn't seem to be working. I'm always getting a return to zero, even though the boiler is OFF and cannot send data to update the time stamp.
Any thoughts?
-
Do you have the latest version of the Meta module installed?
-
Looks like it: Meta 2.2.4.
-
Hmm. You could try adding a print(data); after the first line, see what the statistics object looks like. Is the boiler on interval logging?
-
The point I am monitoring has a logging type: "When point value changes".
I have set up a No Update event notification, on that same point, to email when triggered, and that does work.
The data prints out as "0.0"
-
"print(data)" should print out an object, like {"count":0, "average":null, firstValue:PointValueTime@ABCDEF, lastValue:.... }
-
Oh, in that case I don't know where it print outs to. I tried looking around... I have no idea, sorry.
-
It would be right around where you are looking, above the return value. I would think the 0.0 you're seeing is the return value. Some of them have issues with the printstream getting eaten... you could try another browser perhaps. Or, you can just return data.toString() which would work to get its value returned in the error message saying it cannot be cast to a numeric.
-
Here ya go.
PS: I was using Chrome.
-
It looks like it's still reading values! Also I got my expectation wrong, that's just a list of PointValueTimes! I was thinking about the structure of statistics objects, like one would get from p.past()
i betcha my mistake is testing 'data.count == 0' instead of 'data.length == 0'
-
Replacing data.count == 0 with data.length == 0 now works.
Thanks for your help Phil.