iklein99 / homebridge-smartthings

This is a plugin to Homebridge to connect your Smartthings network into Apple Home Kit.
Apache License 2.0
150 stars 52 forks source link

Target Temperature Incorrectly Set to Illegal Value #225

Open jacobmoult opened 8 months ago

jacobmoult commented 8 months ago

Describe The Bug: When the temperature is set on a thermostat, it doesn't change the target value as expected and the target value is set to an illegal value (61), which is not a valid temperature in Celsius. I suspect this might be due to converting Fahrenheit to Celsius.

To Reproduce:

  1. Reboot
  2. In web app, Navigate to accessories, pick out the thermostat
  3. Turn Thermostat to 'cool', set target temp to 24.6°

Expected behavior: The target temperature should set to 24.6º C instead of 61.

Logs:

[10/18/2023, 9:06:10 PM] Homebridge v1.6.1 (HAP v0.11.1) (Homebridge AADC) is running on port 51189.
[10/18/2023, 9:06:10 PM] [Smartthings Plug (IK)] Restoring existing accessory from cache: Range
[10/18/2023, 9:06:11 PM] [Smartthings Plug (IK)] Restoring existing accessory from cache: Air Conditioner
[10/18/2023, 9:06:12 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.
[10/18/2023, 9:06:21 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.
[10/18/2023, 9:06:22 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.
[10/18/2023, 9:06:25 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.
[10/18/2023, 9:06:32 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.
[10/18/2023, 9:06:50 PM] [Smartthings Plug (IK)] [Air Conditioner] set target heating cooling state to cool
[10/18/2023, 9:06:52 PM] [Smartthings Plug (IK)] [Air Conditioner] set target temperature to 24.6
[10/18/2023, 9:06:52 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.
[10/18/2023, 9:06:54 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.
[10/18/2023, 9:06:54 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.
[10/18/2023, 9:06:56 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.
[10/18/2023, 9:07:14 PM] [homebridge-smartthings-ik] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 61 exceeded maximum of 38. See https://homebridge.io/w/JtMGR for more info.

Plugin Config:

{
    "bridge": {
        "name": "Homebridge AADC",
        "username": "USERNAME",
        "port": "PORT",
        "pin": "PIN",
        "advertiser": "bonjour-hap"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "Smartthings Plug (IK)",
            "BaseURL": "https://api.smartthings.com/v1/",
            "AccessToken": "TOKEN",
            "GarageDoorMaxPoll": 40,
            "PollLocksSeconds": 0,
            "PollDoorsSeconds": 0,
            "PollSensorsSeconds": 20,
            "PollSwitchesAndLightsSeconds": 10,
            "PollWindowShadesSeconds": 0,
            "platform": "HomeBridgeSmartThings"
        }
    ]
}

Environment:

TGrinbarg commented 8 months ago

I've got the same issue here. I noticed a line of code on a dependent package where enum is labeled "Farenheit" instead of "Fahrenheit". Anyway that could be causing it? Either way thanks for the great work!