eibenp / homebridge-gree-airconditioner

Homebridge plugin for GREE Air Conditioners
Apache License 2.0
26 stars 3 forks source link

Unexpected behavior when in Farenheit mode due to temperature being an integer #2

Closed pickanothername closed 1 year ago

pickanothername commented 1 year ago

Describe The Bug: When in Fahrenheit mode, temperature skips by 2 and jumps around between two numbers, due to the temperature variable not being a double. What this results in is only being able to set by every 2°, and the Home app frantically jumping between two numbers, as it tries to round to the nearest Fahrenheit but is sent back to the nearest round Celcius number, which is usually a double/float in Farenheit.

To Reproduce: Set your Gree and Home app to use Fahrenheit, try to change the temperature of your AC in the Home app.

Expected behavior: Temperature should increment/decrement by a value of 1, and remain on that value.

Logs:

[8/30/2023, 2:27:34 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] targetTemperature -> 22
[8/30/2023, 2:27:35 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] Device updated (["targetTemperature: 23 -> 22"])
[8/30/2023, 2:27:37 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] targetTemperature -> 23
[8/30/2023, 2:27:37 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] Device updated (["targetTemperature: 22 -> 23"])
[8/30/2023, 2:27:38 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] targetTemperature -> 22
[8/30/2023, 2:27:38 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] Device updated (["targetTemperature: 23 -> 22"])
[8/30/2023, 2:27:39 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] targetTemperature -> 23
[8/30/2023, 2:27:39 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] Device updated (["targetTemperature: 22 -> 23"])
[8/30/2023, 2:27:40 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] targetTemperature -> 22
[8/30/2023, 2:27:40 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] Device updated (["targetTemperature: 23 -> 22"])
[8/30/2023, 2:27:41 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] targetTemperature -> 23
[8/30/2023, 2:27:41 AM] [Playroom Air Conditioner] [Playroom Thermostat -- [IP REDACTED]:7000] Device updated (["targetTemperature: 22 -> 23"])

Plugin Config:

{
    "name": "Playroom Air Conditioner",
    "port": 7002,
    "scanAddress": "[REDACTED]",
    "scanCount": 10,
    "scanTimeout": 3,
    "devices": [
        {
            "mac": "[REDACTED]",
            "name": "Playroom Thermostat",
            "model": "AC Pro AWH24ATEXF-D3DNA4E/I",
            "speedSteps": 5,
            "statusUpdateInterval": 10,
            "sensorOffset": 40,
            "minimumTargetTemperature": 16,
            "maximumTargetTemperature": 30,
            "xFanEnabled": true,
            "temperatureSensor": "child",
            "disabled": false
        }
    ],
    "platform": "GREEAirConditioner"
}
eibenp commented 1 year ago

Issue fixed in release v1.0.2. Device disable and re-enable required to apply changes after upgrading to the new release.

pickanothername commented 1 year ago

Thank you!!