Graphing cubic meters gas usage

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

Post Reply
User avatar
Gluntzmaster
Posts: 17
Joined: Wed Oct 13, 2010 4:53 am

Graphing cubic meters gas usage

Post by Gluntzmaster »

Running Cacti 1.2.22 on a freshly installed Ubuntu jobby.

I've a 'smart' energy meter where I plugged a dongle in that can be queried by means of a script.
The Gas counter yields a number with three decimals. The decimal part is a fraction of a cubic meter gas usage, so I'd like to keep an eye on this decimal part, that's where the movement is

For instance my current gas counter is at 6526.853 M^3

Graphing this with COUNTER or GAUGE doesn't quite show enough granularity, it shows a pillar of 6526, the decimal changes aren't visible.

Same applies to KWH counters. What do you reckon how to best visualise these numbers?

Thanks,
Leo
You'll have to pay me to use Windows
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Graphing cubic meters gas usage

Post by TheWitness »

Make sure you only return the decimal portion and nothing past the last digit. Trim the string with whatever language you are using.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
Gluntzmaster
Posts: 17
Joined: Wed Oct 13, 2010 4:53 am

Re: Graphing cubic meters gas usage

Post by Gluntzmaster »

I gathered as much, thanks for conforming that. Using $rest=substr($net,4) in my php kludge seems to pan out.

Time for some experimentation, thanks for your support !

Leo
You'll have to pay me to use Windows
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Graphing cubic meters gas usage

Post by TheWitness »

I would do something like

Code: Select all

$value = explode(' ', $value)[0];
The breaks the string into number + units and leaves you just the value removing the units from the value.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
Gluntzmaster
Posts: 17
Joined: Wed Oct 13, 2010 4:53 am

Re: Graphing cubic meters gas usage

Post by Gluntzmaster »

I've been experimenting on and off with getting some sensible graphs out of my household's power meter. And yes, it can be done to some degree. Cacti accepts scripting just fine, it is up to the user to get some sensible results. Fortunately Cacti developers like The Witness are gladly lending assistanse.

That said, I have come to the conclusion that Cacti really comes to its own when it is used for what it originally intended to be a device grapher, preferably on the basis of SNMP.
A friend pointed me to Home Assistant, which is also an open source development geared towards IOT graphing. A breeze to set up in a virtual box VM, and a wealth of pre-cooked solutions.

I will never be able to compete with that in my efforts to achieve similar results in Cacti, especially when I compare it with the ease of setting up and maintaining a Home Assistant environment.

So I'm back to using Cacti for device management, and pinging stuff out there and this Home Assistant for all things IOT. Trying to get Cacti jump through hoops has had its value though, I learned a lot during this experiment.

@The Witness, as always thanks for your kind assistance !

Bye,
Leo
You'll have to pay me to use Windows
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Graphing cubic meters gas usage

Post by TheWitness »

Leo,

I love the byline. Me and Windows go back to version 2.4 (very old circa 1984), and I could not agree more. For me it's a web browser and access to putty, github desktop and a few other niceties. From a Cacti and more broadly a monitoring perspective, Microsoft keeps breaking things that should remain unbroken in an effort to fix all the bugs introduced throughout the years and making harder and harder to unbreak them. It's like playing twister. The older we get, the harder it is to play.

Anyway, WRT Home Assistant, I hear you. Can you describe how it works? I would appreciate it.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
Gluntzmaster
Posts: 17
Joined: Wed Oct 13, 2010 4:53 am

Re: Graphing cubic meters gas usage

Post by Gluntzmaster »

https://www.home-assistant.io is where everything about this community effort lives.
In short:
Easiest way of setting it up is configuring a VM in virtual box, plonk the HomeAssist precooked VM in there, have it access your LAN and let it scan your network. Once done you have access to
"Integrations"
Integrations.png
Integrations.png (390.85 KiB) Viewed 4482 times

it has built in translators/api's for a whole host of devices and IOT gateways, like the home gateway for Ikea, NetAtmo, Somfy, etc.
The main use is twofold, you can build your own dashboard, and have the environment respond to scripts and automations based on the status of the monitored devices, and IFTTT rules you set up

Setup of a Dashboard is lemon squeezy
Dash_1.png
Dash_1.png (293.13 KiB) Viewed 4482 times
where the graphs are pretty much pre-cooked, and the user can latch the graphs on to the device and its functions (entities) to extract the data for the graph.

Next to eye candy you can also get some more down to earth graphs that are similar to what you can achieve in Cacti. as you can see in the Dash-2 image.
Dash_2.png
Dash_2.png (389.56 KiB) Viewed 4482 times
It is real easy to set these dashboards up. The Dash-1 image is a snazzy dash for the current state of things.

Mind you, all the server does is interrogate a dongle I've inserted in the home's smart energy meter, and the solar converter for which I have an API key.
The energy meter is queried once every second. (let that sink in... ) this dongle is a chatty little device. Makes me kind of feel like an old coot, forever trying to conserve bandwith for the users instead of metering and monitoring.. That was back then..

So there you have it, a short rundown on HomeAssistant from a cacti perspective. Lots of graph types, you can create Cacti style graphs bu cacti at present can't present the gauges and other eye-candy that H.A. can.

It's fun to set up, has a decent foundation and active community and is packed with features.

Bye,
Leo
Attachments
Entities.png
Entities.png (213.43 KiB) Viewed 4482 times
You'll have to pay me to use Windows
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Graphing cubic meters gas usage

Post by TheWitness »

Wow, that's too connected of a house ;) But it all looks good. The advantage of a small setup like this, and the strength of the streaming protocol, is that you can sustain 1 second updates from even dozens of devices. It's real nice.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests