# P1 smartmeter (API)

**URL:** <https://community.homey.app/t/p1-smartmeter-api/6150>\
**Category:** Apps\
**Created:** [January 1, 2019, 12:22pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150 "2019-01-01T12:22:22Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![Sjoerd\_Boerhout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sjoerd_boerhout/32/32441_2.png) [@Sjoerd\_Boerhout](https://community.homey.app/u/Sjoerd_Boerhout)\
**Post date:** [December 29, 2020, 10:20pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/101 "2020-12-29T22:20:03Z")

</div>

@Koktail, I managed to get the script running with some adjustments to the original script. I changed the init code for the serial port according to an example on [GitHub - reneklootwijk/node-dsmr: Parser for the DSMR protocol used on the P1 port of smart meters](https://github.com/reneklootwijk/node-dsmr#api)  
Now I receive readable values instead of rubbish.  
I will open a pull request on Github for the changes as soon as everything is working.

Now I get data visible in my Homey device, but not all. See screendump:

 ![Homey_P1smartmeter_missing-data](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/0/309654c89745bb143d0d7cbd092e647410d4cfb7.jpeg)  
**All 3 ‘current’ readings are missing, but the values are available in the data send to the Homey.**  
Note: I don’t have a connection to the gas network at my home.

Below the logging of the script with debug logging enabled (I added a few by myself)

> pi@raspberrypi:/home/pi/com.p1.smartmeter-dsmr.reader/src# node p1.js  
> {“message”:{“\_events”:{},“\_eventsCount”:0,“\_connection”:{“\_events”:{},“\_eventsCount”:0,“\_port”:“/dev/ttyUSB0”,“\_baudrate”:9600,“\_parity”:“even”,“\_databits”:7,“\_connection”:null,“\_connected”:false},“\_currentValues”:{}},“level”:“info”}  
> {“message”:“Connection.connect: Entering”,“level”:“debug”}  
> {“message”:“Connected using serial connection”,“level”:“debug”}  
> {“message”:“p1 smartmeter is connected!”,“level”:“info”}  
> /ISk5\2MT382-1003
> 
> 0-0:96.1.1(5A424556303035303933373337313132)  
> 1-0:1.8.1(11223.242_kWh)  
> 1-0:1.8.2(11337.393_kWh)  
> 1-0:2.8.1(00998.707_kWh)  
> 1-0:2.8.2(02222.431_kWh)  
> 0-0:96.14.0(0001)  
> 1-0:1.7.0(0000.35_kW)  
> 1-0:2.7.0(0000.00_kW)  
> 0-0:17.0.0(0999.00_kW)  
> 0-0:96.3.10(1)  
> 0-0:96.13.1()  
> 0-0:96.13.0()  
> !  
> ,0-0:96.13.0())9.00_kW)h)5303933373337313132)  
> {“message”:“SmartMeter: Telegram {"power":{"equipmentId":"ZBEV005093737112","totalConsumed1":11223.242,"totalConsumed2":11337.393,"totalProduced1":998.707,"totalProduced2":2222.431,"activeTariff":1,"actualConsumed":0.35,"actualProduced":0,"switchPosition":1},"gas":{},"meterModel":"ISk5\\2MT382-1003"}”,“level”:“debug”}  
> { power:  
> { equipmentId: ‘ZBEV005093737112’,  
> totalConsumed1: 11223.242,  
> totalConsumed2: 11337.393,  
> totalProduced1: 998.707,  
> totalProduced2: 2222.431,  
> activeTariff: 1,  
> actualConsumed: 0.35,  
> actualProduced: 0,  
> switchPosition: 1 },  
> gas: {},  
> meterModel: ‘ISk5\2MT382-1003’ }  
> {“message”:“p1 smartmeter update gas or power”,“level”:“info”}  
> {“message”:{“meterType”:“ISk5\2MT382-1003”,“electricity”:{“received”:{“tariff1”:{“reading”:11223.242,“unit”:“kWh”},“tariff2”:{“reading”:11337.393,“unit”:“kWh”},“actual”:{“reading”:0.35,“unit”:“kW”}},“delivered”:{“tariff1”:{“reading”:998.707,“unit”:“kWh”},“tariff2”:{“reading”:2222.431,“unit”:“kWh”},“actual”:{“reading”:0,“unit”:“kW”}},“tariffIndicator”:1,“switchPosition”:1,“voltageSags”:{},“voltageSwell”:{},“instantaneous”:{“current”:{“L1”:{“unit”:“A”},“L2”:{“unit”:“A”},“L3”:{“unit”:“A”}},“power”:{“positive”:{“L1”:{“unit”:“kW”},“L2”:{“unit”:“kW”},“L3”:{“unit”:“kW”}},“negative”:{“L1”:{“unit”:“kW”},“L2”:{“unit”:“kW”},“L3”:{“unit”:“kW”}}}}},“gas”:{“deviceType”:“003”,“unit”:“m3”}},“level”:“debug”}  
> {“message”:“SmartMeter: Updates {"power":{"equipmentId":"ZBEV005093737112","totalConsumed1":11223.242,"totalConsumed2":11337.393,"totalProduced1":998.707,"totalProduced2":2222.431,"activeTariff":1,"actualConsumed":0.35,"actualProduced":0,"switchPosition":1},"meterModel":"ISk5\\2MT382-1003"}”,“level”:“debug”}  
> {“message”:“posted successfully to: https://\*\*\*\*\*\*\*.connect.athom.com/api/app/com.p1/update”,“level”:“info”}

---

<div class="post-metadata">

**Author:** ![Chillout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chillout/32/29997_2.png) [@Chillout](https://community.homey.app/u/Chillout)\
**Post date:** [January 15, 2021, 9:48am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/102 "2021-01-15T09:48:39Z")

</div>

it’s almost like the actualConsumed is ignored for some reason… I have the exact same issue:

```
{ power:
   { equipmentId: ' ***************',
     totalConsumed1: ****.973,
     totalConsumed2: ****.046,
     totalProduced1: 0,
     totalProduced2: 0,
     activeTariff: 2,
     actualConsumed: 0.457,
     actualProduced: 0,
     failures: 2,
     failuresLong: 0,
     failureLog: [],
     voltageSagsL1: 2,
     voltageSwellsL1: 0,
     instantaneousVoltageL1: 230,
     instantaneousCurrentL1: 2,
     instantaneousConsumedElectricityL1: 0.457,
     instantaneousProducedElectricityL1: 0 },
  gas:
   { equipmentId: ' ***************',
     timestamp: 1610703600,
     totalConsumed: ****.938,
     reportedPeriod: 5 },
  meterModel: ' ***************',
  dsmrVersion: 5,
  timestamp: 1610703853 }

```

Homey can show the _totalConsumed1_ and _totalConsumed2_, and updates the gas values nicely. But it’s completely ignoring the values in _actualConsumed_ power.

Weird stuff.

---

<div class="post-metadata">

**Author:** ![Sjoerd\_Boerhout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sjoerd_boerhout/32/32441_2.png) [@Sjoerd\_Boerhout](https://community.homey.app/u/Sjoerd_Boerhout)\
**Post date:** [January 15, 2021, 3:44pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/103 "2021-01-15T15:44:11Z")

</div>

Due to the lack of response from the developer I installed the P1 monitor app on my Raspberry and Homey in the mean time. Advantage of that is that it saved all data and can show some nice graphs.

---

<div class="post-metadata">

**Author:** ![Koktail](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/koktail/32/51498_2.png) [@Koktail](https://community.homey.app/u/Koktail)\
**Post date:** [January 16, 2021, 8:23am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/104 "2021-01-16T08:23:54Z")

</div>

I haven’t see any PR request on GitHub. What’s the issue here?

---

<div class="post-metadata">

**Author:** ![Chillout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chillout/32/29997_2.png) [@Chillout](https://community.homey.app/u/Chillout)\
**Post date:** [January 16, 2021, 12:30pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/105 "2021-01-16T12:30:34Z")

</div>

I think this is the same issue:

> <https://github.com/koktaildotcom/com.p1.smartmeter/issues/30>
>
> I use DSMR Reader version 4.9; added the script https://github.com/koktaildotcom/com.p1.smartmeter-dsmr.reader
> and installed this app on the homey.
> Now this app shows me the...

---

<div class="post-metadata">

**Author:** ![Koktail](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/koktail/32/51498_2.png) [@Koktail](https://community.homey.app/u/Koktail)\
**Post date:** [January 16, 2021, 5:55pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/106 "2021-01-16T17:55:41Z")

</div>

Have you tried updating node-dsmr?

---

<div class="post-metadata">

**Author:** ![Sjoerd\_Boerhout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sjoerd_boerhout/32/32441_2.png) [@Sjoerd\_Boerhout](https://community.homey.app/u/Sjoerd_Boerhout)\
**Post date:** [January 17, 2021, 4:16pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/107 "2021-01-17T16:16:24Z")

</div>

As you can see in the loggings above the values seems to be sent correctly to the Homey, but are just not displayed in the Homey device.

---

<div class="post-metadata">

**Author:** ![b03tz](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/b03tz/32/35447_2.png) [@b03tz](https://community.homey.app/u/b03tz)\
**Post date:** [February 8, 2021, 2:36pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/108 "2021-02-08T14:36:08Z")

</div>

Somehow my gas usage is hundreds of m³ per hour, all the other values seem fine. Any idea as to why? Also my ‘current usage’ is not shown; but it is on the meter!

After a change to the posting script it shows my usage but negative. If I use 500 Watts…it shows as -500 watts…any idea as to why?

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [February 16, 2021, 8:04pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/109 "2021-02-16T20:04:32Z")

</div>

@Chillout & @Sjoerd_Boerhout This problem is also described [above](https://community.homey.app/t/p1-smartmeter-api/6150/72)

So P1 smart meter app calculates the current consumed and produced values based on resp. instantaneousConsumedElectricityL1 and instantaneousProducedElectricityL1, but also L2 & L3 values. If these are missing, calculation fails.

If you somehow add instantaneousProducedElectricityL2: 0, instantaneousProducedElectricityL3: 0 and instantaneousConsumedElectricityL2: 0, instantaneousConsumedElectricityL3: 0 it is working.

Would be better if P1 smart meter could handle L1 values alone. Looks like lot of people have smart meter without L2 & L3 values.

I discovered this with my solution:  
I wrote a Homeyscript to [scrape RAW P1 telegram message from youless device](https://wiki.td-er.nl/index.php?title=YouLess) and post this to the `/update/dsmrreader` endpoint. 🙂

---

<div class="post-metadata">

**Author:** ![Koktail](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/koktail/32/51498_2.png) [@Koktail](https://community.homey.app/u/Koktail)\
**Post date:** [March 2, 2021, 8:13pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/110 "2021-03-02T20:13:30Z")

</div>

I’ve just released V4.0.2 to test:

### v4.0.2 - 02.03.2021

- bugfix missing L1, L2, L3 (L1 L2 L3 values can be undefined)

---

<div class="post-metadata">

**Author:** ![Chillout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chillout/32/29997_2.png) [@Chillout](https://community.homey.app/u/Chillout)\
**Post date:** [March 9, 2021, 10:19pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/111 "2021-03-09T22:19:06Z")

</div>

Testing 🙂

Update:

It appears that with 4.0.2, there’s still no actual electricy usage showing with my setup.

```
    { power:
   { equipmentId: 'E00-----------17',
     totalConsumed1: 4266.173,
     totalConsumed2: 4631.341,
     totalProduced1: 0,
     totalProduced2: 0,
     activeTariff: 1,
     actualConsumed: 0.288,
     actualProduced: 0,
     failures: 2,
     failuresLong: 0,
     failureLog: [],
     voltageSagsL1: 2,
     voltageSwellsL1: 0,
     instantaneousVoltageL1: 233,
     instantaneousCurrentL1: 1,
     instantaneousConsumedElectricityL1: 0.288,
     instantaneousProducedElectricityL1: 0 },
  gas:
   { equipmentId: 'G00----------17',
     timestamp: 1615329004,
     totalConsumed: 4475.362,
     reportedPeriod: 5 },
  meterModel: 'XMX5LG--------86',
  dsmrVersion: 5,
  timestamp: 1615329287 }
```

---

<div class="post-metadata">

**Author:** ![Koktail](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/koktail/32/51498_2.png) [@Koktail](https://community.homey.app/u/Koktail)\
**Post date:** [March 10, 2021, 11:45am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/112 "2021-03-10T11:45:11Z")

</div>

The node-dsmr part is made by @ObelixNL, perhaps he can help you out.

---

<div class="post-metadata">

**Author:** ![ObelixNL](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/obelixnl/32/172250_2.png) [@ObelixNL](https://community.homey.app/u/ObelixNL)\
**Post date:** [March 14, 2021, 10:18am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/113 "2021-03-14T10:18:42Z")

</div>

@Koktail @Chillout Pull request is pending.

[Bugfix/support SDKv3 dsmreader by steffjenl · Pull Request #31 · koktaildotcom/com.p1.smartmeter (github.com)](https://github.com/koktaildotcom/com.p1.smartmeter/pull/31)

---

<div class="post-metadata">

**Author:** ![Koktail](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/koktail/32/51498_2.png) [@Koktail](https://community.homey.app/u/Koktail)\
**Post date:** [March 14, 2021, 12:13pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/114 "2021-03-14T12:13:06Z")

</div>

Thanks for looking into that. I’ll try to release it to test when I have the time for it.

---

<div class="post-metadata">

**Author:** ![Koktail](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/koktail/32/51498_2.png) [@Koktail](https://community.homey.app/u/Koktail)\
**Post date:** [March 16, 2021, 9:56am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/115 "2021-03-16T09:56:31Z")

</div>

I’ve just released 4.0.3 to test: [P1 Slimme meter | Homey](https://homey.app/nl-nl/app/com.p1/P1-Slimme-meter/test/)

### v4.0.3 - 16.03.2021

- bugfix upgrade dsmr reader

---

<div class="post-metadata">

**Author:** ![Luke\_Vredeveld](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/luke_vredeveld/32/33899_2.png) [@Luke\_Vredeveld](https://community.homey.app/u/Luke_Vredeveld)\
**Post date:** [April 5, 2021, 5:30pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/116 "2021-04-05T17:30:31Z")

</div>

same problem here. Just installed the latest version of node-dsmr but no live data is shown in homey. Is there already a fix known for this?

---

<div class="post-metadata">

**Author:** ![Ab\_Helversteijn-Smit](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ab_helversteijn-smit/32/10897_2.png) [@Ab\_Helversteijn-Smit](https://community.homey.app/u/Ab_Helversteijn-Smit)\
**Post date:** [May 1, 2021, 12:59pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/117 "2021-05-01T12:59:52Z")

</div>

Greet tool/app. Thank You for that. My question now is, is it possible to export the data to another platform also? As you probably would guess I am also maintaining a Domoticz database for many years and I want to compare data to last year I guess for now this is impossible with Homey.

Can I send a for example HTTPrequest to my door domoticz installation?

Thank you for helping me in advance.

Cheer Ab

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [May 1, 2021, 1:20pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/118 "2021-05-01T13:20:23Z")

</div>

> [@\[APP\]\[Pro\] Archive Insights - export all your Insights data to a NAS, FTP or web folder](https://community.homey.app/t/archive-insights-export-all-your-insights-data-to-a-nas-ftp-or-web-folder/10976):
>
> Export Insights Make a backup of all your insights to your NAS, FTP or WebDAV compliant storage. The insights are zipped and stored in .csv format so you can open them in excel and create all kinds of statistics and charts. The export also includes a JSON version of the data. Backups can be easily scheduled by using the trigger card in a flow. You can schedule a full backup, or a backup per app. To setup enter the local share (NAS) information and/or the webDAV info…

---

<div class="post-metadata">

**Author:** ![PV2134](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pv2134/32/16433_2.png) [@PV2134](https://community.homey.app/u/PV2134)\
**Post date:** [June 14, 2021, 9:18pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/119 "2021-06-14T21:18:56Z")

</div>

Sames issue persists. Today finally installed the cable on my RPI 4B. All is functioning well except the current power variabele. The data is there, but somehow not imported by the app:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/0/e0280d418aecdaffb98aa4e903061fb1eba8e318.png)

However, the device capabilities in the Developer Tools shows “null”.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/6/c61668b3bf490270414ca7abcd7c14b864c5aeda.png)

No more replies in 2 months on this thread, this cannot or shall not be resolved then (or maybe already is resolved)?

Peter

---

<div class="post-metadata">

**Author:** ![rgruyters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rgruyters/32/42134_2.png) [@rgruyters](https://community.homey.app/u/rgruyters)\
**Post date:** [June 27, 2021, 7:55pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/120 "2021-06-27T19:55:41Z")

</div>

Question, looks like the values are not shown correct or they are not correctly collected. When I look at the values of “huidig verbruik” and “teruglevering” they should be switched. (see screenshots)

Same goes for the values in the evening, they are negative.

 ![Screenshot 2021-06-27 at 21.52.51](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/0/b0789370916fcdfa1a96b59eaeb8bc7c6b56591b.png)

[Previous page](https://community.homey.app/t/p1-smartmeter-api/6150.md?page=5)

[Next page](https://community.homey.app/t/p1-smartmeter-api/6150.md?page=7)
