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

So, ich denke mal Discovergy SmartMeter ist wohl eher ein Produkt was in Deutschland interessant ist.
Daher poste ich jetzt mal in deutsch, da ich davon ausgehe das alle aktiven hier ebenfalls der deutschen Sprache mächtig sind.

@Stefan_Ludwig
Der Ansatz mit mqtt ist ja schon eine feine Sache, allerdings störe ich mich noch ein wenig an dem Umweg über AWS Lambda. Um das ganze lokal abzuhandeln z.B. auf einem RPI etc. würde es aktuell also an einem Skript fehlen welches die Daten dann ein mqtt Topic erstellt!?
Tendenziell müsste es ja ähnlich wie mit den Tuya Steckdosen funktionieren wie hier: Tuya Switches w/ Power Usage Data (No TuyaConvert Needed)

tl;dr: I will see if I can find the time to clean it up a bit and share the script.

Hi Fritz,

ich sehe die Nachrichten erst jetzt.

Ich schaue mal, dass ich das ganze ein wenig schöner mache und mit Euch teile. Eine eigene componente für Home-Assistant wäre natürlich etwas feines, aber ich weiß nicht, ob da meine rudimentären python skills ausreichen. Ich werds mich am nächsten regnerischem Wochenende aber mal dran versuchen.

Hi Stefan,

ich habe mir auch schon mal die HA Dokumentation zu Integrationen angesehen, aber das ist doch etwas umfangreich wenn man es mal nebenbei machen möchte. Zum anderen sind meine Python Skills noch etwas weiter unter rudimentär lach // Muss da endlich mal bei…

Wie sagt man so schön halb kopiert ist gut programmiert…

Befasse mich nebenher immer nochmal mit OpenHab und ioBroker aber momentan kommt für mich nichts an HA vorbei (Ressourcen schonend) obwohl ich die Abkehr von Hassbian schon unsympathisch finde. Aber insgeheime bündelt es ein wenig die Hoffnung das vielleicht die Entwicklung etwas schneller voran geht.

Was uns hier aber echt fehlt ist eine deutsche Community ich denke das hält auch den ein oder anderen kreativen Kopf ab…

Hallo zusammen,

ich habe dies mittlerweile mit dem Script “pydiscovergy” und einigen eigenen Ergänzungen und mit Hilfe eines anderen Forums, bei mir lokal (RPI–> MQTT --> Home Assistant) zum Laufen gebracht. Derzeit wird die API von Discovergy alle 10 Sekunden abgefragt. Dies ist im Script aber anpassbar.
Ich werde versuchen dies die Tage zu dokumentieren und Euch zur Verfügung zu stellen.

image

3 Likes

Hallo Peter,
klasse “pydiscovery” hatte ich auch schon auf der Watchlist und wollte damit basteln, aufgrund diverser anderer Dinge aber noch nicht dazu gekommen :slight_smile:
Sieht schon sehr gut aus, freue mich mehr dazu zu lesen…

Dann kann ich ja vielleicht doch irgendwann mal korrekt analysieren:
Dezentrale Warmwasserversorgung vs. Zentrale bei anliegender Fernwärme- Heizung usw. usw.

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

Kannst du uns an deinem Script teilhaben lassen?

Hi,

ich bin gerade auf HA aufmerksam geworden und wollte meinen Stromverbrauch durch Discovergy einbinden.
Was ist die “einfachste/schnellste” möglichkeit?
Ich würde ungerne ein woanders noch ein Script laufen lassen.

Ich hatte mir node-red angeschaut jedoch bisher noch nie mit gearbeitet demnach etwas überfordert.

@p1ranha could you explain how yopu integratet the meter via node-red? I never worked with node-red so no idea where to start.

1 Like

Auch wenn es schon eine Weile her ist, würde ich gerne das Script haben wollen :wink:

Hallo Zusammen,

Ich bin zwar auch noch recht neu dabei aber hier sieht das garnicht mal schlecht aus.

  1. es gibt einen PR für eine offizielle integration
  1. ich habe das ganze einfach mal als HACS gepackaged (der gleiche code nur einfach nachinstallierbar)

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