eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 783 forks source link

[onewire] temperature thing does not work #6728

Closed ggzengel closed 5 years ago

ggzengel commented 5 years ago

@J-N-K I just migrated to OH240 and can't use device detection, because I have more then 200 devices and generate config files with OpenOffice Calc. This makes a migration very easy.

1. Even with your example files and reading source code, temperature sensors don't go online. They are always in state initializing and Paper UI doesn't know anything about channels. Perhaps there are channel configs missing in temperature.xml.

2. With my old config I could read owserver values. It would be nice if you could add some native channels.

Number Ow_S_BUS_bit_errors "BUS_bit_errors [%d]" (OWIRE) { onewire="deviceId=/statistics/errors;propertyName=BUS_bit_errors;refreshinterval=10" } Number Ow_S_BUS_byte_errors "BUS_byte_errors [%d]" (OWIRE) { onewire="deviceId=/statistics/errors;propertyName=BUS_byte_errors;refreshinterval=10" }

3. The documentation is not complete. There are channel types like 'dio' missing. And there could be more examples about channel configs.

In my sample test2 works and test even not:

Bridge onewire:owserver:server [ network-address="127.0.0.1" ] {
 Thing temperature test        [id="28.65E39B030000"] {
   Type temperature-por-res : temperature [ resolutions=9 ]
 }
 Thing digitalio2 test2        [id="12.9B7092000000", refresh=5] {
   Type dio : digital0 [logic="inverted"] 
 }
}
05:17:27.950 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:temperature:server:test' changed from INITIALIZING to UNINITIALIZED
05:17:27.951 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:temperature:server:test' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
05:17:27.952 [DEBUG] [.internal.owserver.OwserverConnection] - closed connection
05:17:27.952 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:digitalio2:server:test2' changed from ONLINE to UNINITIALIZED
05:17:27.953 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:digitalio2:server:test2' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
05:17:27.954 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:owserver:server' changed from ONLINE to UNINITIALIZED
05:17:27.954 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:owserver:server' changed from UNINITIALIZED to ONLINE
05:17:27.956 [DEBUG] [org.eclipse.smarthome.binding.onewire] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=434, service.bundleid=232, service.scope=singleton} - org.eclipse.smarthome.binding.onewire
05:17:27.957 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:owserver:server' changed from ONLINE to UNINITIALIZED (HANDLER_MISSING_ERROR)
05:17:27.963 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'onewire.things'
05:17:27.966 [DEBUG] [internal.discovery.OwDiscoveryService] - registering discovery service for org.eclipse.smarthome.binding.onewire.internal.handler.OwserverBridgeHandler@e31d099
05:17:27.967 [DEBUG] [org.eclipse.smarthome.binding.onewire] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=435, service.bundleid=232, service.scope=singleton} - org.eclipse.smarthome.binding.onewire
05:17:27.968 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:owserver:server' changed from UNINITIALIZED to INITIALIZING
05:17:27.968 [DEBUG] [.internal.owserver.OwserverConnection] - opened OwServerConnection to 127.0.0.1:4304
05:17:27.970 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:owserver:server' changed from INITIALIZING to UNKNOWN
05:17:27.971 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:owserver:server' changed from UNKNOWN to ONLINE
05:17:27.971 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:temperature:server:test' changed from UNINITIALIZED to INITIALIZING
05:17:27.972 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:digitalio2:server:test2' changed from UNINITIALIZED to INITIALIZING
05:17:27.972 [DEBUG] [ternal.device.AbstractDigitalOwDevice] - configured onewire:digitalio2:server:test2 channel 0: path=[org.eclipse.smarthome.binding.onewire.internal.device.OwDeviceParameterMap@40c05541], mode=INPUT, logic=INVERTED
05:17:27.973 [DEBUG] [ternal.device.AbstractDigitalOwDevice] - configured onewire:digitalio2:server:test2 channel 1: path=[org.eclipse.smarthome.binding.onewire.internal.device.OwDeviceParameterMap@40c05541], mode=INPUT, logic=NORMAL
05:17:27.974 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:digitalio2:server:test2' changed from INITIALIZING to UNKNOWN
05:17:27.976 [INFO ] [smarthome.event.ThingUpdatedEvent    ] - Thing 'onewire:temperature:server:test' has been updated.
05:17:27.985 [INFO ] [smarthome.event.ThingUpdatedEvent    ] - Thing 'onewire:digitalio2:server:test2' has been updated.
05:17:28.967 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'onewire:digitalio2:server:test2' changed from UNKNOWN to ONLINE
05:17:28.979 [INFO ] [del.core.internal.ModelRepositoryImpl] - Refreshing model 'onewire.things'
...
<nothing happens here>

P.S: common.xml is miss formatted (the tags are not in the same column)

J-N-K commented 5 years ago

1) Already fixed with #6712 2) Do you really see numbers there? Mine always stay at 0. Anyway, I can add some statistics to the bridge, which vallues do you need? 3) I updated the documentation and added the missing channels to #6626.

In general it is better to open different issues for different topics (doesn't cost much but helps keep track of what still needs to be addressed.

ggzengel commented 5 years ago
  1. The changes are before release? Why aren't the changes in 2.4.0 if it's broken? Is there a snapshot of your binding? I'm blind since migrating to 2.4.0.
  2. I see numbers, because I have one or two critical strings which are showing CRC errors sometimes and I like to put this to influxdb for monitoring. Perhaps you can create a native device with path parameter (path="/bus.0/bus.2/interface/statistics/errors") and two channels (number and string)?
  3. Can you extend the example like my example to show the usage of channels. It would be very helpful.

In general it is better to open different issues for different topics (doesn't cost much but helps keep track of what still needs to be addressed.

Normally I open multiple issues if I know exactly where it has to go. It was the first impression of your binding and 2. and 3. are only suggestions which are not worth to open an issue until you are interested in them. In fact I captured this issue.

ggzengel commented 5 years ago

Sorry, I just saw the fix was only 4 days ago. I think a lot of people use onewire and need a fixed version. Will be there a 2.4.1 early?

J-N-K commented 5 years ago

I‘ll provide one tomorrow. Can‘t answer when or if an OH 2.4.1 will be published.

ggzengel commented 5 years ago

Meanwhile I found the snapshot of 2.5.0 and it works:

bundle:install https://openhab.jfrog.io/openhab/online-repo-snapshot/2.5/org/eclipse/smarthome/binding/org.eclipse.smarthome.binding.onewire/0.11.0-SNAPSHOT/org.eclipse.smarthome.binding.onewire-0.11.0-SNAPSHOT.jar

ggzengel commented 5 years ago

@kaikreuzer What's about putting important bug fixes to stable? It's not user friendly to poke bundles from unstable with the risk to break something.

J-N-K commented 5 years ago

For 2. please try this jar. It's pretty straight forward.

Bridge onewire:owserver:mybridge [ network-address="192.168.0.51" ] {
    Thing temperature mysensor   [id="28.505AF0020000" ] 
    Channels:
        Type owfs-number : crc8errors [
            path="statistics/errors/CRC8_errors" 
       ]
}
J-N-K commented 5 years ago

@ggzengel could you comment on the direct-access-channels?

ggzengel commented 5 years ago

version: 0.11.0.201812311010

I just tried it and it doesn't get a refresh.

I use:

  Channels:
    Type owfs-number : Ow_B2_crc8errors [ path="/bus.2/statistics/errors/CRC8_errors" ]

Number             Ow_B2_crc8errors    "Bus2 CRC8 errors"  (TEST) { channel="onewire:owserver:server1:Ow_B2_crc8errors" }

In Paper UI I see:

Direct Access to OWFS-Path (Number) onewire:owserver:server1:Ow_B2_crc8errors

refreshTask didn't show it.

J-N-K commented 5 years ago

I don't know which version that is. I have made a new build.

ggzengel commented 5 years ago

Thanks. It works like expected.