Howto Saving Device Battery Level (or any device data) to Fuel Stream


#1

1) Give a description of the problem
logging battery state for a device in group when it changes.

2) What is the expected behaviour?
able to query or log extended data from a device in a device list

3) What is happening/not happening?
only names are being passed.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
logs say {dev.battery} is not defined, also tried with dev:battery and dev[battery]


#2

It may be as simple as changing your period to a colon…
(and the surrounding curly brackets into square brackets)


You may already know this, but here’s a few points worth mentioning:

  • A dataPoint can only contain numerical values (integers or decimals)
  • A dataPoint can not contain a string
  • Once created, a fuel stream canister can not be erased (so choose wisely)
  • Once created, a fuel stream name can not be erased (so choose wisely)
  • One piston can write to multiple names
  • Multiple pistons can write to the same name
  • Multiple dataPoints can be written to the same name, but then there is no way to distinguish between them
  • Long names can really fudge up the graph display (short & sweet is preferred)
  • Fuel Streams only retain data for 7 days. Anything past that drops off
  • If you accidentally store a string, the graph will error for 7 days until that bad dataPoint drops off at the end

With all that out of the way, here is two examples for a single device:

pic

Note: I recommend using the highlighted choice so your Fuel Streams do not get cluttered up!
(remember, you cannot edit them later!)


Pro Tip:

If you ignore my suggestion and use the names of the devices as the name of the dataPoint, then you will have to side scroll if there are more than a couple displayed at once. (and of course, if you ever change the name of the device, it will create a new dataPoint, and you will be stuck with a useless dataPoint that will never go away)

For example, in the cropped pic below, I use short names for both dataPoints and canisters… I can usually display about 7 dataPoints all at once. If I were to use longer names, it may only be able to display 2 or 3 without me side scrolling.


#3

Perfect, exactly what I was grasping for. You’re very detailed and thoughtful responce is very welcome. I’ve been playing with Fuel Streams for awhile now and they are def still “beta” but better than nothing.

Cheers!


#4

Sure thing… Glad to be able to help…


#5

testing now, will followup


#6

Similar piston that logs the temperature from various sensors, hit’s much more often. Much cleaner to read now. Seems to be working well, thanks again!


#7

Looking good!

Thanks for coming back to update the thread…


#8

just a followup in case anyone is considering implementing this. looks like Fuel Streams only saves data for about a week so logging battery level doesn’t work well for most devices as they tend to last much longer than a week. working okay for temp logging as long as you’re not interested in any data longer than a week.

WCMore did mention this in his reply above but I didn’t realize until after implementation that the week retention would make logging battery levels useless.


#9

You could always increase the number dataPoints in the fuel stream by changing your trigger. IE:

Every day at 2pm
    Write data point ...
END EVERY

It still only retains the past 7 days worth of data, but at least you will always have the latest battery level on display.