that’s the point, when I just went off. As the Reader is the only USB-device, it’ll appear as /dev/ttyUSB0, I could get the Serial via /sbin/udevadm info --query=all --name=/dev/ttyUSB0, but the rule SUBSYSTEM=="tty", ATTRS{product}=="CP2104 USB to UART Bridge Controller", ATTRS{serial}=="ABC1234", NAME="lesekopf0" doesn’t add the /dev/lesekopf0. So I guess, the config you’re pasted here for vzlogger.conf doesn’t find the/dev/lesekopf0 (in your case obiously /dev/stromzaehler).
So, I’m using the RPi-Image from volkszaehler.org - Raspbian jessie lite I believe. I can however use the USB-Reader with the above posted script from DAI-Labor in Berlin: https://github.com/dailab/libsml
Unfortunately, volkszaehler.org isn’t as good organized as openHAB…
if you’re not using multiple USB devices you can go ahead using /dev/ttyUSB0 in vzlogger.conf. It’s just useful when you have multiple usb devices and you actually don’t know which is on startup assigned to /dev/ttyUSB0 and /dev/ttyUSB1 and so on. Therefore creating this link is helpful. I’m also reading data from my Viessmann Vitocall heating and therefore need the link.
So, skip this step and see if you get stty / minicom running.
ok, for testing purposes, this should work - but on my OH2 productive RPi I have already four USB devices running!
I’d like to test it and changed your vzlogger.conf a bit - but I don’t know, how to start vzlogger.conf… Isn’t there a step-by-step howto for eHZs out there anywhere? (except volkszaehler.org, obviously! ) But then: I could write a short script using the DAI-Labs SML-implementation and then post the result to OH2 via the API.
if you didn’t created a start-script you can start the vzlogger using: /usr/local/bin/vzlogger -c /etc/vzlogger.conf . I installed the vzlogger following the installation guide on the volkszaehler wiki page: Installation Guide vzlogger.
For me the better way would be a small script to send the data to openhab.
I don´t want to install the whole volkszähler-software, only to send one small value of the power meter to openhab…
Volkszähler would be usefull if i would log many meters and use the volkszähler frontend to make charts and so on. But this is all doing openhab already for me.
Now i can read both of my usb readers with the script of Thomas, but it is not possible to get the data to openhab - at this time. There i need to get the output of the script (linux console) and send it to openhab.
The naming of my two usb-readers to /dev/lesekop0 and /dev/lesekopf1 worked. First i had problems to get all working (especially the libsml) in ubuntu, but whith debian it worked very good so far.
If someone is interrested, please Install it from the Market (install market Extensions and Filter addons for “market”, since 2.1.0 Snapshot).
Any Feedback is appreciated!
Are you configuring through PaperUI?
Then you have to create a Thing and set the serial Port on which it is
connected to your machine.
If you don’t see the binding installed at all in PaperUI, you probably are
missing dependencies as this are not getting installed with Marketplace
bindings. Please Install the serial binding and try again in that case.
In PaperUI you can add a new Thing. You have to set the serial Port in the configuration of the Thing. If everything is working you will see all available Channels in that Thing with its SML code.
Ok, there is an issue in my config. I can configure a new Thing. But I get no channels.
I run openhab in a docker container. maybe this is a problem …
on the other side, the thing is online …
but my log shows errors …
2017-09-15 10:49:10.368 [ERROR] [smlreader.connectors.SerialConnector] - Error at SerialConnector.getMeterValuesInternal: Timeout
2017-09-15 10:49:10.385 [ERROR] [binding.smlreader.internal.SmlDevice] - smlreader:meter:2d889a5b: Error during receive values from device: Timeout
2017-09-15 10:49:10.386 [ERROR] [g.smlreader.handler.SmlReaderHandler] - Failed to read SML
java.io.IOException: Timeout
at org.openmuc.jsml.tl.SMLMessageExtractor.fillBufferWithTimeout(SMLMessageExtractor.java:197)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at org.openmuc.jsml.tl.SMLMessageExtractor.waitForStartSequence(SMLMessageExtractor.java:93)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at org.openmuc.jsml.tl.SMLMessageExtractor.getSmlMessage(SMLMessageExtractor.java:85)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at org.openhab.binding.smlreader.connectors.SerialConnector.getMeterValuesInternal(SerialConnector.java:67)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at org.openhab.binding.smlreader.connectors.ConnectorBase.getMeterValues(ConnectorBase.java:67)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at org.openhab.binding.smlreader.connectors.SerialConnector.getMeterValues(SerialConnector.java:1)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at org.openhab.binding.smlreader.internal.SmlDevice.readValues(SmlDevice.java:266)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at org.openhab.binding.smlreader.handler.SmlReaderHandler.updateOBISValue(SmlReaderHandler.java:128)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at org.openhab.binding.smlreader.handler.SmlReaderHandler.access$0(SmlReaderHandler.java:126)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at org.openhab.binding.smlreader.handler.SmlReaderHandler$1.run(SmlReaderHandler.java:100)[208:org.openhab.binding.smlreader:2.1.0.201706271509]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_144]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_144]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_144]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_144]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_144]
Can you turn on debug logging? Also you should see the messages on the very first try (after the SML binding ist startest). Maybe we can see something meaningful there…
ok, step by step
I found the reason for “no channels”.
My usb device connected not every time to the same usb port (ttyUSB1, ttyUSB2, etc.)
So I set up an udev rule for my “reading head”.
Now I see the channels under things
at first, thanks @msteigenberger for the nice binding-port!
For me, it worked. I’m using a EMH eHZ-IW8E2A and with that, (nearly) all is fine (I’m still opposed to configuring Things in PaperUI and have to figure out, why my configuring with files didn’t work… )
What did I do:
installed the “Eclipse IoT Market” (PaperUI > AddOns > “MISC-Section”)
I got now a new “Thing”, which I called Powermeter
There are seven channels with my eHZ
configured a Item for all the channels
so, as I don’t understand the OBIS nomenclature, I just figured, these channels to be the ones for my purpose (as I don’t feed any power back, I am only consuming the power from the network):
smlreader:meter:METERNAME:1-0#1-8-0: this seems to be the overall consumption (*1000)
smlreader:meter:METERNAME:1-0#1-8-1: this one is slighty different (but could be due to parallel processing?)
smlreader:meter:METERNAME:1-0#16-7-0: this seems to be the actual consumption
the other channels seem to be:
smlreader:meter:METERNAME:129-129#199-130-3: manufacturer (in my case EMH)
smlreader:meter:METERNAME:129-129#199-130-5: is somewhat cryptical
smlreader:meter:METERNAME:1-0#1-8-2: is 0 all the time
smlreader:meter:METERNAME:1-0#0-0-9: seems also to be the manufacturer (EMH)
Is there a list of channels and what they really mean somewhere?