Discovergy Power Meter

Hi guys, soon I will receive my Discovergy digital power meters and it would be very cool if they could be integrated in HA. I wonder if there are developers out there who could be interested in creating a component usable for noobs. Link to API https://api.discovergy.com/docs/
For me it appears Discovergy is quite popular for digital power metering.

Arnin

Hi Arnin,

I am also using Discovergy.

There is this library written in python (https://github.com/jpbede/pydiscovergy) to get the data out of Discovergy.

What I am doing is the following:

  • I created a AWS Lambda function that polls the data from Discovergy using pyDiscovergy. It is scheduled to run once per minute. I am not in particular proud of my code, but it works :slight_smile:

  • The lambda function dumps the output to the MQTT server.

  • In HA I added two new sensors like this:

    - platform: mqtt
      name: smart_meter_power
      state_topic: sensor/meter/EMH_0000000
      value_template: '{{ value_json.power / 1000 }}'
      unit_of_measurement: "W"
    - platform: mqtt
      name: smart_meter_energy
      state_topic: sensor/meter/EMH_0000000
      value_template: '{{ value_json.energy / 10000000000}}'
      unit_of_measurement: "kWh"
    

The limitation of my setup is:

  • It runs outside my home network. The smart meter has an open SSH port, but I have not found any credentials to log in.
  • By itself the smart meter publishes every 2 seconds, but with my setup, the highest resolution is 60 seconds. This could be circumvented, by running this somewhere else more often…

Does anybody have a better working solution running at the moment?

Stefan, many thanks for your reply and providing me a starting point! I will have to wait 4 more weeks until my power meters are getting installed. Will come back for sure.

Dear all,

unfortunately the German community around Home Assistens is still very small, on the other hand there are relatively many house automation approaches : OpenHab, ioBroker, Domoticz, FHEM
just to name a few.

So local things don’t progress so fast.
I would like to supplement the already mentioned links in the following:



In general, SmartMetering, power consumption analysis and optimization, does not seem to find such great interest worldwide.

But what is fast and easy with the Discovergy SmartMeter is the integration of a live widget into Home Assistant. Go to your discovergy user account and click “Measured values” > “Settings” > “Live widgets”. Here you have the possibility to create a large widget with all values.

You can copy and paste the link into your configuration.yaml as follows:

panel_iframe:
  discovergy:
    title: 'Discovergy'
    icon: mdi:flash-circle
    url: 'LINK'

3 Likes

one more vote for discovergy integration.

@Stefan_Ludwig would you mind sharing your solution in the meantime?

1 Like

I’d also be happy about an integration. I would also be interested in @Stefan_Ludwig exact solution until then.

Thanks!

Me also !THY in advance

bump… anything new here?

Hello all, one up for the feature request.

@Pete82, hast du die Anleitung schon schreiben können?

Many thanks to all the contributors!!!

Ralf

In the end I manager to feed my HA with Discovergy data using node red. There is NodeRed component that integrates with Discovergy, and using NodeRed addon of HA + custom integration from HACS, I have sensors automatically created in HA and updated every 30 secs.
Below is the flow if anyone is interested:

[{"id":"8ddd2d27.936a","type":"tab","label":"Discovergy","disabled":false,"info":""},{"id":"cc0fa644.621218","type":"inject","z":"8ddd2d27.936a","name":"Timer 30 sec","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":132.60000610351562,"y":98,"wires":[["fece26ba.33d878"]]},{"id":"6fd8825c.a47b3c","type":"debug","z":"8ddd2d27.936a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":761.6000556945801,"y":122.00000143051147,"wires":[]},{"id":"fece26ba.33d878","type":"Discovergy Meter","z":"8ddd2d27.936a","name":"awattar","account":"4d2f5c5e.10c5b4","meterId":"bc8e45d729c94bf6a0041058ff06e40e","firstReading":0,"firstReadingOut":0,"firstReadingDate":"","isProduction":false,"revenue":0,"amortization":0,"prodMeterId":"bc8e45d729c94bf6a0041058ff06e40e","firstReadingProd":0,"x":325.00000381469727,"y":98.00000095367432,"wires":[["d42a468a.a52b68","6fd8825c.a47b3c","766c32e3.e2705c","f5788ea2.08764","b38f4861.83dbd8"]]},{"id":"d42a468a.a52b68","type":"change","z":"8ddd2d27.936a","name":"currentpower_w","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.latest.power_w","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":464.00000762939453,"y":196.00000381469727,"wires":[["d3ea19f2.48eee8"]]},{"id":"d3ea19f2.48eee8","type":"ha-entity","z":"8ddd2d27.936a","name":"currentPower","server":"6236ec56.295c54","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"currentPower"},{"property":"device_class","value":"power"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"W"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":717.6000595092773,"y":199.00000381469727,"wires":[[]]},{"id":"766c32e3.e2705c","type":"change","z":"8ddd2d27.936a","name":"power1_w","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.latest.power1_w","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":438,"y":268,"wires":[["8d2cab98.296f58"]]},{"id":"f5788ea2.08764","type":"change","z":"8ddd2d27.936a","name":"power2_w","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.latest.power2_w","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":419,"y":348,"wires":[["893ef36f.b0e0e"]]},{"id":"b38f4861.83dbd8","type":"change","z":"8ddd2d27.936a","name":"power3_w","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.latest.power3_w","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430.0000050216913,"y":439.00000619888306,"wires":[["d36df1af.2be9"]]},{"id":"8d2cab98.296f58","type":"ha-entity","z":"8ddd2d27.936a","name":"power1_w","server":"6236ec56.295c54","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"power1_w"},{"property":"device_class","value":"power"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"W"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":655.0000076293945,"y":270.00000381469727,"wires":[[]]},{"id":"893ef36f.b0e0e","type":"ha-entity","z":"8ddd2d27.936a","name":"power2_w","server":"6236ec56.295c54","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"power2_w"},{"property":"device_class","value":"power"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"W"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":617.0000076293945,"y":361.00000381469727,"wires":[[]]},{"id":"d36df1af.2be9","type":"ha-entity","z":"8ddd2d27.936a","name":"power3_w","server":"6236ec56.295c54","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"power3_w"},{"property":"device_class","value":"power"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"W"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":603.0000076293945,"y":442.0000047683716,"wires":[[]]},{"id":"4d2f5c5e.10c5b4","type":"discovergy-config","z":"","name":"awattar"},{"id":"6236ec56.295c54","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
2 Likes

It would be nice if you could select discovergy as source for energy monitoring. Currently it doesn’t show up in the HA energy sources list.

I had to add following in my sensors.yaml to be able to use it as source for energy monitoring:

- platform: integration
  source: sensor.discovergy_total_power
  name: discovergy_live_consumption
  unit_prefix: k
  unit: kWh
  round: 2

@frenck eventhough this is quite a local german topic and therefore votes are less, it would be really appreciated if the request could be merged at some point.

I am also very interested in this integration. I plugged in the meter to my home network and can see it on the network, but there is no web interface or anything like that. I am quite new to this, so not 100% sure how to install the HACS integration here. I have HACS installed on home assistant, but I cannot find Discovergy.

I don’t know why I see this thread now. But I now have a python script which takes the values periodically from discovergy. It is not 100%accurate but for last month it was 1kwh wrong. That is good enough for me

My entities in the discovergy integragtion are unavailable. Checked their website and my meter is still reporting to it. Was working fine till the latest HA update. Any thoughts?

I have the same problem, discovergy doesn’t work anymore. The home assistant system log says following:

Error while setting up discovergy platform for sensor

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 293, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/discovergy/sensor.py", line 228, in async_setup_entry
    DiscovergySensor(
  File "/config/custom_components/discovergy/sensor.py", line 256, in __init__
    self.precision = precision
AttributeError: can't set attribute 'precision'

Yeah. Same issue here.

I learned that updating to 2023/2 help to make Discovergy working again…

Just installed v0.4.3 of the Discovergy Addon and it is working again.

Hello
Discovergy is not working. Even no entities were build…
It had worked till this morning…
Any ideas or the same issue?