ST + Fibaro Universal Binary Sensor (Temperature)

Hi all
I’ve read the posts and seen the frustration on getting this hand Fibaro thing to work (I want to do temperature sensing rather than switching right now)

I’ve made some progress - I used the “Z wave device reference” and added “sensormultilevelv1”

I based it on the v3 code and using the following debug code

log.debug "sensormultilevelv1 SensorMultilevelReport"
    log.debug "cmd.scaledSensorValue ${cmd.scaledSensorValue}"
    log.debug "cmd.sensorValue ${cmd.sensorValue}"
    log.debug "cmd.sensor.Type ${cmd.sensorType}"

It was relatively clear I was getting some temperature data (as this varied as I held the temp sensor then released it)

The following was when I warmed it up in my hand:

682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:11:34 AM: debug cmd.sensorValue [0, 0, 101, 144]
682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:11:34 AM: debug cmd.scaledSensorValue 260.00

682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:10:52 AM: debug cmd.sensorValue [0, 0, 100, 0]
682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:10:52 AM: debug cmd.scaledSensorValue 256.00

682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:09:49 AM: debug cmd.sensorValue [0, 0, 98, 112]
682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:09:49 AM: debug cmd.scaledSensorValue 252.00

682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:09:28 AM: debug cmd.sensorValue [0, 0, 96, 224]
682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:09:28 AM: debug cmd.scaledSensorValue 248.00

and this was when I put the sensor in the freezer temporarily

682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:44:28 AM: debug cmd.sensorValue [255, 255, 220, 16]
682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:44:28 AM: debug cmd.scaledSensorValue -92.00

682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:44:07 AM: debug cmd.sensorValue [255, 255, 224, 192]
682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:44:07 AM: debug cmd.scaledSensorValue -80.00

682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:43:25 AM: debug cmd.sensorValue [255, 255, 234, 32]
682d4ea8-f6d6-48be-b542-cec2e4aa9a21 9:43:25 AM: debug cmd.scaledSensorValue -56.00

What I am having trouble with is how to convert these values into accurate Degrees C values …

i have read the Fibaro docs and also the docs and sample code for the DS18B20 temp sensor but with no luck

Looks like I am “lost” in signed 16 bit extended twos complement to BigDecimal and Short conversion

Does anyone have any suggestions?

Thanks

Julian

Have you tried the temperature handling from the Fibaro Door/Window sensor?

Thanks David

I’ve just checked the write up for this device and it states the temperature sensing is optional with the addition of a DS18B20 - this is pretty much the same set up that I have created using the Fibaro UBS plus the DS18B20

Good suggestion however!

Julian

The reason for posting the link was that the device type in the first post has all the code for handling the DS18B20 sensor input through Fibaro. I think the code is what you were looking for ?

I’ve written a device type that includes the temp sensor code in addition to the IN1 & 2 sensor codes.

Thanks David … sorry i missed your link the first time round … just looking at the code now … might be just what I need

Interestingly I have found a number of ‘manuals’ for the DS18B20 and they seem to vary a bit … the one I looked at tonight did reference an adjustment which seems to be reflected in the code example in your link

Rgds

Julian