openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.56k forks source link

[shelly] UNI with three DS18B20 sensors doesn't initialize #15514

Closed bofakin closed 9 months ago

bofakin commented 10 months ago

Expected Behavior

Thing become ONLINE state

Current Behavior

Possible Solution

The reason might come from this line: https://github.com/openhab/openhab-addons/blob/5cc5ee6f7bcdbaf6fffb2a0213d86c5659672bcc/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfile.java#L129

A analysis of the JSON from the Shelly shows, that the ext_temperature array entries are sorted in the following order 1, 0, 2:

"ext_temperature":{"1":[{"overtemp_threshold_tC":0.0,

This causes the if to fail and the "fix" not to take place.

Steps to Reproduce (for Bugs)

  1. Connect a Shelly UNI with two or three DS18B20
  2. Add as thing
  3. Observe state

Context

I'm trying to use a Shelly UNI with three DS18B20.

Your Environment

bofakin commented 10 months ago

Pull Request: https://github.com/openhab/openhab-addons/pull/15530