# 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:** 7

<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:56pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/121 "2021-06-27T19:56:16Z")

</div>

Here is the other screenshot. (not allowed to post than 1 image due to new user status)

 ![Screenshot 2021-06-27 at 21.53.07](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/d/7db25d58872281852118d7ce5c9de6a68ba5d645.png)

---

<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:** [June 28, 2021, 5:26am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/122 "2021-06-28T05:26:55Z")

</div>

Don’t know what courses your issue. Can you send a diagnostic log to the developer?

---

<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:** [June 28, 2021, 5:28am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/123 "2021-06-28T05:28:20Z")

</div>

What’s invalid from your point of view?

---

<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 28, 2021, 6:00am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/124 "2021-06-28T06:00:39Z")

</div>

Sure! `df3bda2f-a396-41fa-8132-eec8de052fde`.

The values “terug levering” and “huidig verbruik” should be switched.

As now my usage in the evening, when the sun is down, is zero. (which is not true)

---

<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:** [June 28, 2021, 6:20am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/125 "2021-06-28T06:20:28Z")

</div>

Yes, they are flipped around. And also weird is that during the day you always seem to use energy (it is not zero), even though you seem to be delivering to the grid most of the time.

Do you have 3-phases maybe?

Or do you live in Belgium? I think the smart meters there report reversed, so that matches your experience with flipped results.

---

<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 28, 2021, 7:45am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/126 "2021-06-28T07:45:02Z")

</div>

Yeah I have 3 phases. No i live in the Netherlands

---

<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:** [June 28, 2021, 8:10am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/127 "2021-06-28T08:10:34Z")

</div>

> [@rgruyters](#):
>
> Yeah I have 3 phases

Ah, when your usage is on 3 phases but your production is only on one phase, it explains why you still consume power even when your production is way higher.

Weird that your usage and production are switched. Did they give you a Belgian smart meter🤪?

---

<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 28, 2021, 8:14am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/128 "2021-06-28T08:14:06Z")

</div>

> [@Gruijter](#):
>
> Ah, when your usage is on 3 phases but your production is only on one phase, it explains why you still consume power even when your production is way higher.

Is this fixable?

---

<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:** [June 28, 2021, 9:58am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/129 "2021-06-28T09:58:49Z")

</div>

To fix it you need a 3 phase inverter that feeds your production to the grid.

Or alternatively change your grid connection to only 1 phase, so you always use from the same phase as the one you are producing into. But if you for some reason need 3 phases that will not be possible (e.g. you have a 3 phase car charger, or high power demands in house)

---

<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 28, 2021, 11:22am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/130 "2021-06-28T11:22:45Z")

</div>

We have 3 phases due to charger for our car.

Will dive into [GitHub - koktaildotcom/com.p1.smartmeter-dsmr.reader](https://github.com/koktaildotcom/com.p1.smartmeter-dsmr.reader) to find a way to correct the values.

It worked fine when using DSMR on Home Assistant.

I saw that the node-dsmr has fixed this in release 0.1.18. [Consumed and Produced values for phases seem reversed? · Issue #5 · reneklootwijk/node-dsmr · GitHub](https://github.com/reneklootwijk/node-dsmr/issues/5)

---

<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 28, 2021, 11:39am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/131 "2021-06-28T11:39:27Z")

</div>

I have just upgraded node-dsmr to 0.1.21 (latest release) and shows the correct values now.

---

<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 29, 2021, 1:38pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/132 "2021-06-29T13:38:09Z")

</div>

UPDATE: No it didn’t. It looked like it was working but apparently not…

---

<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:** [July 11, 2021, 6:15pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/133 "2021-07-11T18:15:59Z")

</div>

Hi,

Can you please help me? I tried everything you where talking about but still rubbish. What do I do wrong:

```auto
{"message":"posted successfully to: https://xxxxxxxxx.connect.athom.com/api/app/com.p1/update","level":"info"}
{"message":"Unknown id: 0-0:96.�.�(�B����3�303035303�3�3�3�3�3�3�3���","level":"debug"}
{"message":"Unknown id: �-0:�.�.�(����0.5�0���詍","level":"debug"}
{"message":"Unknown id: �-0:�.�.�(���03.653���詍","level":"debug"}
{"message":"Unknown id: �-0:�.�.�(0�935.�55���詍","level":"debug"}
{"message":"Unknown id: �-0:�.�.�(06���.�3����詍","level":"debug"}
{"message":"Unknown id: 0-0:96.��.0(000���","level":"debug"}
{"message":"Unknown id: �-0:�.�.0(0000.00��ש�","level":"debug"}
{"message":"Unknown id: �-0:�.�.0(0000.0���ש�","level":"debug"}
{"message":"Unknown id: 0-0:��.0.0(0999.00��ש�","level":"debug"}
{"message":"Unknown id: 0-0:96.3.�0(���","level":"debug"}
{"message":"Unknown id: 0-0:96.�3.�(��","level":"debug"}
{"message":"Unknown id: 0-0:96.�3.0(��","level":"debug"}
{"message":"Unknown id: 0-�:��.�.0(3��","level":"debug"}
{"message":"Unknown id: 0-�:96.�.0(3�3�3�303�353�3�3�303039303�3�3�3���","level":"debug"}
{"message":"Unknown id: 0-�:��.3.0(��0����00000�(00�(60�(��(0-�:��.�.��(�3��","level":"debug"}
{"message":"Unknown id: 0-�:��.�.0(���","level":"debug"}
{"message":"SmartMeter: Telegram {\"power\":{},\"gas\":{}}","level":"debug"}
{"message":"p1 smartmeter update gas or power","level":"info"}
{ meterType: undefined,
  version: undefined,
  timestamp: undefined,
  electricity:
   { received: { tariff1: [Object], tariff2: [Object], actual: [Object] },
     delivered: { tariff1: [Object], tariff2: [Object], actual: [Object] },
     tariffIndicator: undefined,
     switchPosition: undefined,
     voltageSags: { L1: undefined, L2: undefined, L3: undefined },
     voltageSwell: { L1: undefined, L2: undefined, L3: undefined },
     instantaneous: { current: [Object], power: [Object] } },
  gas:
   { deviceType: '003',
     equipmentId: undefined,
     timestamp: undefined,
     reading: undefined,
     unit: 'm3',
     valvePosition: undefined,
     reportedPeriod: undefined } }
{"message":"posted successfully to: https://xxxxxxxxxxx.connect.athom.com/api/app/com.p1/update","level":"info"}

When I read the port with 9600,7,none I see the correct data only screen. Am I using the wrong software for my meter maybe ?

Data send is something similar to:

/ISk5\2ME382-1003

0-0:96.1.1(4B414C37303035303732383432343131)
1-0:1.8.1(21140.519*kWh)
1-0:1.8.2(14703.653*kWh)
1-0:2.8.1(02935.753*kWh)
1-0:2.8.2(06727.238*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(0000.00*kW)
1-0:2.7.0(0000.03*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-1:24.1.0(3)
0-1:96.1.0(3238313031353431313030393032383131)
0-1:24.3.0(210711200000)(00)(60)(1)(0-1:24.2.1)(m3)
(11630.332)
0-1:24.4.0(1)
!

```

Thanks for helping me out  
Abel

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [July 11, 2021, 6:27pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/134 "2021-07-11T18:27:00Z")

</div>

I think this is DSMR2.2 format, it looks very similar to my meter (which is an MT382). I have no idea if the P1 app supports that format (it’s rather old).

As for the rubbish, the serial line protocol settings should be:

- 9600bps
- 7 bits data
- even parity
- 1 stop bit
- inverted (but I expect your reader to handle that properly already)

---

<div class="post-metadata">

**Author:** ![Ruben\_Vallinga](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ruben_vallinga/32/19907_2.png) [@Ruben\_Vallinga](https://community.homey.app/u/Ruben_Vallinga)\
**Post date:** [September 15, 2021, 7:23pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/135 "2021-09-15T19:23:43Z")

</div>

Before i used the standalone script on raspberry pi, working great.  
Now I am using DSMR reader with plug-in tot homey. Live usage is working fine, but total usage is calculated including export energy?

I tried to delete an add the p1 device is homey, without result.

Someone knows where it goes wrong?  
Thanks!

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/5/75ab93c2a923c30980c7b17baaf646160555be2e.jpeg)

---

<div class="post-metadata">

**Author:** ![Michel\_Vorenhout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/michel_vorenhout/32/48286_2.png) [@Michel\_Vorenhout](https://community.homey.app/u/Michel_Vorenhout)\
**Post date:** [June 19, 2022, 9:21am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/136 "2022-06-19T09:21:14Z")

</div>

@Koktail May we assume this project is dead, or is it sleeping?

I can confirm that out of the box there is no data at all in Homey.

---

<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:** [June 24, 2022, 11:05am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/137 "2022-06-24T11:05:55Z")

</div>

The project is still stable. What issue do you have?

---

<div class="post-metadata">

**Author:** ![Michel\_Vorenhout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/michel_vorenhout/32/48286_2.png) [@Michel\_Vorenhout](https://community.homey.app/u/Michel_Vorenhout)\
**Post date:** [June 24, 2022, 1:18pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/138 "2022-06-24T13:18:22Z")

</div>

Good to know. I have the issue as others before: no data is shown in Homey. Ruben has a part of the data missing, but I don’t see anything.  
Setup is DSMR read on PI3B+, plugin and homey. CloudID is correctly entered. Not sure how to debug it, as I can’t seem to find any error log on the Pi nor Homey.

---

<div class="post-metadata">

**Author:** ![Ronald\_den\_Otter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronald_den_otter/32/73289_2.png) [@Ronald\_den\_Otter](https://community.homey.app/u/Ronald_den_Otter)\
**Post date:** [June 21, 2023, 1:39pm UTC](https://community.homey.app/t/p1-smartmeter-api/6150/139 "2023-06-21T13:39:59Z")

</div>

Dit zelfde gedaan op de Homey Pro 2023. Ontvangt de data en geeft geen fouten. Maar ik zie niets op de meters

---

<div class="post-metadata">

**Author:** ![lucasvdh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/lucasvdh/32/54915_2.png) [@lucasvdh](https://community.homey.app/u/lucasvdh)\
**Post date:** [October 30, 2023, 10:37am UTC](https://community.homey.app/t/p1-smartmeter-api/6150/140 "2023-10-30T10:37:44Z")

</div>

Hi @Koktail,

I’ve just addressed an edge-case issue in the DSMR reader. This fix resolves a recent problem I faced with duplicated registered generated power when transitioning from single-phase to triple-phase power.

> <https://github.com/koktaildotcom/com.p1.smartmeter-dsmr.reader/pull/27>
>
> \# Fix for incorrectly defaulted values
> 
> \## Summary
> This pull request addresse…s an issue related to the reporting of electricity consumption and production values for triple-phase power.
> 
> \## Context
> After installing a new power meter, I transitioned from single-phase to triple-phase power. However, the existing reader began reporting incorrect values. The issue arises from a unique edge-case scenario: most of my home is connected to the first phase, while solar panels are connected to the second phase. This results in power consumption on the first phase and power generation on the second phase.
> 
> \## Problem
> The discrepancy occurs in the calculation of \`electricity.instantaneous.power.negative.L1\` due to the defaulting behavior of \`output.power.instantaneousProducedElectricityL1\`:
> 
> \`\`\`node
> output.power.instantaneousProducedElectricityL1 || output.power.actualProduced || 0,
> \`\`\`
> 
> This defaulting behavior should only apply when \`output.power.instantaneousProducedElectricityL1\` is \`undefined\`, not when it is \`0\`.
> 
> \## Solution
> A new function \`getDefaultedValue\` has been introduced to handle the defaulting behavior. It iterates through provided arguments and returns the first non-undefined value or 0 if all provided arguments are undefined:
> 
> \`\`\`node
> function getDefaultedValue(...args) {
> for (let arg of args) {
> if (arg !== undefined) {
> return arg;
> }
> }
> return 0;
> }
> \`\`\`
> 
> \## Example
> \`\`\`node
> const output = {
> power: {
> actualProduced: 123,
> instantaneousProducedElectricityL1: 0
> }
> }
> 
> // Incorrectly outputs 123
> console.log(output.power.instantaneousProducedElectricityL1 || output.power.actualProduced || 0)
> 
> // Correctly outputs 0 
> console.log(getDefaultedValue(output.power.instantaneousProducedElectricityL1, output.power.actualProduced))
> \`\`\`
> 
> This change ensures that the defaulting behavior operates as intended, addressing the reported discrepancies.

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

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