indigodomo / HomeKit-Bridge

Enabled HomeKit integration via Homebridge for Indigo Home Automation
The Unlicense
46 stars 13 forks source link

Monoprice MultiSensor ZSE40 reports wrong temp regardless of °F/°C settings in plugin #33

Closed DifferentComputers closed 6 years ago

DifferentComputers commented 6 years ago

Monoprice MultiSensor "(Motion Sensor - Zooz Multi Sensor (ZSE40))" works reliably in Indigo and reports temps correctly. It shows as multiple devices.

When configured in HKB, motion works correctly but temp is always significantly off. What Indigo reports as 51.16 F, HomeKit reports as 126 degrees F. Setting, resetting, setting back the plugin's F/C setting has no effect on this at all--changing it to C doesn't change it at all.Temp:

address : 42
allowOnStateChange : False
allowSensorValueChange : False
batteryLevel : None
buttonGroupCount : 0
configured : True
description : 
deviceTypeId : zwValueSensorType
displayStateId : sensorValue
displayStateImageSel : TemperatureSensor
displayStateValRaw : 52.16
displayStateValUi : 52.16 °F
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState : 
folderId : 34556895
globalProps : MetaProps : (dict)
     com.perceptiveautomation.indigoplugin.zwave : (dict)
          SensorUnits : 2 (integer)
          SupportsOnState : false (bool)
          SupportsSensorValue : true (bool)
          SupportsStatusRequest : false (bool)
          address : 42 (integer)
          indigoObjVersion : 6 (integer)
          version : 5.01 (string)
          zwClassCmdBase : 0 (integer)
          zwDevSubIndex : 2 (integer)
          zwManufactureId : 265 (integer)
          zwManufactureName : Vision / Yale (string)
          zwModelId : 539042049 (integer)
          zwModelName : Zooz Multi Sensor (ZSE40) (string)
          zwShowDumpDevToLog : false (bool)
          zwShowMainUI : false (bool)
          zwShowManualModifyConfigParmUI : false (bool)
          zwShowPollingUI : false (bool)
          zwShowSubmitModelInfoUI : false (bool)
          zwShowWakeIntervalUI : false (bool)
id : 513153808
lastChanged : 2018-03-03 11:47:00
lastSuccessfulComm : 2018-03-03 11:47:00
model : Zooz Multi Sensor (ZSE40)
name : Front Porch Temp
onState : None
ownerProps : com.perceptiveautomation.indigoplugin.zwave : (dict)
     SensorUnits : 2 (integer)
     SupportsOnState : false (bool)
     SupportsSensorValue : true (bool)
     SupportsStatusRequest : false (bool)
     address : 42 (integer)
     indigoObjVersion : 6 (integer)
     version : 5.01 (string)
     zwClassCmdBase : 0 (integer)
     zwDevSubIndex : 2 (integer)
     zwManufactureId : 265 (integer)
     zwManufactureName : Vision / Yale (string)
     zwModelId : 539042049 (integer)
     zwModelName : Zooz Multi Sensor (ZSE40) (string)
     zwShowDumpDevToLog : false (bool)
     zwShowMainUI : false (bool)
     zwShowManualModifyConfigParmUI : false (bool)
     zwShowPollingUI : false (bool)
     zwShowSubmitModelInfoUI : false (bool)
     zwShowWakeIntervalUI : false (bool)
pluginId : com.perceptiveautomation.indigoplugin.zwave
pluginProps : emptyDict : (dict)
protocol : ZWave
remoteDisplay : True
sensorValue : 52.16
states : States : (dict)
     sensorValue : 52.160000 (real)
     sensorValue.ui : 52.16 °F (string)
subModel : Temperature
supportsAllLightsOnOff : False
supportsAllOff : False
supportsOnState : False
supportsSensorValue : True
supportsStatusRequest : False
version : 5.01

[MODERATOR NOTE]: Fixed post for readability (using the code toolbar option on a long block like this doesn't work, you have to past it indented instead)

DifferentComputers commented 6 years ago

Sorry, I'm not seeing how to post this with proper formatting.

Colorado4Wheeler commented 6 years ago

Yeah, it's persnickety sometimes, but what I do is copy that dump to Texwrangler and then I can easily just CMD-A to select it and CMD-] to indent and it works fine. No biggie. The concept is that if you precede your code by 3 or more spaces (or tabs) then it'll put it into a code block similar to what you see on the Indigo forums.

FlyingDiver commented 6 years ago

I'm seeing the same problem. I posted my device definition to the forum thread. It's probably about the same.

Colorado4Wheeler commented 6 years ago

That's strange because, without fail, all 12 or so of my temperature sensors and thermostats are reporting fine. I'll dig into this soon.

Colorado4Wheeler commented 6 years ago

Once you download 15.1 use the new HomeKit Simulation Utility and tell to Include device data dump so we can see the entirety of the device you are trying to use and how HomeKit sees it.

DifferentComputers commented 6 years ago
HomeKit Bridge                  Simulating HomeKit values for Front Porch Temp
HomeKit Bridge                  ##### DEVICE DATA DUMP #####
HomeKit Bridge                  address : 42
allowOnStateChange : False
allowSensorValueChange : False
batteryLevel : None
buttonGroupCount : 0
configured : True
description : 
deviceTypeId : zwValueSensorType
displayStateId : sensorValue
displayStateImageSel : TemperatureSensor
displayStateValRaw : 49.38
displayStateValUi : 49.38 °F
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState : 
folderId : 34556895
globalProps : MetaProps : (dict)
     com.perceptiveautomation.indigoplugin.zwave : (dict)
          SensorUnits : 2 (integer)
          SupportsOnState : false (bool)
          SupportsSensorValue : true (bool)
          SupportsStatusRequest : false (bool)
          address : 42 (integer)
          indigoObjVersion : 6 (integer)
          version : 5.01 (string)
          zwClassCmdBase : 0 (integer)
          zwDevSubIndex : 2 (integer)
          zwManufactureId : 265 (integer)
          zwManufactureName : Vision / Yale (string)
          zwModelId : 539042049 (integer)
          zwModelName : Zooz Multi Sensor (ZSE40) (string)
          zwShowDumpDevToLog : false (bool)
          zwShowMainUI : false (bool)
          zwShowManualModifyConfigParmUI : false (bool)
          zwShowPollingUI : false (bool)
          zwShowSubmitModelInfoUI : false (bool)
          zwShowWakeIntervalUI : false (bool)
id : 513153808
lastChanged : 2018-03-05 12:04:13
lastSuccessfulComm : 2018-03-05 12:04:13
model : Zooz Multi Sensor (ZSE40)
name : Front Porch Temp
onState : None
ownerProps : com.perceptiveautomation.indigoplugin.zwave : (dict)
     SensorUnits : 2 (integer)
     SupportsOnState : false (bool)
     SupportsSensorValue : true (bool)
     SupportsStatusRequest : false (bool)
     address : 42 (integer)
     indigoObjVersion : 6 (integer)
     version : 5.01 (string)
     zwClassCmdBase : 0 (integer)
     zwDevSubIndex : 2 (integer)
     zwManufactureId : 265 (integer)
     zwManufactureName : Vision / Yale (string)
     zwModelId : 539042049 (integer)
     zwModelName : Zooz Multi Sensor (ZSE40) (string)
     zwShowDumpDevToLog : false (bool)
     zwShowMainUI : false (bool)
     zwShowManualModifyConfigParmUI : false (bool)
     zwShowPollingUI : false (bool)
     zwShowSubmitModelInfoUI : false (bool)
     zwShowWakeIntervalUI : false (bool)
pluginId : com.perceptiveautomation.indigoplugin.zwave
pluginProps : com.eps.indigoplugin.homekit-bridge : (dict)
protocol : ZWave
remoteDisplay : True
sensorValue : 49.38
states : States : (dict)
     sensorValue : 49.380000 (real)
     sensorValue.ui : 49.38 °F (string)
subModel : Temperature
supportsAllLightsOnOff : False
supportsAllOff : False
supportsOnState : False
supportsSensorValue : True
supportsStatusRequest : False
version : 5.01
   HomeKit Bridge                  ##### DEVICE SIMULATION DATA #####
   HomeKit Bridge                  Service : 
    alias : Front Porch Temp
    model : Temperature
    subModel : 
    indigoType : indigo.SensorDevice
    pluginType : indigo.SensorDevice.com.perceptiveautomation.indigoplugin.zwave.zwValueSensorType
    type : TemperatureSensor
    desc : Temperature Sensor
    objId : 513153808
    required : (List)
        CurrentTemperature : 49.38
    optional : (List)
        StatusActive
        StatusFault
        StatusTampered
        Name
        StatusLowBattery : 0
    native : True
    requiresPlugin : (List)
    actions : (List)
        Action : (HomeKitAction)
            Characteristic : CurrentTemperature
            When : between
            Value : -1000 (int)
            Value2 : 1000 (int)
            Command : speedcontrol.setSpeedLevel
            Arguments : [513153808, '=value=']
            monitors : {513153808: 'attr_sensorValue'}
    loadOptional : False
    characterDict : (Dict)
        CurrentTemperature : 49.38
DifferentComputers commented 6 years ago

I notice the last thing is "(Dict) CurrentTemperature : 49.38"

Which is correct. But the Home app shows 121°.

Colorado4Wheeler commented 6 years ago

It's not correct if that's the correct fahrenheit value, it needs to be C. That's why I wrote this utility, so I can see what HomeKit sees and if it sees that it considers it C.

Colorado4Wheeler commented 6 years ago

Can you verify, for my own edification, that the server is set to Fahrenheit in the settings? If it is then that should have been converted but perhaps since it's a sensor it's getting skipped.

Colorado4Wheeler commented 6 years ago

Never mind, I see the problem now. It's because it's a sensor. If it were a thermostat it would have converted it, but a sensor is bypassing conversion.

Colorado4Wheeler commented 6 years ago

Resolved in the next update.

Colorado4Wheeler commented 6 years ago

I knew there was a reason I wasn’t converting this, it acts totally different than thermostats do in HomeKit in regards to temp conversion. This still needs work as now all my sensors are reporting Celsius.

Colorado4Wheeler commented 6 years ago

Ok, I think I finally have this worked out. HomeKit is so exacting when it comes to temperature. All temps must got to HomeKit as Celsius and IT will convert based on user preferences. The problem is that the "universal" setting on the server to Fahrenheit or Celsius doesn't work because, like in my case, I have a mixed environment where my Fibaro's are Celsius but my Thermostat is Fahrenheit, so one shoe doesn't fit all. The solution is to allow each temperature sensor and thermostat have their own setting for if they need to be converted FROM Fahrenheit. This is to say that if a device is not Celsius then this box will have to be checked so that we know to convert that the Celsius for HomeKit.

That checkbox will be in the next release and, in my case, it got my temperature sensors back to the correct value. I think once this is done it'll fix a couple other temperature related issues too. Now the server setting will only impact thermostats rather than ALL temperature based HomeKit devices.

Colorado4Wheeler commented 6 years ago

This should be resolved in the next release (finally).

DifferentComputers commented 6 years ago

Great work! I look forward to testing this ASAP.

DifferentComputers commented 6 years ago

Great Success! It's now 45°F on my porch according to HomeKit. As it actually is.

With this, I've just disabled HBB and moved HKB into primary use for further testing.

Colorado4Wheeler commented 6 years ago

Awesome.

With this, I've just disabled HBB and moved HKB into primary use for further testing.

That was so last week for me...