dubocr / homebridge-tahoma

Homebridge plugin for TaHoma, Connexoon, Cozytouch, Energeasy Connect.
Apache License 2.0
137 stars 42 forks source link

[DimmerLight] LIGHT VAR io doesn't switch off #528

Open Dakitoo opened 3 months ago

Dakitoo commented 3 months ago

Gateway: 7967 Device: Light > DimmerLight

States

LIGHT VAR io

Can be turned on and is set to 100%. If you then want to turn it off, it stays at 100% and the light stays on, even though it is displayed as off. Can this error be fixed?

Bildschirmfoto 2024-07-16 um 13 21 48
djangopap commented 3 months ago

SAme problem.

Can be turned on. but to turn it off, it is necessary to put manually 100% to 0% in the menu off the light. same in HomeKit than in homebridge

AlexFabre commented 2 months ago

Hi all,

Dimmer light can be controlled with intensity but not with ON/OFF. Only the setIntensity[value] actually appears in the logs.

Capture d’écran 2024-08-02 à 10 17 02

Nor ON nor OFF actually triggers any command.

My configuration:

flowchart LR
    D(Schneider wiser dimmer switch)
    T(Tahoma switch)
    H(Homebridge)
    D <-.zigbee.-> T
    T <-.wifi.-> H
AlexFabre commented 2 months ago

Hi @lukyer, digging into Light.ts I found you add this early return that looks related to our problem. Do you think there is something going on here ?

    protected async setOn(value) {
        if (this.brightness !== undefined) { // when light has brightness control, we do not set on to avoid glitches with gradual lightning up
            return
        }
        const action = await this.executeCommands(this.getOnOffCommands(value));
        action.on('update', (state, data) => {
            switch (state) {
                case ExecutionState.COMPLETED:
                    break;
                case ExecutionState.FAILED:
                    break;
            }
        });
    }
AlexFabre commented 2 months ago

@dubocr the problem indeed comes from this WIP PR.

Rolling back to v2.2.54 fixes the issue.

Capture d’écran 2024-08-02 à 11 03 40

I suggest we revert this commit to let @lukyer work on a more robust solution to the glitching problem.

dubocr commented 1 month ago

Hi everyone,

Sorry I was really busy and didn't have equipments anymore to test my changes. However, I made some changes based on your comments. Hope it will fix for you.

Let me know if it seems OK.

Br00ster commented 1 month ago

Just updated to the latest version and I can now turn off my lights. Fix looks like to have a good effect.

AlexFabre commented 1 month ago

Hi @dubocr

I just tested out release 2.2.57 this morning and I agree it fixes the switch off command, nevertheless the switch on still remains unusable...

The early return still forbid to turn on a dimmed light:

protected async setOn(value) {
         if (value && this.brightness !== undefined) {
             // when light has brightness control, we do not set on to avoid glitches with gradual lightning up
             return;
         }

Can you explain a bit more this problem:

avoid glitches with gradual lightning up

Awaiting a better fix, rolling back to v2.2.54 makes dimmed lights works with ON/OFF/VAR commands.

dubocr commented 1 month ago

Hi,

I don't know what is the glitch problem and as I can't test anything I have to choose between the options from user. As it seems the 'glitch' fix is more problematic than anything else I'll drop it.