hass-nhc2 icon indicating copy to clipboard operation
hass-nhc2 copied to clipboard

Add energy meter?

Open 86hakan opened this issue 3 years ago • 11 comments

Is there any plan to integrate energy meters?

I have many meters in my installation and can be a test person.

86hakan avatar Sep 19 '21 19:09 86hakan

It would be cool to get the digital meter implemented

Gavergracht avatar Sep 30 '21 18:09 Gavergracht

It would be cool to get the digital meter implemented

You can install the DSRM integration in HASS

Tjaardv avatar Oct 01 '21 11:10 Tjaardv

Ok. But what i want to integrate is the meters from niko home control.

86hakan avatar Oct 01 '21 18:10 86hakan

yes, that is what @86hakan

Gavergracht avatar Oct 03 '21 09:10 Gavergracht

Is there any plan to integrate energy meters?

I have many meters in my installation and can be a test person.

did you find something on the internet yet ?

Gavergracht avatar Oct 15 '21 17:10 Gavergracht

I recent played around a bit with OpenHAB, they have support for the Electricity Pulse meters from Niko so it's defo doable ....

drnikcuk avatar Oct 21 '21 09:10 drnikcuk

I was able to get the electrical energy meter (with clamps) into HA. At the moment I get the real-time measurement with the standard 2 second update interval. However, for the HA Energy functionality, a summation or kWh value is needed. The math for that needs to be added.

joleys avatar Oct 30 '21 09:10 joleys

How did you do it ?

Gavergracht avatar Oct 30 '21 09:10 Gavergracht

How did you do it ?

On my laptop is a copy of HA for development purposes. I've copied the NHC2 integration form @filipvh and changed all dependencies to use local files. This gets rid of the nhc2-coco dependency and allows for flexible testing. I've coded an extension of both hass-nhc2 and nhc2-coco to initiate the MQTT message generation and process the results. Since I'm not a GitHub push/pull hero, it will take some time to create the pull request. I'll try to find some spare time this weekend.

joleys avatar Oct 30 '21 09:10 joleys

Pull request issued. In addition to the code posted, I've added the following in configuration.yaml:

sensor:
  - platform: integration
    source: sensor.elektriciteitsmeting
    name: energy_elektriciteit
    unit_prefix: k
    round: 3
    method: left

utility_meter:
  energy_daily:
    source: sensor.energy_elektriciteit
    cycle: daily
  energy_monthly:
    source: sensor.energy_elektriciteit
    cycle: monthly

This will calculate daily and monthly totalizers (kWh). Source: https://community.home-assistant.io/t/2021-8-new-energy-feature-in-ha-conversion-from-w-to-kwh/328830

joleys avatar Oct 30 '21 20:10 joleys

On the other hand Niko has the 'energy home' device model, which has more energy information available. Would this be the preferred path forward? My solar panels are not compatible with NHC so I'm not able to test the full functionality.

Who could integrate the above sensor and utility meter into the NHC sensor in my pull request? This would make the setup a lot easier.

joleys avatar Oct 31 '21 19:10 joleys