Issues with Davis Binding and Units of Measurement Conversions

Hey guys,

I am having issues doing unit conversions with items from my Davis Binding (version: 1.14.0.201905050308). I am trying to convert C to F but it isnt working. See my files below. I set my region settings and OpenHAB and even explicitly set the unit type preference in system config.

When i change the “[%.1f °F]” section in the items file, it changes the unit C to F in the sitemap but it doesn’t change the number. In other words 20C will change to 20F.

Item File:
Number:Temperature OutsideTemp "Outside Temp [%.1f °F]" { davis="outside_temp" }

Ive tried to put [%.1f °F], [%.1f °C], [%.1f °K], and [%.1f %unit%] and all change the unit but not the number. [%.1f %unit%] changes the unit to F but not the number.

Sitemap:
Text item=OutsideTemp

Am i doing something wrong here?

Remove the UoM and see if it works e.g. remove the : and Temperature part.

Number OutsideTemp "Outside Temp [%.1f °F]" { davis="outside_temp" }


Are you sure Davis binding provides UoM values ?

Same happened as in the OP.

I wasnt aware that bindings had to specify this. If this is the case i guess the binding isn’t compatible with OpenHAB UoM?

Yes, all bindings have not been updated to take advantage of UoM. So you have to refer to the binding documentation to check this

You can try a more recent snapshot version.
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.davis/1.15.0-SNAPSHOT/

Remove the binding from PaperUI and add the jar file to /usr/share/openhab2/addons then restart OH.

From binding documentation, UoM is not implemented

2 Likes

Thanks. Where can i find that documentation for next time? I appreciate your help!

If no UoM on the item you should still be able to add this in your sitemap.
Sitemap file example:

Text item=OutsideTemp label="Outside [%.1f °F]"

In the openhab website in the bindings section

1 Like

Okay thanks so much for the help! I was able get it to work! I swear i tried this earlier but guess i didn’t see the Item and Sitemap files below.

Items File
Number:Temperature OutsideTemp "Outside Temp [%.1f °C]" <temperature> { davis="outside_temp" }

Sitemap FIle
Text item=OutsideTemp label="Outside Temp [%.1f °F]"

EDIT: I just discovered where I went wrong! in the items file there cant be a space between the unit letter (C or F) and the bracket. Once I fixed that, it all converted fine.

Glad you got it working. :+1:

Please change the solution check box so others having this issue will also find a quick solution. :wink:

Thanks

done. thanks!

I am getting these log messages with the 1.15 snapshot binding. Any idea what could be causing this? Im not too good at understanding logs. It seems to be accepting data from the station correctly.

Thanks in advance for the help!

Here is my Davis.cfg

hostName=192.168.1.196

readResponseWaitTime=1000

refresh=10000

Logs:

2020-04-20 19:48:26.891 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:27.541 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:28.741 [WARN ] [.binding.davis.internal.DavisBinding] - Wakeup failed, trying reset sequence!

2020-04-20 19:48:28.741 [WARN ] [.binding.davis.internal.DavisBinding] - error, dropping remaining data!

2020-04-20 19:48:29.192 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:30.842 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:31.393 [WARN ] [.binding.davis.internal.DavisBinding] - I/O Exception reset after Error: {}

java.io.IOException: unexpected response too short: , expected: \n\rOK\n\r

	at org.openhab.binding.davis.internal.DavisBinding.expectString(DavisBinding.java:447) ~[bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.resetAfterError(DavisBinding.java:309) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.sendCommand(DavisBinding.java:434) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.execute(DavisBinding.java:140) [bundleFile:?]

	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) [bundleFile:?]

	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]

2020-04-20 19:48:34.495 [WARN ] [.binding.davis.internal.DavisBinding] - unexpected response too short: , expected: \n\rOK\n\r

2020-04-20 19:48:34.495 [WARN ] [.binding.davis.internal.DavisBinding] - error, dropping remaining data!

==> /var/log/openhab2/events.log <==

2020-04-20 19:48:35.883 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugRssi changed from -61 dBm to -62 dBm

2020-04-20 19:48:35.884 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugPower changed from 0.573461 W to 0.614874 W

2020-04-20 19:48:35.884 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugCurrent changed from 0.07361 A to 0.074154 A

2020-04-20 19:48:35.884 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugVoltage changed from 126.540277 V to 126.657605 V

==> /var/log/openhab2/openhab.log <==

2020-04-20 19:48:36.244 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:37.596 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

==> /var/log/openhab2/events.log <==

2020-04-20 19:48:40.098 [vent.ItemStateChangedEvent] - ZWaveSerialControllerSerialSof changed from 28950 to 28951

2020-04-20 19:48:40.185 [vent.ItemStateChangedEvent] - ZWaveSerialControllerSerialSof changed from 28951 to 28952

==> /var/log/openhab2/openhab.log <==

2020-04-20 19:48:40.897 [WARN ] [.binding.davis.internal.DavisBinding] - I/O Exception reset after Error: {}

java.io.IOException: unexpected response too short: , expected: \n\rOK\n\r

	at org.openhab.binding.davis.internal.DavisBinding.expectString(DavisBinding.java:447) ~[bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.resetAfterError(DavisBinding.java:309) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.sendCommand(DavisBinding.java:434) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.execute(DavisBinding.java:140) [bundleFile:?]

	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) [bundleFile:?]

	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]

==> /var/log/openhab2/events.log <==

2020-04-20 19:48:41.633 [vent.ItemStateChangedEvent] - ZWaveSerialControllerSerialSof changed from 28952 to 28953

==> /var/log/openhab2/openhab.log <==

2020-04-20 19:48:42.000 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:42.545 [WARN ] [.binding.davis.internal.DavisBinding] - expected length of response: 99, but got: 107

2020-04-20 19:48:42.546 [WARN ] [.binding.davis.internal.DavisBinding] - error, dropping remaining data!

2020-04-20 19:48:44.300 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:45.646 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:47.947 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:49.602 [WARN ] [.binding.davis.internal.DavisBinding] - unexpected response too short: , expected: <ACK>

2020-04-20 19:48:49.602 [WARN ] [.binding.davis.internal.DavisBinding] - error, dropping remaining data!

==> /var/log/openhab2/events.log <==

2020-04-20 19:48:50.931 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugPower changed from 0.614874 W to 0.609929 W

2020-04-20 19:48:50.931 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugCurrent changed from 0.074154 A to 0.073703 A

2020-04-20 19:48:50.931 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugVoltage changed from 126.657605 V to 126.603915 V

==> /var/log/openhab2/openhab.log <==

2020-04-20 19:48:51.703 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:52.248 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:54.449 [WARN ] [.binding.davis.internal.DavisBinding] - I/O Exception reset after Error: {}

java.io.IOException: unexpected response too short: \n\r, expected: \n\rOK\n\r

	at org.openhab.binding.davis.internal.DavisBinding.expectString(DavisBinding.java:447) ~[bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.resetAfterError(DavisBinding.java:309) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.sendCommand(DavisBinding.java:434) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.execute(DavisBinding.java:140) [bundleFile:?]

	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) [bundleFile:?]

	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]

2020-04-20 19:48:55.551 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:48:57.005 [WARN ] [.binding.davis.internal.DavisBinding] - I/O Exception reset after Error: {}

java.io.IOException: unexpected response too short: , expected: \n\rOK\n\r

	at org.openhab.binding.davis.internal.DavisBinding.expectString(DavisBinding.java:447) ~[bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.resetAfterError(DavisBinding.java:309) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.sendCommand(DavisBinding.java:434) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.execute(DavisBinding.java:140) [bundleFile:?]

	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) [bundleFile:?]

	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]

2020-04-20 19:48:58.107 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:49:00.853 [WARN ] [.binding.davis.internal.DavisBinding] - unexpected response too short: \n\r, expected: \n\rOK\n\r

2020-04-20 19:49:00.853 [WARN ] [.binding.davis.internal.DavisBinding] - error, dropping remaining data!

2020-04-20 19:49:02.954 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

==> /var/log/openhab2/events.log <==

2020-04-20 19:49:03.408 [vent.ItemStateChangedEvent] - rx_total changed from 27603 to 27623

2020-04-20 19:49:03.409 [vent.ItemStateChangedEvent] - rx_crc changed from 0

 to 0

==> /var/log/openhab2/openhab.log <==

2020-04-20 19:49:04.508 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

==> /var/log/openhab2/events.log <==

2020-04-20 19:49:05.984 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugRssi changed from -62 dBm to -61 dBm

2020-04-20 19:49:05.984 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugPower changed from 0.609929 W to 0.601883 W

2020-04-20 19:49:05.984 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugCurrent changed from 0.073703 A to 0.074206 A

2020-04-20 19:49:05.984 [vent.ItemStateChangedEvent] - MasterBRFanSmartplugVoltage changed from 126.603915 V to 126.5144 V

==> /var/log/openhab2/openhab.log <==

2020-04-20 19:49:06.809 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:49:08.255 [WARN ] [.binding.davis.internal.DavisBinding] - I/O Exception reset after Error: {}

java.io.IOException: unexpected response too short: , expected: \n\rOK\n\r

	at org.openhab.binding.davis.internal.DavisBinding.expectString(DavisBinding.java:447) ~[bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.resetAfterError(DavisBinding.java:309) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.sendCommand(DavisBinding.java:434) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.execute(DavisBinding.java:140) [bundleFile:?]

	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) [bundleFile:?]

	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]

2020-04-20 19:49:09.110 [WARN ] [.binding.davis.internal.DavisBinding] - wakeup failed, retry

2020-04-20 19:49:10.311 [WARN ] [.binding.davis.internal.DavisBinding] - Wakeup failed, trying reset sequence!

2020-04-20 19:49:10.311 [WARN ] [.binding.davis.internal.DavisBinding] - error, dropping remaining data!

2020-04-20 19:49:10.311 [WARN ] [.binding.davis.internal.DavisBinding] - I/O Exception reset after Error: {}

java.io.IOException: Stream closed.

	at java.net.AbstractPlainSocketImpl.available(AbstractPlainSocketImpl.java:470) ~[?:1.8.0_232]

	at java.net.SocketInputStream.available(SocketInputStream.java:259) ~[?:1.8.0_232]

	at org.openhab.binding.davis.internal.DavisBinding.readResponse(DavisBinding.java:326) ~[bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.resetAfterError(DavisBinding.java:305) [bundleFile:?]

	at org.openhab.binding.davis.internal.DavisBinding.execute(DavisBinding.java:143) [bundleFile:?]

	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) [bundleFile:?]

	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]