cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 39 forks source link

Handling of negative temperature values #20

Closed Bjsulla closed 7 years ago

Bjsulla commented 7 years ago

Perhaps a beginners question but I have a problem with handling negative temperature values. Sending a command with the following payload works: {payload:{"name": "outdoor_temp", "characteristic": "CurrentTemperature", "value": "7"}}

But if I instead issue the command {payload:{"name": "outdoor_temp", "characteristic": "CurrentTemperature", "value": "-7"}} I get the following error: [mqtt] Accessory.parse outdoor_temp CurrentTemperature value '-7' outside range.

Is there any way to work around negative values?

cflurin commented 7 years ago

remove the accessory and add it again this way:

{
    "name":"outdoor_temp",
    "service":"TemperatureSensor",
    "CurrentTemperature": {
        "minValue": -20,
        "maxValue": 60,
        "minStep": 1
        }
    }

change minValueand maxValue for your need

Bjsulla commented 7 years ago

Worked great. Thank you!