Closed ggzengel closed 5 years ago
Other bindings (e.g. Nest) set Things offline with an appropriate message whenever commands fail due to timeouts. That way logs are not filled with stack traces and users can see such problems in UIs such as Paper UI.
@ggzengel: thanks for noticing this. If I get it right, the only thing that is not working is the hard-coded 30 second timeout, right? I would make it dependant on the refresh interval. The thing with the syslog is cosmetic. I will try to get this fixed as well. RxJava is doing this, as the source publisher is getting destroyed asynchronously while still waiting for a message from the device.
@wborn: The thing is set offline in the above case with an appropriate error message already. But I think it would really be better to not waste the log in case of timeouts (only a short warning message).
@ggzengel: short note about your thing configuration: conversionRatio
is not supported anymore and is therefore ignored.
@msteigenberger The timeout is not a problem. OH was stressed by a lot of reconfiguration/testing and smartmeter works like a charm. It was only the cosmetic thing that I found an exception in /var/log/syslog.
Perhaps there should be an exception handler in ESH which catch exceptions before they are leaving the VM.
waste the log in case of timeouts (only a short warning message)
If the status message is clear enough you could also log the exception on debug. That way the full stacktrace is preserved for developers. See also the Logging Coding Guidelines:
For bindings, you should NOT log errors, if e.g. connections are dropped - this is considered to be an external problem and from a system perspective to be a normal and expected situation. The correct way to inform users about such events is to update the Thing status accordingly. Note that all events (including Thing status events) are anyhow already logged.
@msteigenberger After removing conversionRatio
the values jumped by factor of 1000.
@ggzengel: yeah, the configuration is indeed not ignored, but undocumented and not available in the configuration through PaperUI and also deprecated. You should rather use the UOM capability of OH. In your item definition you just need to mention the correct unit (like kWh
).
@wborn: thanks for pointing to this!
@msteigenberger I just migrated to OH2.4.0 and I'm happy that smartmeter still works like a charm. Thanks again for your work.
While running OH2.40 I can see an exception after stressing OH with missing onewire sensors. The main problem is the onewire binding but I think smartmeter shouldn't throw exceptions to systems syslog.
While stressing the poll interval from smartmeter raises from 2 sec to 90 sec and smartmeter gets a timeout. The strange thing is that CPU load is nearby 0.
In openhab I see:
In syslog I see:
My config: