What's up, home? part 20
Janne Pikkarainen
SRE Operations Lead Site Reliability Engineer, GIAC GCIH, Zabbix 4.0 Certified Specialist at Forcepoint, blogger at Zabbix blog
Can you monitor your upcoming electricity bill with Zabbix? Of course you can! By day, I am a monitoring technical lead in a global cyber security company. By night, I monitor my home with Zabbix & Grafana Labs and make some weird experiments with them. Welcome to my weekly blog about the project.
With the current world events, the energy prices are soaring. But how much do I need to really pay next month for my electricity? Zabbix to the rescue!
(Yes, in Finland I can check that from my electricity company's page, but where's the fun in that?)
Fixed vs spot price
There are two kinds of electricity contracts you can subscribe in Finland: with fixed price, you can be sure your bill does not fluctuate that much from month to month, as you pay the same price per kilowatt for every hour of the day. In this kind of deal, the electricity company adds some extra to each kilowatt, so you will automatically pay some extra compared to electricity market price, but at least you don't get so badly surprised by market price peaks.
Then there's the spot price, where you pay only about the electricity market price. This can and will vary a lot depending on the hour of the day, but at least in theory this is the cheapest option in the long run. But, if the market price goes WAY up, like it tends to do in the winter, and now been peaking due world events, this can add to your bill.
Nordpool, please respond
There's Nord Pool ("Nord Pool runs the leading power market in Europe, offering day-ahead and intraday markets to our customers"), and there's a Python library for accessing Nord Pool electricity prices. With it, I could get hour-by-hour prices, but for this experiment, let's stick with the average kWh price. The example script on GitHub page shows all kinds of data, and for fun let's use Zabbix item processing to parse the average price from its output.
I now have the below script on running as a cron task every night, so my results will be updated once per 24 hours.
So, Zabbix then reads the file contents, like in so many of my previous blog posts.
领英推荐
Next, let's add some preprocessing. The regular expression part gets the Average value from the script output, and the custom multiplier changes the value from "Euros per Megawatt" to "Euros per Kilowatt", for it to be a familiar value for me from the electricity bills.
And... it's working! As I know our average consumption, let's add a new Grafana dashboard.
Four seasons
During summer, we don't actually use very much electricity compared to our harsh winter; for example, keeping our garage "warm" (about +10C) during winter contributes to our electricity bill quite a lot.
Here's a dashboards showing some guesstimations how expensive the different seasons will be for us. Or, hopefully cheap, if the long overdue new Olkiluoto 3 nuclear plant finally could operate at its full capacity here in Finland.
The guesstimate above is missing some taxes and electricity transfer prices, so the reality will be a bit more expensive than this. Maybe I should also add some triggers to Zabbix to make me alert about any really crazy price changes.
Anyway, now I can start gathering nuts for the cold winter as it seems that it will be an expensive one.
I have been working at Forcepoint since 2014 and I'm happy that my laptop does not consume too much electricity.