Andy
(Andy)
November 29, 2019, 11:00am
1
Hi,
I’m running hassio on a desktop system that is on the 3rd floor but i have a raspberry with P1 Monitor (P1 Mon connected to my Smart Meter with a P1 cable on the first floor.
And i can’t find a way to use the component DSMR to connect to the P1 Mon system.
Does anybody has this running ? And how did you did it ?
Solution : P1 Monitor does have API links that you could use to retrieve data into HA.
Example sensor.yaml:
- platform: rest
resource: http://ip.adress.p1.mon/api/v1/smartmeter?limit=1&json=object&round=on
name: Huidig verbruik
value_template: '{{ value_json.0.CONSUMPTION_W }}'
unit_of_measurement: "W"
- platform: rest
resource: http://ip.adress.p1.mon/api/v1/smartmeter?limit=1&json=object&round=off
name: Meterstand hoog
value_template: '{{ value_json.0.CONSUMPTION_KWH_HIGH | round(2) }}'
unit_of_measurement: "kWh"
- platform: rest
resource: http://ip.adress.p1.mon/api/v1/smartmeter?limit=1&json=object&round=off
name: Meterstand laag
value_template: '{{ value_json.0.CONSUMPTION_KWH_LOW | round(2) }}'
unit_of_measurement: "kWh"
- platform: rest
resource: http://ip.adress.p1.mon/api/v1/financial/day?limit=1&json=object&round=off
name: Kosten Hoog Tarief
value_template: '{{ value_json.0.CONSUMPTION_COST_ELECTRICITY_HIGH | round(2) }}'
unit_of_measurement: "€"
- platform: rest
resource: http://ip.adress.p1.mon/api/v1/financial/day?limit=1&json=object&round=off
name: Kosten Laag Tarief
value_template: '{{ value_json.0.CONSUMPTION_COST_ELECTRICITY_LOW | round(2) }}'
unit_of_measurement: "€"
- platform: rest
resource: http://ip.adress.p1.mon/api/v1/financial/month?limit=1&json=object&round=off
name: Maand Hoog Tarief
value_template: '{{ value_json.0.CONSUMPTION_COST_ELECTRICITY_HIGH | round(2) }}'
unit_of_measurement: "€"
- platform: rest
resource: http://ip.adress.p1.mon/api/v1/financial/month?limit=1&json=object&round=off
name: Maand Laag Tarief
value_template: '{{ value_json.0.CONSUMPTION_COST_ELECTRICITY_LOW | round(2) }}'
unit_of_measurement: "€"
- platform: rest
resource: http://ip.adress.p1.mon/api/v1/powergas/day?limit=1&json=object&round=off
name: Verbruik Per Dag
value_template: '{{ value_json.0.CONSUMPTION_DELTA_KWH | round(4) }}'
unit_of_measurement: "kWh"
- platform: template
sensors:
energie_kosten_dag:
value_template: "{{ states('sensor.kosten_hoog_tarief') | float + states('sensor.kosten_laag_tarief') | float | round(2) }}"
unit_of_measurement: "€"
- platform: template
sensors:
energie_kosten_maand:
value_template: "{{ states('sensor.maand_hoog_tarief') | float + states('sensor.maand_laag_tarief') | float | round(2) }}"
unit_of_measurement: "€"
The last 2 platform are my costs for energy, one for day cost and one for total monthly cost.
There are more API links that you can use from P1, you can find them in the settings and then API.
If there are more questions please ask.
And i want to thank the guy that helped me to get started to get P1 Mon data into HA.
Thanks Marcel.
kaosmagix
(Cristian Van Loenen)
November 30, 2019, 7:35am
2
I have the same situation RPI connected to the Smart Meter (P1) and Hassio on a NUC somewhere else. I use DSMR Reader [https://github.com/dennissiemensma/dsmr-reader ] on the RPI and use MQTT (Mosquito add-on) in Hassio.
This gives me also Gas consumption and price information
Andy
(Andy)
November 30, 2019, 10:15pm
3
Thanks, yes i also found DSMR Reader. But i got P1 Monitor working in Hassio.
Some other user from P1 Monitor helped me with the correct API links.
Now i got all the information in Hassio from my Smart Meter
nickrout
(Nick Rout)
December 1, 2019, 2:50am
4
Could you please document your solution here. That is a big part of the forum, leaving details of how you fixed something so as to help others in the future.
Andy
(Andy)
December 2, 2019, 8:45am
5
Yeah sure
I posted the solution in my first post.
1 Like
Maran
December 11, 2019, 2:22pm
7
Thanks for sharing as I was looking for a solution for the same situation.
1 Like
Andy
(Andy)
December 11, 2019, 4:52pm
8
I have it up and running now for 12 days and it’s working great.
Maran
December 12, 2019, 7:34am
9
Added yesterday and it works great, checking if I can add the gas as well in the overview
1 Like
I can’t see how I can use the low and high electricity values per hour. The only low and high values are the total meter figures.
Gijs61
July 4, 2020, 9:13am
11
[removed by my because it was a stupid question and it works now]
Roelofk85
(Roelof Kooijman)
August 24, 2020, 12:47pm
12
I tried to get this working but it isn’t!
I use the correct api links, but when i create al these sensors, they don’t show up in home assistant at all.
What am i missing?
Thanks
Roelofk85
(Roelof Kooijman)
August 25, 2020, 7:58pm
13
Fixed: Had to remove “.p1.mon” from the api link!
Maran
September 18, 2020, 9:24am
14
did somebody the gas info working, use used and costs?
1 Like
I am very new to this home assistant. But how and where do I put this code?
I tried putting it into configurations.yaml, but it failed.
Can you please provide some sort of step by step guide?
Thank you very much!
1 Like
Maran
October 12, 2020, 12:04pm
16
You can add this to the configurations.yaml however you should add the correct ip address.
This should work with your P1 Monitor
I’m new with HA and can’t get it to work. What lines must I write in the configuration yaml to make it work with the sensor.yaml?
Me neither. I have created an sensors.yaml, and included it into the configuration.yaml but they just don’t show up (yes I did do a reboot).
Also I changed it into the right IP address, and when I use the link in the browser I got the right json, but no sensors showing up.
HScholing
(Hendry Scholing)
January 10, 2021, 1:21pm
20
Added some Gas Additions and cost additions:
- platform: rest
resource: http://192.168.178.72/api/v1/smartmeter?limit=1&json=object&round=off
name: Meterstand Gas
value_template: '{{ value_json.0.CONSUMPTION_GAS_M3 | round(2) }}'
unit_of_measurement: "M3"
- platform: rest
resource: http://192.168.178.72/api/v1/financial/day?limit=1&json=object&round=off
name: Kosten Gas
value_template: '{{ value_json.0.CONSUMPTION_COST_GAS | round(2) }}'
unit_of_measurement: "€"
- platform: rest
resource: http://192.168.178.72/api/v1/financial/month?limit=1&json=object&round=off
name: Maand Gas
value_template: '{{ value_json.0.CONSUMPTION_COST_GAS | round(2) }}'
unit_of_measurement: "€"
- platform: rest
resource: http://192.168.178.72/api/v1/powergas/day?limit=1&json=object&round=off
name: Verbruik Gas Per Dag
value_template: '{{ value_json.0.CONSUMPTION_GAS_DELTA_M3 | round(4) }}'
unit_of_measurement: "M3"
Also now calculation is included with the GAS:
- platform: template
sensors:
energie_kosten_dag:
value_template: "{{ states('sensor.kosten_hoog_tarief') | float + states('sensor.kosten_laag_tarief') | float + states('sensor.kosten_gas') | float | round(2) }}"
unit_of_measurement: "€"
- platform: template
sensors:
energie_kosten_maand:
value_template: "{{ states('sensor.maand_hoog_tarief') | float + states('sensor.maand_laag_tarief') | float + states('sensor.maand_gas') | float | round(2) }}"
unit_of_measurement: "€"
It looks like it’s working at my side, so help yourself
Erijk
(Erik Rijken)
January 8, 2022, 3:20pm
21
Does anyone know the latest update time code for me ?