Smartmeter sensors
-
@sincze said:
Domoticx.com P1
Maybe the problem is that moving to certain pins is not allowed in the altsoftserial library.Why is it "alt soft serial", when there is a "soft serial" library. Does the ALT version use interrupts ? Does it need certain comparator pins related to timers of the atmega328p ?
Yes, to almost all of your questions.
https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html -
Yes, to almost all of your questions.
https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html@hek haha you are fast!.
I would say @GertSanders I read these articles and was convinced altsoftserial it was for the nano.
https://hackaday.io/project/95-altsoftserial-arduino-library
http://forum.arduino.cc/index.php?topic=152122.0
https://www.arduino.cc/en/Reference/SoftwareSerial
http://hackaday.com/2012/02/13/altsoftserial-looks-to-speed-up-arduino-software-uart/ -
@sincze : Good to see you used my program! :smiley: I also changed some things, I added some sleeps in between the presentation messages, as I got a lot of failures during presentation. And I removed all the timers between sending updates.
Now, I send the current usage and production on every new update, and the rest only when the timestamp of the gasmeter changes (at the start of every hour) I also commented out sending the timestamp of the gasmeter and main switch.
@Japio can you share your modification with the timers??
Funny thing as I have solar panels.
Today I had -1450 Watt on my Smartmeter and the script shows this as 1450 Watt in Domoticz (so positive) :lollipop: Have to look into that this weekend. Maybe I need glasses ;-)Don't worry if your version is Mysensors < 2.0.0. I will convert it as I need the 2.0.0+ version anyway.
-
@sincze You can find it on: https://github.com/Japio74/MysSmartmeterGateway
|t currently already is 2.0.0.
Enjoy it!
-
I tried to get te script working on a landis gyr e350 connected to an arduino mega. I have inverted the signal and connected it to pin 48 of the mega. The inverted signal shows up correctly if connect it directly to my laptops serial interface so that is working. I read that the DSMR4 protocol uses 115200/8/N/1 in stead of 9600/7/E/1. I cannot get the settings right for AltSoftSerial. Can someone help me modify the script to get the things working?
-
@rwanrooy : I used AltSoftSerial for the smartmeter sensor, because it has only 1 uart for serial communication, which is used for firmware upload/download. That is why I used the software alternative. But if it actually is the arduino MEGA 2560, it has 4 uarts, one for the firmware download (serial 0), but the other 3 are at your service (looking at the documentation, I don't know the details.)
These hardware ports should better be able to handle the 115200 baud.
-
@Japio: I quit trying to get it working because some users are reporting sync issues with the arduino internal clock. I managed to get it work with a rs232 to ethernet adapter with a transistor used as inverter. I can connect in native tcp mode in domoticz to the ip adres of the adapter.
-
Sorry to bump this all thread back to 2018, but I have a question.
Is it already possible to use MySensors and this all in one P1 domoticz sensor? (usage1,2 / return1,2)The examples I can find create 2-4 new sensors in Domoticz. I'm looking forward to the possibilitie if it can be done with one ;-)

It can be done with a P1 http request but as a MySenors user I want to do it with mysensors.
The idea is to use this PCB as P1 and Watermeter ;-)

-
There are many examples...
https://forum.mysensors.org/topic/3764/p1-smart-meter-nta8130-readout-using-mysensors/7Or on GitHub, needs some tinkering to integrate in mysensors
https://github.com/search?l=C%2B%2B&q=P1+meter&type=Repositories
Edit
There is also a library available
https://github.com/matthijskooijman/arduino-dsmr