nitaybz / homebridge-sensibo-ac

Homebridge plugin for Sensibo - Smart AC Control
GNU General Public License v3.0
70 stars 15 forks source link

AQ reading is available but incorrect when "ignoreHomeKitDevices" is true #134

Closed Pichiasister closed 6 months ago

Pichiasister commented 6 months ago

Sorry that I had to create a new issue as this seems separated from the last one. The AirQ sensor's AQ readings are still available when "ignoreHomeKitDevices" is true but readings are not updated.

Per logs the Airq was correctly skipped but seems the AQ sensors are still being shown in the devices list. Not sure if the expected behavior should be not showing the TVOC/CO2 sensors as AirQ is Homekit compatible, or should still be available for the sensors for those 2 readings only.

The quick way to fix is to remove the sensors from the devices list but as sensors readings are not included by the official homekit support, it seems keeping the sensors is a better solution.

Users can set "disableAirQuality" & "disableCarbonDioxide" to true to avoid seeing those readings.

Debug log as follow:

[5/12/2024, 9:07:12 AM] Homebridge v1.8.2-beta.2 (HAP v0.12.1-beta.0) (homebridge-sensibo-ac) is running on port 57554.
[5/12/2024, 9:07:12 AM] [homebridge-sensibo-ac] Creating GET request to Sensibo API ->
[5/12/2024, 9:07:12 AM] [homebridge-sensibo-ac] https://home.sensibo.com/api/v2/users/me/pods?fields=id,acState,measurements,location,occupancy,smartMode,motionSensors,filtersCleaning,serial,pureBoostConfig,homekitSupported,remoteCapabilities,room,temperatureUnit,productModel
[5/12/2024, 9:07:14 AM] [homebridge-sensibo-ac] Successful GET response:
[5/12/2024, 9:07:14 AM] [homebridge-sensibo-ac] [
    {
        "id": "********",
        "temperatureUnit": "C",
        "room": {
            "uid": "********",
            "name": "Bedroom",
            "icon": "Bedroom",
            "pureBoostConfig": null
        },
        "acState": {
            "timestamp": {
                "time": "2024-05-12T01:07:14.731859Z",
                "secondsAgo": 0
            },
            "on": false,
            "mode": "cool",
            "targetTemperature": 25,
            "temperatureUnit": "C",
            "fanLevel": "auto",
            "swing": "stopped",
            "horizontalSwing": "stopped",
            "light": "on"
        },
        "location": {
            "occupancy": "me",
            "name": "Home",
            "id": "**********"
        },
        "productModel": "airq",
        "serial": "***********",
        "motionSensors": [],
        "filtersCleaning": {
            "acOnSecondsSinceLastFiltersClean": 2166,
            "filtersCleanSecondsThreshold": 1080000,
            "lastFiltersCleanTime": null,
            "shouldCleanFilters": false
        },
        "pureBoostConfig": null,
        "homekitSupported": true,
        "remoteCapabilities": {
            "modes": {
                "cool": {
                    "temperatures": {
                        "F": {
                            "isNative": false,
                            "values": [
                                61,
                                63,
                                64,
                                66,
                                68,
                                70,
                                72,
                                73,
                                75,
                                77,
                                79,
                                81,
                                82,
                                84,
                                86
                            ]
                        },
                        "C": {
                            "isNative": true,
                            "values": [
                                16,
                                17,
                                18,
                                19,
                                20,
                                21,
                                22,
                                23,
                                24,
                                25,
                                26,
                                27,
                                28,
                                29,
                                30
                            ]
                        }
                    },
                    "fanLevels": [
                        "low",
                        "medium",
                        "high",
                        "auto",
                        "strong"
                    ],
                    "swing": [
                        "stopped",
                        "fixedTop",
                        "fixedMiddleTop",
                        "fixedMiddle",
                        "fixedMiddleBottom",
                        "fixedBottom",
                        "rangeTop",
                        "rangeMiddle",
                        "rangeBottom",
                        "rangeFull"
                    ],
                    "horizontalSwing": [
                        "stopped",
                        "fixedLeft",
                        "fixedCenterLeft",
                        "fixedCenter",
                        "fixedCenterRight",
                        "fixedRight",
                        "fixedLeftRight",
                        "rangeFull",
                        "rangeCenter"
                    ],
                    "light": [
                        "on",
                        "off"
                    ]
                },
                "heat": {
                    "temperatures": {
                        "F": {
                            "isNative": false,
                            "values": [
                                46,
                                61,
                                63,
                                64,
                                66,
                                68,
                                70,
                                72,
                                73,
                                75,
                                77,
                                79,
                                81,
                                82,
                                84,
                                86
                            ]
                        },
                        "C": {
                            "isNative": true,
                            "values": [
                                8,
                                16,
                                17,
                                18,
                                19,
                                20,
                                21,
                                22,
                                23,
                                24,
                                25,
                                26,
                                27,
                                28,
                                29,
                                30
                            ]
                        }
                    },
                    "fanLevels": [
                        "low",
                        "medium",
                        "high",
                        "auto",
                        "strong"
                    ],
                    "swing": [
                        "stopped",
                        "fixedTop",
                        "fixedMiddleTop",
                        "fixedMiddle",
                        "fixedMiddleBottom",
                        "fixedBottom",
                        "rangeTop",
                        "rangeMiddle",
                        "rangeBottom",
                        "rangeFull"
                    ],
                    "horizontalSwing": [
                        "stopped",
                        "fixedLeft",
                        "fixedCenterLeft",
                        "fixedCenter",
                        "fixedCenterRight",
                        "fixedRight",
                        "fixedLeftRight",
                        "rangeFull",
                        "rangeCenter"
                    ],
                    "light": [
                        "on",
                        "off"
                    ]
                },
                "fan": {
                    "temperatures": {
                        "F": {
                            "isNative": false,
                            "values": [
                                61,
                                63,
                                64,
                                66,
                                68,
                                70,
                                72,
                                73,
                                75,
                                77,
                                79,
                                81,
                                82,
                                84,
                                86
                            ]
                        },
                        "C": {
                            "isNative": true,
                            "values": [
                                16,
                                17,
                                18,
                                19,
                                20,
                                21,
                                22,
                                23,
                                24,
                                25,
                                26,
                                27,
                                28,
                                29,
                                30
                            ]
                        }
                    },
                    "fanLevels": [
                        "low",
                        "medium",
                        "high",
                        "auto",
                        "strong"
                    ],
                    "swing": [
                        "stopped",
                        "fixedTop",
                        "fixedMiddleTop",
                        "fixedMiddle",
                        "fixedMiddleBottom",
                        "fixedBottom",
                        "rangeTop",
                        "rangeMiddle",
                        "rangeBottom",
                        "rangeFull"
                    ],
                    "horizontalSwing": [
                        "stopped",
                        "fixedLeft",
                        "fixedCenterLeft",
                        "fixedCenter",
                        "fixedCenterRight",
                        "fixedRight",
                        "fixedLeftRight",
                        "rangeFull",
                        "rangeCenter"
                    ],
                    "light": [
                        "on",
                        "off"
                    ]
                },
                "dry": {
                    "temperatures": {
                        "F": {
                            "isNative": false,
                            "values": [
                                61,
                                63,
                                64,
                                66,
                                68,
                                70,
                                72,
                                73,
                                75,
                                77,
                                79,
                                81,
                                82,
                                84,
                                86
                            ]
                        },
                        "C": {
                            "isNative": true,
                            "values": [
                                16,
                                17,
                                18,
                                19,
                                20,
                                21,
                                22,
                                23,
                                24,
                                25,
                                26,
                                27,
                                28,
                                29,
                                30
                            ]
                        }
                    },
                    "fanLevels": [
                        "low"
                    ],
                    "swing": [
                        "stopped",
                        "fixedTop",
                        "fixedMiddleTop",
                        "fixedMiddle",
                        "fixedMiddleBottom",
                        "fixedBottom",
                        "rangeTop",
                        "rangeMiddle",
                        "rangeBottom",
                        "rangeFull"
                    ],
                    "horizontalSwing": [
                        "stopped",
                        "fixedLeft",
                        "fixedCenterLeft",
                        "fixedCenter",
                        "fixedCenterRight",
                        "fixedRight",
                        "fixedLeftRight",
                        "rangeFull",
                        "rangeCenter"
                    ],
                    "light": [
                        "on",
                        "off"
                    ]
                },
                "auto": {
                    "temperatures": {},
                    "fanLevels": [
                        "low",
                        "medium",
                        "high",
                        "auto",
                        "strong"
                    ],
                    "swing": [
                        "stopped",
                        "fixedTop",
                        "fixedMiddleTop",
                        "fixedMiddle",
                        "fixedMiddleBottom",
                        "fixedBottom",
                        "rangeTop",
                        "rangeMiddle",
                        "rangeBottom",
                        "rangeFull"
                    ],
                    "horizontalSwing": [
                        "stopped",
                        "fixedLeft",
                        "fixedCenterLeft",
                        "fixedCenter",
                        "fixedCenterRight",
                        "fixedRight",
                        "fixedLeftRight",
                        "rangeFull",
                        "rangeCenter"
                    ],
                    "light": [
                        "on",
                        "off"
                    ]
                }
            }
        },
        "smartMode": {
            "enabled": false
        },
        "measurements": {
            "time": {
                "time": "2024-05-12T01:06:59.473123Z",
                "secondsAgo": 15
            },
            "temperature": 27.7,
            "humidity": 92.5,
            "feelsLike": 33.2,
            "rssi": -70,
            "motion": false,
            "roomIsOccupied": null,
            "tvoc": 439,
            "co2": 791,
            "iaq": 88
        }
    }
]
[5/12/2024, 9:07:14 AM] [homebridge-sensibo-ac] Ignoring Homekit supported device: ********
[5/12/2024, 9:07:17 AM] [homebridge-sensibo-ac] Accessory type: AirQualitySensor, Name: undefined, not in activeAccessories[]
[5/12/2024, 9:07:17 AM] [homebridge-sensibo-ac] Accessory type: AirConditioner, Name: undefined, not in activeAccessories[]

(Attached: sensors showing in Homebridge's devices list while displaying wrong readings image image image

Pichiasister commented 6 months ago

Sensors removed after removing All Cached Accessories. Please ignore this issue, thanks.

benwebbbenwebb commented 6 months ago

Thanks @Pichiasister, glad to hear you got it sorted.

I wonder if restarting Homebridge (a second time) would have been sufficient… I believe Accessories/devices should get auto-removed during startup if no longer needed/registered. I’ll add it to the list of low priority items to check on at some point.