SML Reader - how to integrate

@maxico: The Marketplace only states when the last edit of the Marketplace item was. On 28th I renamed it (to SmartMeter Binding). The URL of the artifact don’t change as its always taking the latest snapshot.
You could directly download it from here:
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.smartmeter/2.4.0-SNAPSHOT/org.openhab.binding.smartmeter-2.4.0-SNAPSHOT.jar
In the META-INF/MANIFEST.MF you would see following version: 2.4.0.201811042004 -> its from 2018 11 04.

@halloween: I’m not sure why this is happening. Somehow the Service which is requested is not yet resolved. I now tried it with the OSGi ServiceTracker. Hope this is working then. Can you please try the new version?

Tried the version from today morning, 6:28 o`clock and also i removed my paper ui things with this manual things-file:

smartmeter:meter:Solar     [port="/dev/ttyUSB0", refresh=20] {
    Channels:
        Type 1-0_1-8-0 : 1-0_1-8-0
	Type 1-0_2-8-0 : 1-0_2-8-0
        Type 1-0_16-7-0 : 1-0_16-7-0 
}


smartmeter:meter:Haus     [port="/dev/ttyUSB1", refresh=20] {
    Channels:
        Type 1-0_1-8-0 : 1-0_1-8-0
	Type 1-0_2-8-0 : 1-0_2-8-0
        Type 1-0_16-7-0 : 1-0_16-7-0 
}

Now i get this errors:

18-11-06 07:55:35.101 [INFO ] [ding.smartmeter.internal.MeterDevice] - Opening connection to smartmeter:meter:Solar

2018-11-06 07:55:35.101 [ERROR] [ding.smartmeter.internal.MeterDevice] - Failed to read: Error at SerialConnector.openConnection: unable to get inputstream for port /dev/ttyUSB0.. Closing connection and trying again in 2 seconds...; smartmeter:meter:Solar

java.io.IOException: Error at SerialConnector.openConnection: unable to get inputstream for port /dev/ttyUSB0.

	at org.openhab.binding.smartmeter.internal.sml.SmlSerialConnector.openConnection(SmlSerialConnector.java:125) ~[252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at org.openhab.binding.smartmeter.internal.MeterDevice.lambda$0(MeterDevice.java:141) ~[252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.operators.flowable.FlowableDoOnLifecycle$SubscriptionLambdaSubscriber.onSubscribe(FlowableDoOnLifecycle.java:63) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.operators.flowable.FlowableTimeoutTimed.subscribeActual(FlowableTimeoutTimed.java:47) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.Flowable.subscribe(Flowable.java:14479) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.operators.flowable.FlowableDoOnLifecycle.subscribeActual(FlowableDoOnLifecycle.java:38) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.Flowable.subscribe(Flowable.java:14479) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.operators.flowable.FlowableDoOnEach.subscribeActual(FlowableDoOnEach.java:50) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.Flowable.subscribe(Flowable.java:14479) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.operators.flowable.FlowableDoOnLifecycle.subscribeActual(FlowableDoOnLifecycle.java:38) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.Flowable.subscribe(Flowable.java:14479) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.operators.flowable.FlowableDoOnEach.subscribeActual(FlowableDoOnEach.java:50) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.Flowable.subscribe(Flowable.java:14479) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.Flowable.subscribe(Flowable.java:14426) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.operators.flowable.FlowableRepeatWhen$WhenReceiver.onNext(FlowableRepeatWhen.java:100) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.subscribers.SerializedSubscriber.onNext(SerializedSubscriber.java:100) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.operators.flowable.FlowableDelay$DelaySubscriber$OnNext.run(FlowableDelay.java:114) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(ExecutorScheduler.java:260) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker.run(ExecutorScheduler.java:225) [252:org.openhab.binding.smartmeter:2.4.0.201811060628]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Caused by: java.lang.NullPointerException

	at org.openhab.binding.smartmeter.internal.sml.SmlSerialConnector.openConnection(SmlSerialConnector.java:108) ~[?:?]

	... 25 more

I made some tests:

I removed my manual things file and added the things with paper ui, but with the same names like in my things-file.
β€”> I got values from both meters

I removed the things again and added back the manual things file
β€”> still working

I changed the unit-conversion from %unit% to kWh
β€”> some items worked with the new unit, but some items stayed empty
(one meterreader was working with new units, the other one stayed empty)

I made a server reboot
β€”> Nothing is working anymore, same errors like i posted above.

I removed the manual things-file again and added the things with paper-ui with the same names
β€”> working again

I made a server-reboot
β€”> same errors as before, not working anymore

The error is still the same (only that its now at a different position) - It can’t resolve the SerialPortManager OSGi service.
Can you please give me the output of bundle:list after you get the error?

I changed the unit-conversion from %unit% to kWh
β€”> some items worked with the new unit, but some items stayed empty

Which values are working and which not?

See my post above, i made some edit.

One meterreader was working, the other one was not getting new values.


                          __  _____    ____
  ____  ____  ___  ____  / / / /   |  / __ )
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
    /_/                        2.4.0-SNAPSHOT
                               Build #1413

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab> bundle:list
START LEVEL 100 , List Threshold: 50
 ID β”‚ State    β”‚ Lvl β”‚ Version                β”‚ Name
────┼──────────┼─────┼────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 20 β”‚ Active   β”‚  80 β”‚ 5.3.1.201602281253     β”‚ OSGi JAX-RS Connector
 21 β”‚ Active   β”‚  80 β”‚ 2.7.0.v20170129-0911   β”‚ Gson: Google Json Library for Java
 22 β”‚ Active   β”‚  80 β”‚ 15.0.0                 β”‚ Guava: Google Core Libraries for Java
 23 β”‚ Active   β”‚  80 β”‚ 3.0.0.v201312141243    β”‚ Google Guice (No AOP)
 24 β”‚ Active   β”‚  80 β”‚ 3.18.1.GA              β”‚ Javassist
 26 β”‚ Active   β”‚  80 β”‚ 3.5.4                  β”‚ JmDNS
 28 β”‚ Active   β”‚  80 β”‚ 1.0.0                  β”‚ Units of Measurement API
 30 β”‚ Active   β”‚  80 β”‚ 1.1.0.Final            β”‚ Bean Validation API
 31 β”‚ Active   β”‚  80 β”‚ 2.0.1                  β”‚ javax.ws.rs-api
 32 β”‚ Active   β”‚  80 β”‚ 3.2.0.v201101311130    β”‚ ANTLR Runtime
 35 β”‚ Active   β”‚  80 β”‚ 3.2.1                  β”‚ Commons Collections
 36 β”‚ Active   β”‚  80 β”‚ 1.1                    β”‚ Commons Exec
 37 β”‚ Active   β”‚  80 β”‚ 2.2.0                  β”‚ Commons IO
 38 β”‚ Active   β”‚  80 β”‚ 2.6                    β”‚ Commons Lang
 47 β”‚ Active   β”‚  80 β”‚ 4.2.1                  β”‚ Apache Karaf :: OSGi Services :: Event
 63 β”‚ Active   β”‚  80 β”‚ 4.6.0                  β”‚ Apache XBean OSGI Bundle Utilities
 64 β”‚ Active   β”‚  80 β”‚ 4.6.0                  β”‚ Apache XBean :: Classpath Resource Finder
 65 β”‚ Active   β”‚  80 β”‚ 2.12.0.v20160420-0247  β”‚ EMF Common
 66 β”‚ Active   β”‚  80 β”‚ 2.12.0.v20160420-0247  β”‚ EMF Ecore
 67 β”‚ Active   β”‚  80 β”‚ 2.11.0.v20160420-0247  β”‚ EMF Change Model
 68 β”‚ Active   β”‚  80 β”‚ 2.12.0.v20160420-0247  β”‚ EMF XML/XMI Persistence
 69 β”‚ Active   β”‚  80 β”‚ 3.8.0.v20160509-1230   β”‚ Common Eclipse Runtime
 70 β”‚ Active   β”‚  80 β”‚ 3.6.100.v20160223-2218 β”‚ Extension Registry Support
 80 β”‚ Active   β”‚  80 β”‚ 9.4.11.v20180605       β”‚ Jetty :: Proxy
 94 β”‚ Active   β”‚  80 β”‚ 0.4.1.v20180515-1321   β”‚ org.eclipse.lsp4j
 95 β”‚ Active   β”‚  80 β”‚ 0.4.1.v20180515-1321   β”‚ org.eclipse.lsp4j.jsonrpc
 96 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Config Core
 97 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Configuration Discovery
 98 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Configuration mDNS Discovery
 99 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Config Dispatcher
100 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Config XML
101 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core
102 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core Audio
103 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core Binding XML
104 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core ID
105 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core Persistence
106 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Scheduler Service
107 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core Semantics
108 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core Thing
109 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core Thing XML
110 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Transformation Service
111 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core Voice
112 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Console
113 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Console for OSGi runtime Karaf
114 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome HTTP Interface Bundle
115 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome JavaSound I/O, Fragments: 182
116 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Monitor
117 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Net I/O Bundle
118 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome REST Interface Bundle
119 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Core REST API
120 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome REST mDNS Announcer
121 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome REST Interface JAX-RS optimization Bundle
122 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Sitemap REST API
123 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome SSE REST API
124 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Voice REST API
125 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Bonjour/MDS Service Discovery Bundle
126 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Web Audio Support
127 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Model Core
128 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Item Model
129 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Item Model IDE
130 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Item Model Runtime
131 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Language Server
132 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Persistence Model
133 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Persistence Model IDE
134 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Persistence Runtime
135 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Rule Model
136 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Rule Model IDE
137 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Rule Runtime
138 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Script
139 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Script Model IDE
140 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Script Runtime
141 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Sitemap Model
142 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Sitemap Model IDE
143 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Sitemap Runtime
144 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Thing Model
145 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Thing Model IDE
146 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Thing Model Runtime
147 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Json Storage Service
148 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome UI
149 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome UI Icons
150 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Classic IconSet
151 β”‚ Active   β”‚  80 β”‚ 2.14.0.v20180522-1629  β”‚ Xtend Runtime Library
152 β”‚ Active   β”‚  80 β”‚ 2.14.0.v20180522-1629  β”‚ Xtend Macro Interfaces
153 β”‚ Active   β”‚  80 β”‚ 2.14.0.v20180522-1821  β”‚ Xtext
154 β”‚ Active   β”‚  80 β”‚ 2.14.0.v20180522-1833  β”‚ Xtext Common Types
155 β”‚ Active   β”‚  80 β”‚ 2.14.0.v20180522-1821  β”‚ Xtext IDE Core
156 β”‚ Active   β”‚  80 β”‚ 2.14.0.v20180522-1821  β”‚ Xtext Utility
157 β”‚ Active   β”‚  80 β”‚ 2.14.0.v20180522-1833  β”‚ Xbase Model
158 β”‚ Active   β”‚  80 β”‚ 2.14.0.v20180522-1833  β”‚ Xbase Generic IDE Services
159 β”‚ Active   β”‚  80 β”‚ 2.14.0.v20180522-1629  β”‚ Xbase Runtime Library
174 β”‚ Active   β”‚  80 β”‚ 1.9.6                  β”‚ MIME streaming extension
176 β”‚ Active   β”‚  80 β”‚ 6.2.0                  β”‚ org.objectweb.asm
177 β”‚ Active   β”‚  80 β”‚ 6.2.0                  β”‚ org.objectweb.asm.commons
178 β”‚ Active   β”‚  80 β”‚ 6.2.0                  β”‚ org.objectweb.asm.tree
179 β”‚ Active   β”‚  90 β”‚ 2.4.0.201811051653     β”‚ openHAB Core
180 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ openHAB Karaf Integration
182 β”‚ Resolved β”‚  80 β”‚ 2.4.0.201811051653     β”‚ openHAB Sound Support, Hosts: 115
183 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ openHAB Dashboard UI
188 β”‚ Active   β”‚  80 β”‚ 1.0.2                  β”‚ Units of Measurement Common Library
189 β”‚ Active   β”‚  80 β”‚ 1.0.8                  β”‚ Units of Measurement Implementation for Java SE
190 β”‚ Active   β”‚  80 β”‚ 1.6.0                  β”‚ Commons Codec
191 β”‚ Active   β”‚  80 β”‚ 3.3.0                  β”‚ Commons Net
192 β”‚ Active   β”‚  80 β”‚ 4.2.3                  β”‚ Apache HttpClient OSGi bundle
193 β”‚ Active   β”‚  80 β”‚ 4.2.3                  β”‚ Apache HttpCore OSGi bundle
194 β”‚ Active   β”‚  80 β”‚ 3.1.0.7                β”‚ Apache ServiceMix :: Bundles :: commons-httpclient
195 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ openHAB 1.x Compatibility Layer
196 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811060628     β”‚ Smartmeter Binding
197 β”‚ Active   β”‚  80 β”‚ 1.8.3                  β”‚ openHAB db4o Persistence
198 β”‚ Active   β”‚  80 β”‚ 0.10.0.201808271132    β”‚ Eclipse SmartHome OpenWeatherMap Binding
199 β”‚ Active   β”‚  80 β”‚ 2.2.0.201712101325     β”‚ LogReader Binding
200 β”‚ Active   β”‚  80 β”‚ 2.1.0                  β”‚ json-path
201 β”‚ Active   β”‚  80 β”‚ 3.14.0                 β”‚ nrjavaserial
202 β”‚ Active   β”‚  80 β”‚ 2.2                    β”‚ json-smart
203 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Astro Binding
204 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome FSInternetRadio Binding
205 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome NTP Binding
206 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome WeatherUnderground Binding
207 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Configuration UPnP Discovery
208 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Configuration USB-Serial Discovery
209 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Configuration USB-Serial Discovery Linux sysf Scanning
210 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Config Serial
211 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome IoT Marketplace Extension Service
212 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Serial Transport
213 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Serial Transport for RXTX
214 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Serial Transport extension for RXTX RFC2217
215 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome UPnP Transport Bundle
216 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Exec Transformation Service
217 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome JavaScript Transformation Service
218 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome JSonPath Transformation Service
219 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Map Transformation Service
220 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome RegEx Transformation Service
221 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Scale Transformation Service
222 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome XPath Transformation Service
223 β”‚ Active   β”‚  75 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Xslt Transformation Service
224 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Basic UI, Fragments: 246
225 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome WebApp UI, Fragments: 247
226 β”‚ Active   β”‚  80 β”‚ 0.10.0.201811051614    β”‚ Eclipse SmartHome Paper UI, Fragments: 250
227 β”‚ Active   β”‚  80 β”‚ 2.4.0                  β”‚ JUPnP Library
228 β”‚ Active   β”‚  80 β”‚ 1.13.0.201811010308    β”‚ openHAB Mail Action
229 β”‚ Active   β”‚  80 β”‚ 1.13.0.201811010308    β”‚ openHAB EcoTouch Binding
230 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ Exec Binding
231 β”‚ Active   β”‚  80 β”‚ 1.13.0.201811010308    β”‚ openHAB Expire Binding
232 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ Feed Binding
233 β”‚ Active   β”‚  80 β”‚ 1.13.0.201811010308    β”‚ openHAB Fritzbox Binding
234 β”‚ Active   β”‚  80 β”‚ 1.13.0.201811010308    β”‚ openHAB FritzboxTr064 Binding
235 β”‚ Active   β”‚  80 β”‚ 1.13.0.201811010308    β”‚ openHAB HTTP Binding
236 β”‚ Active   β”‚  80 β”‚ 1.13.0.201811010308    β”‚ openHAB KNX Binding
237 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ Xiaomi Mi Smart Home Binding
238 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ Milight Binding
239 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ Network Binding
240 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ SqueezeBox Binding
241 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ ZWave Binding
242 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ openHAB Cloud Connector Bundle
243 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ Feed Transport bundle
244 β”‚ Active   β”‚  80 β”‚ 1.13.0.201811010308    β”‚ openHAB MapDB Persistence Bundle
245 β”‚ Active   β”‚  80 β”‚ 1.13.0.201811010308    β”‚ openHAB RRD4j Persistence Bundle
246 β”‚ Resolved β”‚  75 β”‚ 2.4.0.201811051653     β”‚ openHAB Basic UI Fragment, Hosts: 224
247 β”‚ Resolved β”‚  75 β”‚ 2.4.0.201811051653     β”‚ openHAB Classic UI Fragment, Hosts: 225
248 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ HABmin User Interface
249 β”‚ Active   β”‚  80 β”‚ 2.4.0.201811051653     β”‚ HABPanel User Interface
250 β”‚ Resolved β”‚  75 β”‚ 2.4.0.201811051653     β”‚ openHAB Paper UI Theme Fragment, Hosts: 226
openhab>

Are both meters the same model? Is maybe one of them not sending the unit?
If you set the log level to trace, then the SML file should be output to the log.
Can you please attach that?

Both meters exactly the same model.

When i remove the things file and add the meters again, i get the sml outputs shown in the log. Of both meters… All like it should be. And i got the correct values of both meters.

But after a reboot, only the errors are there, no more sml outputs.

I was asking because of the change from %unit% to kWh you mentioned that only one meter is getting values and the other not.
Regarding the reboot problem, I will have a look.

This problem only was there, when i changed the items-file from %unit% to kWh on my running openhab system.

When i change the whole thing-file to paper ui generated thing with the same old names, i get the correct units. But only for the running session. Reboot kills all.

I removed the paper ui things a few hours ago and added them back with the same names (also inside paper ui). Now the meterreaders give me new values since a few hours…

But when i restart openhab, it will be broken again.

Hi, am totaly lost in this long conversation, is there a version available to download compatible with Openhab 2.3? I don’t wont to upgrade to a snapshot 2.4 at the moment.

Hi, this one should work with 2.3 (no guarantee):https://drive.google.com/file/d/14SL-suq9rxVo2-yvHY2v2QtS9OIkzuNR/view?usp=drivesdk

@halloween: I’ve updated the binding. The reboot issue should be fixed now.

1 Like

Seems to work now, thanks for your fast help!


But i have another question:
I wanted to have the output from one of my powermeter with negative values, because of the better visibility on a graph.

This was my rule with the old binding without included units:

rule "Leistung StromzΓ€hler invertieren"
	when
		Item stromzaehler1_leistung received update
	then
		if (stromzaehler1_leistung.state > 0) {
				stromzaehler1_leistung_negativ.postUpdate("-" + stromzaehler1_leistung.state as Number)
		}
		else {
				stromzaehler1_leistung_negativ.postUpdate(0 - (stromzaehler1_leistung.state as Number))
		}
end

But this doesnΒ΄t work anymore. My new negative item is x1000 to big.

Do you know, how i can get my new negative value without changing the item-style? I think, it now is a new number item without the possibility of unit-conversion?

I use the unit kW - not the given W. Ok, i can make /1000 but is it possible to get the new negative value with unit conversion too?

You can use as QuantitiyType. From this you can make a unit conversion with e.g. .toUnit("kW").
But if your item has correct Number:Power type and the unit β€˜kW’, it should already have correct value without the need to convert it in your rules.

Thank you Matthias for your effort!!!
I just added β€œMY_ITEM [%.2f kWh]” and got kWh again (instead of Wh). Perfect!!!

Hello I am new, and I spend too much time on the SML integration in Openhab. I finally need the help of the community.

Fact & Figures:

  • Debian 9.6 (regular server)
  • Openhab 2.4 RC1 (beta channel) with the corresponding SmartMeter 2.4RC1 binding
  • Siemens TD-3511 Smartmeter connected via VolkszΓ€hler Udo’s USB IR Interface:

lrwxrwxrwx 1 root root 13 Dec 18 00:12 /dev/serial/by-id/usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_015ACF00-if00-port0 -> …/…/ttyUSB1

The test script (Perl) runs fine (although under sudo):

send β€˜/?!’ …
5 Byte written …
/SAT63511D01663003050
send β€˜050’ …
6 Byte written …
F.F(00000000)
0.0.0(220700077)
0.0.1(G23-511-D.01/663-003050)
C.70.0()
1.128.0(0.000kWh)
0.1.0(21)
0.1.2
21(18-12-01 00:00)
0.1.220(18-11-01 00:00)
0.1.2
19(18-10-01 00:00)
0.1.218(18-09-01 00:00)
0.1.2
17(18-08-01 00:00)
0.1.216(18-07-01 00:00)
0.1.2
15(18-06-01 00:00)
0.1.214(18-05-01 00:00)
0.1.2
13(18-04-01 00:00)
0.1.212(18-03-01 00:00)
0.1.2
11(18-02-01 00:00)
0.1.210(18-01-01 00:00)
0.1.2
09(17-12-01 00:00)
0.1.208(17-11-01 00:00)
0.1.2
07(17-10-01 00:00)
1.2.0(169.090*kW)
…

For the SmartMeter binding I tried almost every possible combination, but normally I only get this:

09:03:41.619 [INFO ] [nding.smartmeter.internal.MeterDevice] - Opening connection to smartmeter:meter:64f9169c
09:03:46.937 [INFO ] [smarthome.event.ThingUpdatedEvent ] - Thing β€˜smartmeter:meter:64f9169c’ has been updated.
09:03:46.937 [DEBUG] [smartmeter.internal.SmartMeterHandler] - Initializing Smartmeter handler.
09:03:46.938 [DEBUG] [smartmeter.internal.SmartMeterHandler] - config port = /dev/ttyUSB1
09:03:46.939 [DEBUG] [martmeter.internal.sml.SmlMeterReader] - Created SmlDevice instance smartmeter:meter:64f9169c with serial connector on port /dev/ttyUSB1
09:03:46.940 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - β€˜smartmeter:meter:64f9169c’ changed from OFFLINE (COMMUNICATION_ERROR): The source did not signal an event for 30 seconds and has been terminated. to UNKNOWN (HANDLER_CONFIGURATION_PENDING): Waiting for messages from device
09:03:46.940 [INFO ] [nding.smartmeter.internal.MeterDevice] - Opening connection to smartmeter:meter:64f9169c
09:04:16.949 [WARN ] [nding.smartmeter.internal.MeterDevice] - Failed to read: The source did not signal an event for 30 seconds and has been terminated… Closing connection and trying again in 2 seconds…; smartmeter:meter:64f9169c
java.util.concurrent.TimeoutException: The source did not signal an event for 30 seconds and has been terminated.
at io.reactivex.internal.operators.flowable.FlowableTimeoutTimed$TimeoutSubscriber.onTimeout(FlowableTimeoutTimed.java:139) [263:org.openhab.binding.smartmeter:2.4.0.RC1]
at io.reactivex.internal.operators.flowable.FlowableTimeoutTimed$TimeoutTask.run(FlowableTimeoutTimed.java:170) [263:org.openhab.binding.smartmeter:2.4.0.RC1]
at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker$BooleanRunnable.run(ExecutorScheduler.java:260) [263:org.openhab.binding.smartmeter:2.4.0.RC1]
at io.reactivex.internal.schedulers.ExecutorScheduler$ExecutorWorker.run(ExecutorScheduler.java:225) [263:org.openhab.binding.smartmeter:2.4.0.RC1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]

I even set β€œtrace” for debugging

log:set trace org.openhab.binding.smartmeter

Hi there,

I’m currently struggling with a strange issue when reading power values from the smart meter.

I’ve a smart meter type EMH eHZ-iW8E2A5L0EQ2P. Basically, everything seem to work on the 1st attempt out of the box. Things have been added and items were discovered automatically using PaperUI.
When the sun comes out and the solar panels start to deliver energy, i realized that the power values from the meter are positive instead of negative.
As I was not sure if the meter provides negative or positive values, I digged a little bit deeper and activated logging in the smartmeter binding.

To me, it seems the meter provides the correct sign in case of delivery of energy.

entry: SML_ListEntry{
objName: UNKNOWN 01 00 10 07 00 FF
status: SML_Status{
choice: not set
}
valTime: Unknown tag: 0 value: unknown
unit: WATT
scaler: -1
value: -75762
valueSignature: not set
}
…
…
2018-12-26 09:52:47.960 [DEBUG] [ding.smartmeter.internal.MeterDevice] - Value changed: MeterValue [obis=1-0:16.7.0, value=-7576.200000000001, unit=W]

But according to the GUI and the events.log entries, the negative sign seems not to arrive at the frontend:

…
2018-12-26 09:52:47.961 [vent.ItemStateChangedEvent] - HAZaehler_power changed from 7563.400000000001 W to 7576.200000000001 W
…

The interresting point is, that i have a 2nd meter, which just counts the delivery of energy and this meter provides negative values also in the GUI.

 entry:           SML_ListEntry{
     objName:         UNKNOWN    01 00 10 07 00 FF
     status:          SML_Status{
         choice:          not set
     }
     valTime:         Unknown tag: 0 value: unknown
     unit:            WATT
     scaler:          -1
     value:           -80419
     valueSignature:  not set
 }

Also here, the interpretation seems to be correct, but this time, the value in the GUI is also shown negative:

…
2018-12-26 09:52:52.153 [DEBUG] [ding.smartmeter.internal.MeterDevice] - Value changed: MeterValue [obis=1-0:16.7.0, value=-8041.900000000001, unit=W]
…

Therefore my question: Is there any post-processing done in the binding after this point or is that a topic which belongs more to the openhab side than the binding?

Thanks for your inputs about that,
Adalbert

Hi there,

found it myself.

During the configuration of the item I’ve set the conformance to β€œEDL_FNN”.
Setting to β€œNONE” solved the issue.

Best regards,
Adalbert