homebridge-switchbot icon indicating copy to clipboard operation
homebridge-switchbot copied to clipboard

Bug: Light sensing doesn't communicate with homebridge and homekit

Open Snderr90 opened this issue 2 years ago • 6 comments

Describe The Bug

Light sensor doesn't register the actual Lux, it's stuck on 6001 Lux

To Reproduce

No steps necesarry, it's on 6001 Lux all the time

Expected behavior

Correct register of the amount / level of light that the switchbot curtain registers in the switchbot app

Relevant log output

[16/06/2022, 20:05:40] [SwitchBot] Curtain: Gordijn voordeur  OpenAPI parseStatus
[16/06/2022, 20:05:40] [SwitchBot] Curtain Gordijn voordeur  CurrentPosition: 1
[16/06/2022, 20:05:40] [SwitchBot] Curtain: Gordijn voordeur  Standby, CurrentPosition: 1
[16/06/2022, 20:05:40] [SwitchBot] Curtain: Gordijn voordeur  Stopped
[16/06/2022, 20:05:40] [SwitchBot] Curtain: Gordijn voordeur  CurrentPosition: 1, TargetPosition: 1, PositionState: 2,
[16/06/2022, 20:05:40] [SwitchBot] Curtain: Gordijn voordeur  CurrentAmbientLightLevel: 6001
[16/06/2022, 20:05:40] [SwitchBot] Curtain: Gordijn voordeur  updateCharacteristic CurrentPosition: 1
[16/06/2022, 20:05:40] [SwitchBot] Meter: Gordijn voordeur  MQTT message: CurrentPosition/1 options:{}
[16/06/2022, 20:05:40] [SwitchBot] Curtain: Gordijn voordeur  updateCharacteristic PositionState: 2
[16/06/2022, 20:05:40] [SwitchBot] Meter: Gordijn voordeur  MQTT message: PositionState/2 options:{}
[16/06/2022, 20:05:40] [SwitchBot] Curtain: Gordijn voordeur  updateCharacteristic TargetPosition: 1
[16/06/2022, 20:05:40] [SwitchBot] Meter: Gordijn voordeur  MQTT message: TargetPosition/1 options:{}
[16/06/2022, 20:05:40] [SwitchBot] Curtain: Gordijn voordeur  updateCharacteristic CurrentAmbientLightLevel: 6001
[16/06/2022, 20:05:40] [SwitchBot] Meter: Gordijn voordeur  MQTT message: CurrentAmbientLightLevel/6001 options:{}

Config for homebridge-switchbot

{
    "bridge": {
        "name": "",
        "username": "",
        "port": 51738,
        "pin": "",
        "advertiser": "bonjour-hap"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "refreshToken": "",
            "hideDoorbellSwitch": false,
            "platform": "Ring"
        },
        {
            "name": "SwitchBot",
            "credentials": {
                "openToken": "",
                "notice": "Keep your token a secret!"
            },
            "platform": "SwitchBot"
        }
    ]
}

Screenshots

IMG_9763 IMG_9762 IMG_9761

Device & Model

Raspberry PI 4 (4gb)

Node.js Version

v16.14.2

NPM Version

dont know where to find this!

Homebridge Version

v1.4.1

Homebridge Switchbot Plugin Version

V1.13.0

Homebridge Config UI X Plugin Version

v4.47.0

Operating System

Raspbian

Snderr90 avatar Jun 16 '22 19:06 Snderr90

Hi,

I'm relatively new to homebridge (,Github) and Raspberry Pi at all. But this is a description of the problem:

Can somebody please help me with getting my Switchbot light-sensors from the curtain bots to work properly in Apple Homekit.

I've connected the curtain bots to Homekut throughout Homebridge but the light-sensors in Homebridge and Homekit keep on saying the same amount of Lux (6000Lux) throughout the whole day, even though the light-sensors registers other values in de Switchbot app.

I really want this to work so i can make my automations work with it.

Thanks!

Snderr90 avatar Jun 16 '22 19:06 Snderr90

This is all based off the API data.

donavanbecker avatar Jun 17 '22 05:06 donavanbecker

I have this problem as well. Running Homebridge on Mac OS

siobhanellis avatar Jun 17 '22 16:06 siobhanellis

Same here. I haven’t found any solution so far (except for hiding the light sensor for HomeKit, although I didn’t succeed in that either).

Vreyhoudt avatar Jun 22 '22 21:06 Vreyhoudt

@donavanbecker Said in another comment:

BLE sees different values for Lux levels then OpenAPI.

And then in another thread:

BLE Sends me info 10 different amounts, if you set the maxLux and minLux then these numbers would divide by 9 and would set the value for each interval.

OpenAPI only sends me 2 either dim or bright. So it will always be either 1 or 6001 unless you change the maxLux and minLux.

Would it be possible to update open API to send more than two values? It would be awesome if the light sensor were more accurate with OpenAPI.

joeyhoer avatar Jul 21 '22 16:07 joeyhoer

Same issue here

LittleJ avatar Aug 18 '22 21:08 LittleJ

Can you try the latest beta:

npm version

Click here to find out how to install Beta

donavanbecker avatar Oct 12 '22 05:10 donavanbecker