This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Read (dutch) smart meter with ser2net
#1
I want to read the dutch smart meter, the p1 meter script is perfect for that. 
but the only thing is the my LM is not near the smart meter.

I have a raspberry-pi next to the smartmeter with ser2net installed. how can I change this part of the script to use the ser2net?
Code:
lastchar = '!'

require('serial')
port = serial.open('/dev/ttyUSB0', { -- Let op type van de slimme meter voor de onderstaande instellingen.
  baudrate = 9600,             --DSMR 2/3 = 9600        DSMR 4 = 115200
  databits = 7,                    --DSMR 2/3 = 7            DSMR 4 = 8
  stopbits = 1,                    --DSMR 2/3 = 1            DSMR 4 = 1
  parity = 'even',            --DSMR 2/3 = even        DSMR 4 = none
  duplex = 'full'
})


function readdata(port)
  local char, buf

  buf = {}

  while true do
    char = port:read(1)
    -- error (timeout) or newline, stop
    if char == nil or char == lastchar then
      break
    -- ignore cr char
    elseif char ~= '\r' then
      table.insert(buf, char)
    end
  end

  return table.concat(buf)
end

data = readdata(port)
port:flush()

---------------------------------------------------------------
Thanks,

Mischa
Reply
#2
Figured out that it is not gonna work properly with ser2net to the LM

When starting a terminal, I get data but there is data missing. When starting terminal at the PI all data is present.

So ser2net would be fine for some commands, but i guess not for every second telegrams.

Mischa
Reply
#3
I see no reason why it should not work. But since you already have pi there it might be easier to write a reader there and send parsed data to LM via http. Or use ser2net via tcp, there are many examples here on how to use tcp client.
Reply
#4
Hi,

You could also use a Plugwise Smile P1 (aprox 90 euro) at the smart meter and read this device from LM over ethernet.

See https://openrb.com/read-plugwise-smile-p...-requests/

BR,

Erwin
Reply
#5
(03.05.2020, 09:24)Erwin van der Zwart Wrote: Hi,

You could also use a Plugwise Smile P1 (aprox 90 euro) at the smart meter and read this device from LM over ethernet.

See https://openrb.com/read-plugwise-smile-p...-requests/

BR,

Erwin

Hi Erwin,

Thanks going to take a look at that.

BR,

Mischa
Reply
#6
If i want to use the P1 meter script described in the first post. What port should be used? 232? and what is the max cable length?
Reply
#7
No you can't use RS232 direct as the signal of the P1 port is TTL so you need a TTL converter in any case, i always use (advise) this USB cable where the converter is build-in:

https://www.robbshop.nl/slimme-meter-kabel
Reply
#8
ok thanks, the problem is the smart meter is around 100m from the logic machine, no wifi signal either. I have a spare cat6 connection there. Would it work if i hookup the P1 to the RJ45 cat 6, patch it to the outlet near the LM and than use this converter?
Reply
#9
No, that will never work over that distance as the P1 is a serial port, the only way to do this in your scenario is by using the Plugwise Smile P1 and conmnect it to the IP network with the spare cat6 cable you have.
Reply
#10
(13.01.2021, 09:39)Erwin van der Zwart Wrote: No, that will never work over that distance as the P1 is a serial port, the only way to do this in your scenario is by using the Plugwise Smile P1 and conmnect it to the IP network with the spare cat6 cable you have.

not a big fan of plugwise because i don't want to connect to their cloud. But Can i get all the data as the script is only fairly limited on the datapoints.
Reply
#11
This device can be used as a cloud solution but is not needed to config it like that, the device just reads the P1 data and exposes it as a .xml that can be read locally from the device..

The data is not limited by the plugwise, as this is a sample of the full DSMR data set:

Code:
* string: /ISk5\2ME382-1003

0-0:96.1.1(4B413650303035313436373338393133)
1-0:1.8.1(11962.763*kWh)
1-0:1.8.2(11266.069*kWh)
1-0:2.8.1(00486.519*kWh)
1-0:2.8.2(01153.217*kWh)
0-0:96.14.0(0002)
1-0:1.7.0(0000.00*kW)
1-0:2.7.0(0000.05*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()
Reply
#12
(13.01.2021, 11:25)Erwin van der Zwart Wrote: This device can be used as a cloud solution but is not needed to config it like that, the device just reads the P1 data and exposes it as a .xml that can be read locally from the device..

The data is not limited by the plugwise, as this is a sample of the full DSMR data set:

Code:
* string: /ISk5\2ME382-1003

0-0:96.1.1(4B413650303035313436373338393133)
1-0:1.8.1(11962.763*kWh)
1-0:1.8.2(11266.069*kWh)
1-0:2.8.1(00486.519*kWh)
1-0:2.8.2(01153.217*kWh)
0-0:96.14.0(0002)
1-0:1.7.0(0000.00*kW)
1-0:2.7.0(0000.05*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()

Tnx, i will take a look at it!
Reply
#13
(13.01.2021, 13:54)KoBra Wrote:
(13.01.2021, 11:25)Erwin van der Zwart Wrote: This device can be used as a cloud solution but is not needed to config it like that, the device just reads the P1 data and exposes it as a .xml that can be read locally from the device..

The data is not limited by the plugwise, as this is a sample of the full DSMR data set:

Code:
* string: /ISk5\2ME382-1003

0-0:96.1.1(4B413650303035313436373338393133)
1-0:1.8.1(11962.763*kWh)
1-0:1.8.2(11266.069*kWh)
1-0:2.8.1(00486.519*kWh)
1-0:2.8.2(01153.217*kWh)
0-0:96.14.0(0002)
1-0:1.7.0(0000.00*kW)
1-0:2.7.0(0000.05*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()

Tnx, i will take a look at it!
@Erwin, 
2 questions: 
  1. how do you take the XML to datapoints in Logic Machine
  2. do you know if it will work in the same way with the Smile P1 V3 that is launched?
Reply


Forum Jump: