filipvh / hass-nhc2

Niko Home Control II Home Assistant Integration
MIT License
36 stars 26 forks source link

Add energy meter? #28

Open 86hakan opened 3 years ago

86hakan commented 3 years ago

Is there any plan to integrate energy meters?

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

Gavergracht commented 3 years ago

It would be cool to get the digital meter implemented

Tjaardv commented 3 years ago

It would be cool to get the digital meter implemented

You can install the DSRM integration in HASS

86hakan commented 3 years ago

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

Gavergracht commented 3 years ago

yes, that is what @86hakan

Gavergracht commented 3 years ago

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 ?

drnikcuk commented 3 years ago

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

joleys commented 2 years ago

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.

Gavergracht commented 2 years ago

How did you do it ?

joleys commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.