more G-Labs products

Author Topic: My data persistent with chart (Generic Monitor)  (Read 603 times)

October 31, 2016, 06:12:04 PM
Read 603 times

fra290

  • *
  • Information
  • Newbie
  • Posts: 15
For my fish tank I have develop one new module for data persistence with relative widget able to plot the data on a chart.
I’m not a coder and I'm newbie in HG, probably is possible optimize the code and add new error control.
I have used "rrdtools" (http://oss.oetiker.ch/rrdtool/ ) a little "vintage" library but very light and fast (run fine on my hold raspberry)

Features
  • Make and manage rrd database for any sensor enabled with this data:
    • Current day with 1 minute of data resolution
    • Last week with 5 minutes of data resolution 
    • last month, resolution 20 minutes
    • last year, resolution 5 hours
  • Makes available one virtual module for any sensor enabled with:
    • Value
    • Unit of measure
    • Small chart
    • Control buttons for data range visualization
  • Popup menu with large data chart

Compatibility and limitations
  • At the moment GenericMonitor is compatible with a sensor module, I test it with MCP3008 Analog Input Module but probably run fine also with My Sensor but I don’t test it:
  • The name of Sensor can’t contain special character, the only character managed is " ", sorry but with python I was not able to encode/decode the name of module, at the moment I only substitute " " with "%20"
  • Widget was designed to work with "C" theme (light grey)
  • The database is updated every Heartbeat time for every sensor managed, system write some data whenever on flash memory, this is not very good for the flash memory life, I suggest to use one different location for system and database (i.e USB flash stick), is possible configure the path of database on ChartModule setup.

Install
  • Install rrdbtool
Code: [Select]
sudo apt-get install rrdtool
  • copy images
Code: [Select]
cp monitor.png /usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/images
cp chart*.png /usr/local/bin/homegenie/html/images
  • install program and widget on home genie
    • Chart_Monitor.hgx
    • homegenie_generic_monitor.zip
  • Open the setup page for sensor module and check  “Enable Chart Module”, fill all other parameter:
    • Unit of mesure
    • Min Max: set the range of value, warning, if the data run out of this range will be void
    • Heartbeat is very critical, I recommend set this value as a double or triple of the data sampling.
  • Now restart the ChartMonitor for build the databases.
I'm waiting feeback, Thank You
  MArco
 

November 14, 2016, 04:02:47 PM
Reply #1

HGexperimenter

  • **
  • Information
  • Jr. Member
  • Posts: 42
Hi,
Is there a link to the HG source code?
Thanks!

November 14, 2016, 06:22:20 PM
Reply #2

raptorjr

  • ***
  • Information
  • Full Member
  • Posts: 78
I think it is in the .rar file.