Energy usage, Zabbix & Home Assistant

I’m using Home Assistant (HAS) to operate and monitor lights, audio and weather. And as HAS has an Zabbix integration I got all my data in Zabbix. But since Zabbix 6.4 there are some breaking changes in the Zabbix Api. Although small, I reported a bug on 29th of january. I guess it has no priority. Instead of waiting I was inspired by Janne (a cool fellow with a zabbix heart) to use the http agent functionality within Zabbix and getting the information I needed from HAS. What I really missed was my energy consumption compared to the weather outside which I futher use to make my house more energy neutral.

HAS

There is a step you must take so Zabbix can communicate directly to HAS. First create a long-lived access token (under user settings).

HAS long-lived access token

Put it away somewhere save, you will need this to gain api access later on.

Zabbix

First create an empty host within Zabbix, you can ignore the creation of an interface as all work is done by Zabbix (or one of his proxies) itself.

Zabbix host

Next, create an item on that host using type “http agent” and fill in the necessary information.

Http agent item

On the third tab, adjust the preproccesing step.

Preproccesing

Do not forget your Bearer token in the headers option.
In short what this does is getting energy consumption from HAS concerning the L1 phase in my home fuse box. But there is more, a lot more info we can pull out of our HAS installation. This is just an example.

If you want a more complete setup, visit my Git page where you can find a template which I currently use.

incama Written by:

Currently working as a Senior Technical Infrastructure admin at a large hospital, former owner of a single person web design company, in love with my wife, trying to cook out of my league, Bitcoin enthusiast, Open Source Don Quichot, human Cat slave.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *