P1 meter reading with ESP8266 to domoticz

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

P1 meter reading with ESP8266 to domoticz

#1 Post by Daeron » 17 Feb 2021, 10:40

Good morning!
I have been trying to read out my electricity meter using the P1 port with an ESP8266/wemos d1 mini look-a-like I had laying around and sending its data to domoticz.
I've flashed it with esp easy firmware: mega_20210114_normal_esp8266_4m1m

I've found a lot of tutorials on the internet so I'm following those a lot but it's just not working. Made a little circuit using an BC547 to flip the ones and zeros.
I assigned my domoticz as controller (http) on the tab and added a P1 wifi gateway to the devices. Found the serial parameters for my meter so those should be correct.

Setup domoticz to allow new devices and made a new hardware entry with P1 wifi gateway. In the log I can see it connects to the ESP but it's not getting any data from it since it hasn't added the meter values itself.

To test my setup tried an usb to ttl and realtherm connected to the P1 meter and to the esp but without results. If anyone could help me with what could be wrong that would be greatly appreciated.

TD-er
Core team member
Posts: 4272
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: P1 meter reading with ESP8266 to domoticz

#2 Post by TD-er » 17 Feb 2021, 11:10

Does the log show any entries like "unknown command" ?
If so, then you must uncheck "Enable Serial port" on Tools -> Advanced. (Web interface)

Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

Re: P1 meter reading with ESP8266 to domoticz

#3 Post by Daeron » 17 Feb 2021, 17:54

TD-er wrote: 17 Feb 2021, 11:10 Does the log show any entries like "unknown command" ?
If so, then you must uncheck "Enable Serial port" on Tools -> Advanced. (Web interface)


Unfortunately that didn't change anything

joppybt
Normal user
Posts: 2
Joined: 17 Feb 2021, 23:07

Re: P1 meter reading with ESP8266 to domoticz

#4 Post by joppybt » 17 Feb 2021, 23:10

What meter do you have?

What do you see when you access your device at http://ipaddress:8088 (or whatever TCP port you configured for your Communication - P1 Wifi Gateway)

It should (after a small delay) show the 'Telegram' data (that is what Domoticz is polling)

Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

Re: P1 meter reading with ESP8266 to domoticz

#5 Post by Daeron » 18 Feb 2021, 09:28

joppybt wrote: 17 Feb 2021, 23:10 What meter do you have?

What do you see when you access your device at http://ipaddress:8088 (or whatever TCP port you configured for your Communication - P1 Wifi Gateway)

It should (after a small delay) show the 'Telegram' data (that is what Domoticz is polling)
I have a landis gyr E350 ZCF110.

I'll post what's on that website when I get home later!

Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

Re: P1 meter reading with ESP8266 to domoticz

#6 Post by Daeron » 19 Feb 2021, 09:47

Wasn't able to test this anymore yesterday, but when I navigate to that page its not sending any data is what my browser tells me.

joppybt
Normal user
Posts: 2
Joined: 17 Feb 2021, 23:07

Re: P1 meter reading with ESP8266 to domoticz

#7 Post by joppybt » 19 Feb 2021, 21:26

My guess: somewhere there is an error in the wiring up.

Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

Re: P1 meter reading with ESP8266 to domoticz

#8 Post by Daeron » 19 Feb 2021, 21:46

joppybt wrote: 19 Feb 2021, 21:26 My guess: somewhere there is an error in the wiring up.
I'll try to just directly attach the p1 to the rx, it should give incorrect readings but at least I have something.

GravityRZ
Normal user
Posts: 155
Joined: 23 Dec 2019, 21:24

Re: P1 meter reading with ESP8266 to domoticz

#9 Post by GravityRZ » 20 Feb 2021, 10:33

when i first connected my RFXTRX433XL to my meter i did not have any readings either.
it turned out that the unit used a 10k pullup resistor which limited the current to much.
i replaced it with a 2K2 resistor(as advised by the makers of RFXTRX433XL) and then i got good readings.

in my case i got a string reading but just a tiny character got distorted and because of that nothing worked(because the string was corrupt)

if you have a usb-serial cable to RJ11 you could always hookup a notebook with a terminal program to see if there is anything coming out of that meter
also it is a good way to see what the right baudrate is

Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

Re: P1 meter reading with ESP8266 to domoticz

#10 Post by Daeron » 20 Feb 2021, 11:47

GravityRZ wrote: 20 Feb 2021, 10:33 i replaced it with a 2K2 resistor(as advised by the makers of RFXTRX433XL) and then i got good readings.
Wait you opened the meter to replace the resistor?
GravityRZ wrote: 20 Feb 2021, 10:33 if you have a usb-serial cable to RJ11 you could always hookup a notebook with a terminal program to see if there is anything coming out of that meter
also it is a good way to see what the right baudrate is
I have a USB to TLL adapter and tried to view the data with Realtherm but that didn't work either... But if the circuit is wrong it won't display anything I suppose.


Alright just tested it with an Arduino to the meter, and didn't get any data as well.
I used an RJ126P6C connector on a solid CAT5 cable so I can just put the pins in a breadboard.
I've used the below circuit, with my ESP8266 I just a BC547 as well.
So strange it doesn't work, when I google my meter people seem to get it to work easily...
Capture.PNG
Capture.PNG (35.04 KiB) Viewed 282 times

GravityRZ
Normal user
Posts: 155
Joined: 23 Dec 2019, 21:24

Re: P1 meter reading with ESP8266 to domoticz

#11 Post by GravityRZ » 20 Feb 2021, 11:56

that looks right with the following remarks.
i do not think you need to feed 5v into the meter.
there is always a risk of blowing up things

also mixing 5V and 3.3 volt without shielding those might cause problems if it is coming from the same source(the ESP)


with my setup the 10k did not work and i needed to use a 2K2 but this might be RFXTRX433 specific.

Edit, i see you hook it up to an arduino)
are you using a RJ11 to USb cable for this (one which an serial chip inside?)
if you are using a RJ11 to serial cable then you need to connect it to a serial port(and those are not available anymore on the latest notebooks)

this site also metions an 1k resistor between RTS and RX

maybee try that, just 2 cables from the meter(3GND, 5 RX)
10k pullup from RX to 3.3 volt and 1K between RTS and RX

Code: Select all

https://shoarma.home.blog/p1-kabel-landis-gyr-e350-zcf110-dsmr-4-04-2/

Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

Re: P1 meter reading with ESP8266 to domoticz

#12 Post by Daeron » 20 Feb 2021, 14:29

GravityRZ wrote: 20 Feb 2021, 11:56 that looks right with the following remarks.
i do not think you need to feed 5v into the meter.
there is always a risk of blowing up things

also mixing 5V and 3.3 volt without shielding those might cause problems if it is coming from the same source(the ESP)


with my setup the 10k did not work and i needed to use a 2K2 but this might be RFXTRX433 specific.

Edit, i see you hook it up to an arduino)
are you using a RJ11 to USb cable for this (one which an serial chip inside?)
if you are using a RJ11 to serial cable then you need to connect it to a serial port(and those are not available anymore on the latest notebooks)

this site also metions an 1k resistor between RTS and RX

maybee try that, just 2 cables from the meter(3GND, 5 RX)
10k pullup from RX to 3.3 volt and 1K between RTS and RX

Code: Select all

https://shoarma.home.blog/p1-kabel-landis-gyr-e350-zcf110-dsmr-4-04-2/
Thank you for the tip, I'll try it out in a bit.
Don't think I have a 2k2 resistor laying around so I'll just put two 1k in series, should be close enough I suppose.

GravityRZ
Normal user
Posts: 155
Joined: 23 Dec 2019, 21:24

Re: P1 meter reading with ESP8266 to domoticz

#13 Post by GravityRZ » 20 Feb 2021, 17:15

and do not forget the 1k between and rx

Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

Re: P1 meter reading with ESP8266 to domoticz

#14 Post by Daeron » 21 Feb 2021, 14:38

Alright so I put the 1k resistor between RX and RTS, and 10k between TX of the meter and RX of the arduino.
I did give me serial available this time which it didn't do yesterday, but the content was empty...?
So it's a step closer I suppose

TD-er
Core team member
Posts: 4272
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: P1 meter reading with ESP8266 to domoticz

#15 Post by TD-er » 21 Feb 2021, 17:50

Maybe signal is inverted?

Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

Re: P1 meter reading with ESP8266 to domoticz

#16 Post by Daeron » 21 Feb 2021, 22:12

TD-er wrote: 21 Feb 2021, 17:50 Maybe signal is inverted?
That's what my first thought was as well. So I got the good old BC547 inverter out and put that after the 10k but that still left the serial read empty.
Starting to think that there is something wrong with my meter...

TD-er
Core team member
Posts: 4272
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: P1 meter reading with ESP8266 to domoticz

#17 Post by TD-er » 21 Feb 2021, 23:12

Or perhaps a newer version with a protocol that's not (yet) implemented in this plugin?

Daeron
Normal user
Posts: 10
Joined: 17 Feb 2021, 10:24

Re: P1 meter reading with ESP8266 to domoticz

#18 Post by Daeron » 22 Feb 2021, 16:53

Alllright, so I contacted the supplier today.
Asked if maybe the readout was disabled but it looked all good on their end.
So I connected only a 1k resistor between RTS and RX, then 2 jumper cables from RX and GND to my usb to serial adapter.
See the result below. When I jumped the 5V and RTS another one of those symbols popped up and that was it.
But when I tried connecting an Arduino to that same circuit it didn't receive anything.
Attachments
Capture2.PNG
Capture2.PNG (18.43 KiB) Viewed 191 times

GravityRZ
Normal user
Posts: 155
Joined: 23 Dec 2019, 21:24

Re: P1 meter reading with ESP8266 to domoticz

#19 Post by GravityRZ » 23 Feb 2021, 20:31

and if you loose the 1k resistor(so basically only connect TX and GND)

also note that eveybody is talking about the RX but this is the RX of the terminal

The meter only has a TX which needs to connect to the RX pin on your usb-serial cable

one mistake which is often made because it is so simple.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 10 guests