(EDGE Driver-Mc): Z-Wave Edge Drivers and others with FIBARO devices:

@Mariano_Colmenarejo

I was going to mention default values were 0… but that was simple enough to change myself.

Do you have any ideas about the internal temp sensor ? It seems odd that it is so far off. Its values are unusable.

Also - can you add two parameters to the settings:

  1. External Temp offset - will adjust the value of the temperature reported (+/- # degrees in .1 degree increments)

  2. Internal Temp offset - will adjust the value of the temperature reported (+/- # degrees in .1 degree incremenrs)

These will be used to calibrate the temp reported by the driver to match the actual temperature. (Offset is applied as an absolute value - independent of whether the temp is in F or C)

Again - thanks for the amazing help.

I don’t know where the internal temperature sensor is mounted and if it gets contaminated by the heat of the electronics or by touching it with the hand.

With temperature compensation there are one or two problems:

  • By having two temperature capabilities, if I use the stock compensation, which is applied in the App itself and takes into account the ºC or ºF units used by its location, I don’t know which of the temperatures it will apply to internal or external.
  • If I make two non-personalized compensations, they would be applied before being shown by the App and would not take into account the ºC or ºF units of their location.

Your location uses ºF and your device must be model 0x2000 (US). Could you send me a log of the device to see in which units it is sending the temperature? In zigbee it is always in ºC, but in Z-Wave it can be in ºC or ºF

The internal sensor is inaccurate because the Smart Implant heats up due to its own power consumption. In the driver is only possible correct the value, but it is always inaccurate.

@Mariano_Colmenarejo this is still occurring. Any ideas? Any thing else I can do/provide to help troubleshoot?

Hi @Nezmo

I’ll fix it later

1 Like

Understood… but honestly Fibaro should have compensated for that… it reaches a steady-state thermal background temp that they could have accounted for… Others temp/humidity monitors do that (e.g. Aeotec is quite accurate)

If we have a temp offset value - we can manually compensate for it somewhat…

@Mariano_Colmenarejo

Device information (no model shown on the back of device or box)


Logs summary:

Log Event Detail - External Temp

Log Event Detail - Internal Temp

Let me know if there is anything else I can provide.

I need the logs with the CLI to see what units ºC or ºF the device is sending to the driver

Can you provide me with some directions/guidance on how to do that? I do not have a CLI installed right now…

I see you provided directions here…

Are these still correct?

1 Like

@Mariano_Colmenarejo

Log output

Looks like everything is in Celsius correct? (the manual never refers to anythign but Celsius… and I noticed there was no field to set units)

What do you make of “received with handler unnamed” (is it supposed to be unnamed)

1 Like

Hi @Nezmo
Fixed in this driver version
It will be updated automatically

───────────────────────────────────────────────────
 Name         Z-Wave Bulb Mc
 Version      2023-02-04T20:17:05.395024951        
───────────────────────────────────────────────────

Awesome.

Note, I’ve tried updating/installing the driver from the CLI but it’s not finding this new version. My driver is currently at:

2023-01-06T10:23:09.167

Does it take time after publishing to become available?

Sorry I published other driver.
Fixed now

1 Like

Thank you. I confirm the fix is good.

1 Like

Yes, all in ºC

The unnamed are not important, they are things of the default libraries

I have put 2 custom temperature offset in preferences.
As the correction is made before sending the event to the platform, it will always be in ºC between -20ºc and 20ºc with a precision of 0.1ºc, it is the maximum that can be set, it only admits 1 decimal.

You can install this version immediately on your hub with the CLI command:

smartthings edge:drivers:install

and following the on-screen instructions.

You may have to clear the cache of the app, if you use android, to see the new preferences profile

───────────────────────────────────────────────────
 Name         Fibaro Smart Implant BETA
 Version      2023-02-04T21:13:08.166140729        
───────────────────────────────────────────────────

I must apologize but I’m not familiar with using IDE to capture data.

I believe this was the previously used device handler:


/**

  • Monoprice Motion Sensor
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.
  • Version: v2
  • Updates:

  • 02-18-2016 : Initial commit
  • 04-08-2016 : Added fingerprint info

*/

preferences {
input description: “Number of minutes after movement is gone before its reported inactive by the sensor.”, displayDuringSetup: false, type: “paragraph”, element: “paragraph”
input “inactivityTimeout”, “number”, title: “Inactivity Timeout”, displayDuringSetup: true, default: 3

input description: "This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter \"-5\". If 3 degrees too cold, enter \"+3\".", displayDuringSetup: false, type: "paragraph", element: "paragraph"
input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false

input description: "This feature allows you to change the temperature Unit. If left blank or anything else is typed the default is F.", displayDuringSetup: false, type: "paragraph", element: "paragraph" 
input "tempUnit", "string", title: "Celsius or Fahrenheit", description: "Temperature Unit (Type C or F)", displayDuringSetup: false

}

metadata {
definition (name:“My Monoprice Motion Sensor”, namespace:“jscgs350”, author: “florianz”) {
capability “Battery”
capability “Motion Sensor”
capability “Temperature Measurement”
capability “Sensor”

    fingerprint deviceId: "0x2001", inClusters: "0x71,0x85,0x80,0x72,0x30,0x86,0x31,0x70,0x84"

}

tiles(scale: 2) {
	multiAttributeTile(name:"motion", type: "generic", width: 6, height: 4){
		tileAttribute ("device.motion", key: "PRIMARY_CONTROL") {
			attributeState "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0"
			attributeState "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff"
		}
	}
	valueTile("temperature", "device.temperature", width: 3, height: 2) {
		state("temperature", label:'${currentValue}°', unit:"F",
			backgroundColors:[
				[value: 31, color: "#153591"],
				[value: 44, color: "#1e9cbb"],
				[value: 59, color: "#90d2a7"],
				[value: 74, color: "#44b621"],
				[value: 84, color: "#f1d801"],
				[value: 95, color: "#d04e00"],
				[value: 96, color: "#bc2323"]
			]
		)
	}
	valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 3, height: 2) {
		state "battery", label:'${currentValue}% battery', unit:""
	}
	main(["motion", "temperature"])
	details(["motion", "temperature", "battery"])
}

}

def parse(String description) {
log.trace “Parse Raw: ${description}”
def result =
// Using reference in: http://www.pepper1.net/zwavedb/device/197
def cmd = zwave.parse(description, [0x20: 1, 0x80: 1, 0x31: 2, 0x84: 2, 0x71: 1, 0x30: 1])
if (cmd) {
if (cmd instanceof physicalgraph.zwave.commands.wakeupv2.WakeUpNotification) {
result.addAll(sendSettingsUpdate(cmd))
}
result << createEvent(zwaveEvent(cmd))
if (cmd.CMD == “8407”) {
result << new physicalgraph.device.HubAction(zwave.wakeUpV1.wakeUpNoMoreInformation().format())
}
}

if (inactivityTimeout) {
	log.debug "Applying preferences for Monoprice Motion Sensor: ${inactivityTimeout}"
    zwave.configurationV1.configurationSet(configurationValue: [inactivityTimeout], parameterNumber: 1, size: 1).format()
	log.debug "zwaveEvent ConfigurationReport: '${cmd}'"
}

return result

}

def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) {
//log.trace “Woke Up!”
def map = [:]
map.value = “”
map.descriptionText = “${device.displayName} woke up.”
return map
}

def sendSettingsUpdate(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) {
/* def inactivityTimeout = (settings.inactivityTimeout == null ?
1 : Integer.parseInt(settings.inactivityTimeout))
def inactivityTimeoutStr = Integer.toString(inactivityTimeout) */
def actions =
def lastBatteryUpdate = state.lastBatteryUpdate == null ? 0 : state.lastBatteryUpdate
if ((new Date().time - lastBatteryUpdate) > 1000 * 60 * 60 * 24) {
actions.addAll([
response(zwave.batteryV1.batteryGet().format()),
[ descriptionText: “Requested battery update from ${device.displayName}.”, value: “” ],
response(“delay 600”),
])
}
actions.addAll([
response(zwave.configurationV1.configurationSet(
configurationValue: [inactivityTimeout], defaultValue: False, parameterNumber: 1, size: 1).format()),
response(“delay 600”),
[ descriptionText: “${device.displayName} was sent inactivity timeout of ${inactivityTimeoutStr}.”, value: “” ]
])
actions
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
def map = [:]
map.name = “motion”
map.value = cmd.value ? “active” : “inactive”
map.handlerName = map.value
map.descriptionText = cmd.value ? “${device.displayName} detected motion” : “${device.displayName} motion has stopped.”
return map
}

def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv2.SensorMultilevelReport cmd) {
def map = [:]
if (cmd.sensorType == 1) {
def cmdScale = cmd.scale == 1 ? “F” : “C”
def preValue = convertTemperatureIfNeeded(cmd.scaledSensorValue, cmdScale, cmd.precision)
def value = preValue as float
map.unit = tempUnit
map.name = “temperature”

    switch(tempUnit) {
        case ["C","c"]:
			if (tempOffset) {
            	def offset = tempOffset as float
	       		map.value = value + offset as float
            }
            else {
            	map.value = value as float
            }  
            map.value = map.value.round()
            map.descriptionText = "${device.displayName} temperature is ${map.value}°C."
		break
            
        case ["F","f"]:
        	if (tempOffset) {
            	def offset = tempOffset as float
	        	map.value = value + offset as float
            }
            else {
            	map.value = value as float
            }    
            map.value = map.value.round()
            map.descriptionText = "${device.displayName} temperature is ${map.value}°F."
            break
        
        default:
        	if (tempOffset) {
        	   	def offset = tempOffset as float
	        	map.value = value + offset as float
            }
            else {
       	    	map.value = value as float
            }    
            map.value = map.value.round()
            map.descriptionText = "${device.displayName} temperature is ${map.value}°."
            break    
}		
}
map

}

def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
state.lastBatteryUpdate = new Date().time
def map = [ name: “battery”, unit: “%” ]
if (cmd.batteryLevel == 0xFF || cmd.batteryLevel == 0 ) {
map.value = 1
map.descriptionText = “${device.displayName} battery is almost dead!”
} else if (cmd.batteryLevel < 15 ) {
map.value = cmd.batteryLevel
map.descriptionText = “${device.displayName} battery is low!”
} else {
map.value = cmd.batteryLevel
}
map
}

def zwaveEvent(physicalgraph.zwave.Command cmd) {
// Catch-all handler. The sensor does return some alarm values, which
// could be useful if handled correctly (tamper alarm, etc.)
[descriptionText: “Unhandled: ${device.displayName}: ${cmd}”, displayed: false]
}

@Mariano_Colmenarejo

It automatically upgraded the driver:

2023-02-05T03:31:27.413917819+00:00 DEBUG Fibaro Smart Implant BETA Fibaro Smart Implant device thread event handled
2023-02-05T03:31:28.670738235+00:00 TRACE Fibaro Smart Implant BETA Received event with handler driver_lifecycle
2023-02-05T03:31:39.300873232+00:00 TRACE Fibaro Smart Implant BETA Setup driver zwave_smart_implant with lifecycle handlers:
DeviceLifecycleDispatcher: zwave_smart_implant
default_handlers:
driverSwitched:
init:
added:
doConfigure:
infoChanged:
child_dispatchers:
DeviceLifecycleDispatcher: zwave_smart_implant → Thermostat subdriver
default_handlers:
added:
infoChanged:
init:
child_dispatchers:

2023-02-05T03:31:39.305101566+00:00 TRACE Fibaro Smart Implant BETA Setup driver zwave_smart_implant with Capability handlers:
CapabilityCommandDispatcher: zwave_smart_implant
default_handlers:
refresh:
refresh
switch:
on
off
child_dispatchers:
CapabilityCommandDispatcher: zwave_smart_implant → Thermostat subdriver
default_handlers:
thermostatFanMode:
setThermostatFanMode
thermostatHeatingSetpoint:
setHeatingSetpoint
legendabsolute60149.thermostatLocked:
setThermostatLocked
thermostatCoolingSetpoint:
setCoolingSetpoint
refresh:
refresh
thermostatMode:
setThermostatMode
child_dispatchers:

2023-02-05T03:31:39.305735441+00:00 TRACE Fibaro Smart Implant BETA Setup driver zwave_smart_implant with Z-Wave handlers:
ZwaveDispatcher: zwave_smart_implant
default_handlers:
SENSOR_BINARY:
REPORT
SENSOR_MULTILEVEL:
REPORT
BASIC:
REPORT
SENSOR_ALARM:
REPORT
SWITCH_BINARY:
REPORT
SWITCH_MULTILEVEL:
REPORT
NOTIFICATION:
REPORT
child_dispatchers:
ZwaveDispatcher: zwave_smart_implant → Thermostat subdriver
default_handlers:
child_dispatchers:

2023-02-05T03:31:39.345179482+00:00 TRACE Fibaro Smart Implant BETA Z-Wave Device: 90395e70-07a9-4915-a570-941b5930c937
Manufacturer: 0x010F Product Type: 0x0502 Product ID: 0x2000
[0]: ZWAVEPLUS_INFO, SWITCH_BINARY, ASSOCIATION, MULTI_CHANNEL_ASSOCIATION, ASSOCIATION_GRP_INFO, TRANSPORT_SERVICE, VERSION, MANUFACTURER_SPECIFIC, DEVICE_RESET_LOCALLY, POWERLEVEL, SECURITY, SECURITY_2, CENTRAL_SCENE, SENSOR_MULTILEVEL, MULTI_CHANNEL, CONFIGURATION, CRC_16_ENCAP, NOTIFICATION, PROTECTION, FIRMWARE_UPDATE_MD, SUPERVISION, APPLICATION_STATUS [1]: ZWAVEPLUS_INFO, SWITCH_BINARY, ASSOCIATION, MULTI_CHANNEL_ASSOCIATION, ASSOCIATION_GRP_INFO, TRANSPORT_SERVICE, VERSION, MANUFACTURER_SPECIFIC, DEVICE_RESET_LOCALLY, POWERLEVEL, SECURITY, SECURITY_2, CENTRAL_SCENE, SENSOR_MULTILEVEL, MULTI_CHANNEL, CONFIGURATION, CRC_16_ENCAP, NOTIFICATION, PROTECTION, FIRMWARE_UPDATE_MD, SUPERVISION, APPLICATION_STATUS [2]: ZWAVEPLUS_INFO, SWITCH_BINARY, ASSOCIATION, MULTI_CHANNEL_ASSOCIATION, ASSOCIATION_GRP_INFO, TRANSPORT_SERVICE, VERSION, MANUFACTURER_SPECIFIC, DEVICE_RESET_LOCALLY, POWERLEVEL, SECURITY, SECURITY_2, CENTRAL_SCENE, SENSOR_MULTILEVEL, MULTI_CHANNEL, CONFIGURATION, CRC_16_ENCAP, NOTIFICATION, PROTECTION, FIRMWARE_UPDATE_MD, SUPERVISION, APPLICATION_STATUS [3]: ZWAVEPLUS_INFO, SWITCH_BINARY, ASSOCIATION, MULTI_CHANNEL_ASSOCIATION, ASSOCIATION_GRP_INFO, TRANSPORT_SERVICE, VERSION, MANUFACTURER_SPECIFIC, DEVICE_RESET_LOCALLY, POWERLEVEL, SECURITY, SECURITY_2, CENTRAL_SCENE, SENSOR_MULTILEVEL, MULTI_CHANNEL, CONFIGURATION, CRC_16_ENCAP, NOTIFICATION, PROTECTION, FIRMWARE_UPDATE_MD, SUPERVISION, APPLICATION_STATUS [4]: ZWAVEPLUS_INFO, SWITCH_BINARY, ASSOCIATION, MULTI_CHANNEL_ASSOCIATION, ASSOCIATION_GRP_INFO, TRANSPORT_SERVICE, VERSION, MANUFACTURER_SPECIFIC, DEVICE_RESET_LOCALLY, POWERLEVEL, SECURITY, SECURITY_2, CENTRAL_SCENE, SENSOR_MULTILEVEL, MULTI_CHANNEL, CONFIGURATION, CRC_16_ENCAP, NOTIFICATION, PROTECTION, FIRMWARE_UPDATE_MD, SUPERVISION, APPLICATION_STATUS [5]: ZWAVEPLUS_INFO, SWITCH_BINARY, ASSOCIATION, MULTI_CHANNEL_ASSOCIATION, ASSOCIATION_GRP_INFO, TRANSPORT_SERVICE, VERSION, MANUFACTURER_SPECIFIC, DEVICE_RESET_LOCALLY, POWERLEVEL, SECURITY, SECURITY_2, CENTRAL_SCENE, SENSOR_MULTILEVEL, MULTI_CHANNEL, CONFIGURATION, CRC_16_ENCAP, NOTIFICATION, PROTECTION, FIRMWARE_UPDATE_MD, SUPERVISION, APPLICATION_STATUS [6]: ZWAVEPLUS_INFO, SWITCH_BINARY, ASSOCIATION, MULTI_CHANNEL_ASSOCIATION, ASSOCIATION_GRP_INFO, TRANSPORT_SERVICE, VERSION, MANUFACTURER_SPECIFIC, DEVICE_RESET_LOCALLY, POWERLEVEL, SECURITY, SECURITY_2, CENTRAL_SCENE, SENSOR_MULTILEVEL, MULTI_CHANNEL, CONFIGURATION, CRC_16_ENCAP, NOTIFICATION, PROTECTION, FIRMWARE_UPDATE_MD, SUPERVISION, APPLICATION_STATUS [7]: ZWAVEPLUS_INFO, SWITCH_BINARY, ASSOCIATION, MULTI_CHANNEL_ASSOCIATION, ASSOCIATION_GRP_INFO, TRANSPORT_SERVICE, VERSION, MANUFACTURER_SPECIFIC, DEVICE_RESET_LOCALLY, POWERLEVEL, SECURITY, SECURITY_2, CENTRAL_SCENE, SENSOR_MULTILEVEL, MULTI_CHANNEL, CONFIGURATION, CRC_16_ENCAP, NOTIFICATION, PROTECTION, FIRMWARE_UPDATE_MD, SUPERVISION, APPLICATION_STATUS
2023-02-05T03:31:39.346181566+00:00 TRACE Fibaro Smart Implant BETA Received event with handler _resync
2023-02-05T03:31:39.347281607+00:00 TRACE Fibaro Smart Implant BETA Received event with handler environment_info
2023-02-05T03:31:39.348850816+00:00 TRACE Fibaro Smart Implant BETA Found DeviceLifecycleDispatcher handler in zwave_smart_implant
2023-02-05T03:31:39.349524857+00:00 DEBUG Fibaro Smart Implant BETA Fibaro Smart Implant device thread event handled
2023-02-05T03:31:39.350359274+00:00 TRACE Fibaro Smart Implant BETA Received event with handler environment_info
2023-02-05T03:31:39.351030066+00:00 DEBUG Fibaro Smart Implant BETA Z-Wave hub node ID environment changed.

@Mariano_Colmenarejo

The new driver is throwing errors

2023-02-05T03:39:16.368738009+00:00 ERROR Fibaro Smart Implant BETA Fibaro Smart Implant thread encountered error: [string “st/dispatcher.lua”]:233: Error encountered while processing event for <ZwaveDevice: 90395e70-07a9-4915-a570-941b5930c937 [42] (Fibaro Smart Implant)>:
> arg1: {args={precision=1, scale=“CELSIUS”, sensor_type=“TEMPERATURE”, sensor_value=32.7, size=2}, cmd_class=“SENSOR_MULTILEVEL”, cmd_id=“REPORT”, dst_channels={0}, encap=“NONE”, payload=“\x01\x22\x01\x47”, src_channel=7, version=1}
> [string “init.lua”]:124: attempt to perform arithmetic on a nil value (field ‘internalTempOffset’)

And now it is no longer working at all…

I’m guessing this is because the value of “internalTempOffset” and “externalTenpOffset” are 0 which is a correct default… but probably not handled as a special case …

Please advise

Out of curiosity - is it possible to select an older driver version or does the infrastructure only support use of the latest ?

I changed the value of “internalTempOffset” and “externalTempOffset” too .1 degree (minimum allowed)

The error is done and the sensor is reporting again properly (with the offset)