what about this one :
'cu -l /dev/ttyUSB10 -s 9600 --parity=none > stroom.log'
Read data from Smart Meter using P1 USB cable
what about this one :
'cu -l /dev/ttyUSB10 -s 9600 --parity=none > stroom.log'
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
the file size is stil growing, a solution is to delete the file every hour
pi@domotica ~ $ ls -lh stroom.log
-rw-r–r-- 1 pi pi 5.2K Mar 4 18:39 stroom.log
pi@domotica ~ $ ls -lh stroom.log
-rw-r–r-- 1 pi pi 5.5K Mar 4 18:39 stroom.log
pi@domotica ~ $ ls -lh stroom.log
-rw-r–r-- 1 pi pi 5.8K Mar 4 18:39 stroom.log
pi@domotica ~ $ ls -lh stroom.log
-rw-r–r-- 1 pi pi 6.4K Mar 4 18:39 stroom.log
pi@domotica ~ $
did you copy and paste my above command?
please compare !
if you use >> the output of your command will be appended to the stroom.log file so it grows larger
if you use the > the output of your command will overwrite the stroom.log file and it won’t grow
try the following :
ls > files.txt
then
cat files.txt
and repeat both commands
here you’ll have only one output
and now try
ls >> files2.txt
cat files2.txt
and repeat both commands.
now you’ll have the double output at files2.txt
hope this simple example will explain
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
I didn’t tested it with crontab.
Thank you voor the explanation
you’re welcome!
yes, try to set up a cronjob.
guess this will be the solution.
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
It works like a charm! Thank you!
Is it possible to make a daily useage?
like this --> http://iqjar.com/jar/wp-content/uploads/2015/02/Domoticz_HouseTotalEnergyUsage_Q30.jpg
you can have a look at the built in graph
but there’s no bar chart, it’s a line graph
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
Line graph is okay!
You have a daily energy consumption, what is the code of the device?
i’m having a photovoltaic generator on my roof. the above graph displays my energy consumption from the energy output of the photovoltaics.
i’m getting the energy production from my pv inverter via shellscript. my energymeters are implemented to pimatice via the volkszaehler plugin.
for that i’m having a separate pi in the basement with two usb ir D0 readers attached to the energymeters directly. they are reading the energy import/export.
with all this i’m having some variables for all my energy meassurings and can calculate like this
you can have a look here http://forum.pimatic.org/topic/6/share-your-gui/2 to see my gui.
for the daily usage you need to create two variables first.
for example $dailynew and $dailyold
then set up two rules like this :
IF its 0.00 THEN $dailyold = $actualreadout and $dailynew = 0
IF $actualreadout changes THEN $dailynew = $actualreadout - $dailyold
the $actualreadout will be the value of your total energy consumption you are storing in stroom.log (and read it with a logreader device i guess).
compare with my rules above, it’s the same there.
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
What if Pimatic and the smartmeter are not installed on the same device but physical 2 separate Rpi’s.
Such as Pimatic and youless, those are also 2 devices.
@funip
for youless there’s already a plugin.
i did not try that myself since i don’t own a youless device.
but you can give it a try and report at the hardware section if you like.
https://github.com/kjdijkema/pimatic-youless
for other devices that are not implemented over plugin there could be some workarounds (maybe with curl and a shellsensor device. depends on the device that you want to read)
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
For 2 Pi’s just install pimatic on both and use the API to update the other.
Follow my domotica project on http://maredana.nl
@leader21
Youless isn’t working and neither is volkzahler.
Problem is to write a “file”.log to Pimatic. My smartmeter is connected to P1 with a serial USB adapter, which is converted by MQTT and Node and written to a database.
My job now is to work this out but i have no clue how to. And i think that installing another pimatic isn’t gonna solve my problem.
Probably need a node-serial script that creates a “file”.log. I tried ser2net but isn’t working correctly(smartmeter crashes).
The only thing that works is a curl function but i needs to write the “file”.log to Pimatic Rpi and not the smartmeter Rpi.
@funip said:
What if Pimatic and the smartmeter are not installed on the same device but physical 2 separate Rpi’s.
Such as Pimatic and youless, those are also 2 devices.
[…]
Youless isn’t working and neither is volkzahler.
well, these were your questions and we answered
if you’re using VZ or a Youless device this should be working via lan though, or are there any issues with the plugin?
I still am not sure how to help, since i didn’t understand the question in full.
your smartmeter is connected to the pi via P1 usb serial adapter`, right?
why not use the cu command as cronjob like stated above, since it seems to work cu -l /dev/ttyUSB10 -s 9600 --parity=none > file.log
and set up a logreader device.
you’ll need to change your dev to the correct one. wouldn’t this work somehow?!
the other way would be to get the data out of the database directly.
which database is it? sqlite, mysql … ?!
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
…and for your Youless you can use curl to create a log file;
curl http://192.168.1.14/a -o "/home/pi/youless.log"
@leader21
When i start a cu command on the smartmeter i can create file.log.
The smartmeter itself writes to a Mysql database user and pass protected.
I need to get a file.log on my pimatic Pi from the smartmeter.
isn’t there a possibility to get a copy of the logfile to you pimatic pi?
maybe this helps http://forum.pimatic.org/topic/62/solved-execute-commands-on-another-pi
and then scp the logfile from one system to the other.
http://www.hypexr.org/linux_scp_help.php
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
The problem is to get a log from the smartmeter Pi to the pimatic Pi. Somehow the smartmeter stops when the serialport is approached by another program or command. So i’m thinking of letting the smartmeter write it’s data to the Pimatic database-server. And move on from there.
There might be a way to solve my problem but therefor i need a plugin or script that allows an iframe in a button device at the bottom of a page and not as a link in the menu.
I am using the pimatic plugin
https://github.com/saberone/pimatic-smartmeter
It works great
Follow my domotica project on http://maredana.nl
@leader21 after some time still no result with my P1 meter. i’m trying to get a logfile from the serialport. i used this cronjob */1 * * * * /usr/bin/cu -l /dev/ttyUSB0 -s 115200 --parity=none > /home/pi/smartmeter.log but the log is not correct, missing a lot of data. I tried to set parity to even but got less data. Now might be looking for a script.sh that logs my P1 port to a logfile every 10 sec. and renews last data.