Yeah, using 32 would get you a big number, but you'd find that (if starting from 0) you'd get:
0,1,2,3....13,14,15,32,33,34...
when you wanted:
0,1,2,3....13,14,15,16,17,18...
I can't remember how you'd do it but I think really in node-red you'd just want some kind of global variable.
So basically:
When you get advertising, store that number using the parseInt stuff
Every 15 minutes, save the difference between your last advertising value and lastValue in your database, then make lastValue equal to the current advertising value.
But yeah, I'm definitely open to doing more on cloud connection. I'm actually working on a way to make this much easier as well - having the ability to use an old Android phone, ESP32, or Pi (or a combination) to get the data online.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yeah, using 32 would get you a big number, but you'd find that (if starting from 0) you'd get:
0,1,2,3....13,14,15,32,33,34...
when you wanted:
0,1,2,3....13,14,15,16,17,18...
I can't remember how you'd do it but I think really in node-red you'd just want some kind of global variable.
So basically:
lastValue
in your database, then makelastValue
equal to the current advertising value.But yeah, I'm definitely open to doing more on cloud connection. I'm actually working on a way to make this much easier as well - having the ability to use an old Android phone, ESP32, or Pi (or a combination) to get the data online.