Giter Club home page Giter Club logo

Comments (43)

gvssr avatar gvssr commented on June 8, 2024 3

Similar stuff to #85. v0.1.1 works perfectly, and everything from 1.0 forward seems unreliable.

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024 2

Latest version works… flawlessly! I just tested it here. @dnicolson thank you so much, you're my hero! And @donavanbecker thank you for being so patient with this issue.

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024 1

I don't believe it's a Homebridge UI issue. In the Home app the "Opening..." and "Closing..." states never appear, it always changes immediately to "Open" or "Closed". In Homebridge UI the "Opening..." and "Closing..." states never change to
"Open" or "Closed".

The homebridge-switchbot-ble works in both the Home app and Homebridge UI. Is it possible to restore the GitHub repository for this? It makes it easier to see the old code to fix these issues.

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024 1

I can confirm that version 0.1.1 does not have the issue (although BLE was not working).

The problem appears to have been introduced in version 0.1.2-beta.1, it's related to the light sensor. Removing the following lines in the latest code appears to resolve the issue:

// Light Sensor Service
if (device.curtain?.hide_lightsensor) {
this.debugLog(`Curtain: ${accessory.displayName} Removing Light Sensor Service`);
this.lightSensorService = this.accessory.getService(this.platform.Service.LightSensor);
accessory.removeService(this.lightSensorService!);
} else if (!this.lightSensorService) {
this.debugLog(`Curtain: ${accessory.displayName} Add Light Sensor Service`);
(this.lightSensorService =
this.accessory.getService(this.platform.Service.LightSensor) || this.accessory.addService(this.platform.Service.LightSensor)),
`${accessory.displayName} Light Sensor`;
this.lightSensorService.setCharacteristic(this.platform.Characteristic.Name, `${accessory.displayName} Light Sensor`);
} else {
this.debugLog(`Curtain: ${accessory.displayName} Light Sensor Service Not Added`);
}

@donavanbecker can you also make homebridge-switchbot-openapi available again? There is a broken image in the Homebridge SwitchBot BLE settings that is hosted on GitHub.

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024 1

@gvssr I can confirm your issue is different and it seems that it was introduced with 1.0.3-beta.5, #239 should fix it.

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024 1

I tried version 1.12.3-beta.5 and it hasn't resolved the issue. I'm fairly confident that the state and position are being set correctly from my testing, that doesn't appear to be the issue. Even though you don't see "Opening..." you see the loading spinner.

Maybe it's a bug in the Home app that doesn't show "Opening..." correctly with the addition of the light sensor, but @donavanbecker you do not see the issue?

1.12.2-beta.1:
1 12 2-beta 1

1.12.3-beta.5:
1 12 3-beta 5

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@gvssr and @sonezu, can you try the latest beta:

npm version

Click here to find out how to install Beta

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024

Setting an arbitrary value for the "Set Min Lux" option results in the closed/open status working in the set_min/set_max range. More investigation is needed.

There appear to be caching issues that may be contributing to the issue though. For example, changing the Device Name option does not change the name until the cache is cleared.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@dnicolson new beta has been published wit your PR #227.

@gvssr @sonezu, can you try the latest beta:

npm version

Click here to find out how to install Beta

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

v1.11.0 has been release with this fix.

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024

@donavanbecker sorry te report this is still as broken as it’s been for me. Stays hanging on “closing” and “opening” and does not report the correct open / close state, even with min/max set.
DA9AE797-42D9-4113-93FC-11EBF31AC834
89B0FDCB-28D6-4BE3-87A2-6D745D35E69E

For me, it’s a regression of 0.1.1 and unusable for my use case (in Home Assistant)

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024

@donavanbecker I mentioned this in the other thread, but maybe @dnicolson has some insight. An example:

I start with an open curtain like this:
2ED91163-CBCB-4A93-A7AD-1092EF079A4E

I then send the command to close, it’ll say “closing” and hang on closing no matter how much time passes. It’s stuck on closing.
00D2E93C-1966-4234-9BEF-495CE1114DCF

However, when I reboot Homebridge…
7AC9CCB6-B5B1-4ACD-897B-5C9A4ED8C279

… it shows the correct state:
7E2B3F3F-1AC7-437C-89B7-BECF29A4217F

Same thing other way around. It’ll be open, I close the curtain and it says “closing” until I reboot homebridge. Correct state is only displayed after a reboot of homebridge.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@gvssr Have you set an updateRate? Also are you doing BLE?

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024

@donavanbecker no updateRate set (default is 5?) and it’s connected with BLE, but the same thing happens when using the API.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@gvssr i am sorry, I really don't care if the Homebridge UI works or not, I am worried about the home app. So till I see a screenshot of the home app not working, I am marking this as resolved.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

Sorry not trying to blow this off but the Homebridge UI is not a priority for me and could be an issue with the Homebridge UI.

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024

@donavanbecker yeah that was the conclusion from the other thread, which is why I stopped using this plugin 🙂 but I got a @ notification from you asking to try the latest beta to see if it’s fixed so I figured I’d try it.

I don’t think it’s an issue with Homebridge UI exclusively, fwiw. It’s also reported like this in Home Assistant. I think the home app calculates closed and open state based on position and state, and ignores whether a cover is still “opening” or “closing”, where Homebridge and Home Assistant prioritize that value first. 0.1.1 of this plugin followed that same logic. I don’t use Switchbot in the Home app, where it probably works fine.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@dnicolson It is public now.

I am not having any of these issues, so until I get PRs, I don't have anything to test.

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024

I don't believe it's a Homebridge UI issue. In the Home app the "Opening..." and "Closing..." states never appear, it always changes immediately to "Open" or "Closed". In Homebridge UI the "Opening..." and "Closing..." states never change to "Open" or "Closed".

This is exactly what I’m experiencing!

No idea if this helps @dnicolson (I don’t have any programming experience), but 0.1.1 version of this plugin did work using this code (I think): #85 (comment) But I don’t know what changed when BLE got integrated.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

Done

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024

@dnicolson Fantastic news! I'd love to try it. Should I try and edit the file on my local homebridge instance or are you currently working on a PR?

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024

@gvssr I'm not working on a PR at the moment, you may as well modify the curtain.js file locally unless someone else makes a PR.

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024

@dnicolson I sudo edited my local file at /usr/local/lib/node_modules/@switchbot/homebridge-switchbot/src/device/curtain.ts and removed cached accessoires, but it's still hanging on closing/opening for me. Did I edit the right file? Is there anything else I need to change?

image

image

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

The problem appears to have been introduced in version 0.1.2-beta.1, it's related to the light sensor. Removing the following lines in the latest code appears to resolve the issue:

// Light Sensor Service
if (device.curtain?.hide_lightsensor) {
this.debugLog(`Curtain: ${accessory.displayName} Removing Light Sensor Service`);
this.lightSensorService = this.accessory.getService(this.platform.Service.LightSensor);
accessory.removeService(this.lightSensorService!);
} else if (!this.lightSensorService) {
this.debugLog(`Curtain: ${accessory.displayName} Add Light Sensor Service`);
(this.lightSensorService =
this.accessory.getService(this.platform.Service.LightSensor) || this.accessory.addService(this.platform.Service.LightSensor)),
`${accessory.displayName} Light Sensor`;
this.lightSensorService.setCharacteristic(this.platform.Characteristic.Name, `${accessory.displayName} Light Sensor`);
} else {
this.debugLog(`Curtain: ${accessory.displayName} Light Sensor Service Not Added`);
}

I have a hard time believing that this is the cause.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@gvssr, I pushed a new beta, so you can try this.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@dnicolson I sudo edited my local file at /usr/local/lib/node_modules/@switchbot/homebridge-switchbot/src/device/curtain.ts and removed cached accessoires, but it's still hanging on closing/opening for me. Did I edit the right file? Is there anything else I need to change?

image

no.

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024

@gvssr, I pushed a new beta, so you can try this.

Thank you! I updated to beta 1.12.2-beta 1, cleared accessoires cache en rebooted Homebridge but the issue sadly still persists
image

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

closing till I see a PR,

Sorry without being able to reproduce on my side, I have no way of fixing this.

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024

What if you try the Home app @gvssr? With version 1.12.2-beta.1 I see "Opening..." and "Closing..." and not after reverting back to the 1.12.1.

It appears as though there are other unrelated issues with Homebridge UI, many accessories failed to update but switching to "Config" and back to "Accessories" resulted in several accessories updating.

from homebridge-switchbot.

gvssr avatar gvssr commented on June 8, 2024

@dnicolson I don't use it through the Home app, I use it in Home Asssistant and it's the same thing there:
image

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

Just merged #239 so new beta coming out. Wow! Can't believe I missed that easy bug...

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024

@donavanbecker the Home app closing/unclosing issue persists. I think it could actually be related to the light component.

I see only 1 or 6001 lux units at all times. In the SwitchBot app, I see in the "Light Sensing (Beta)" menu a flatline constantly of 2. Interestingly, if I change to the secondary unit I see a fluctuating graph.

The firmware on both units is V2.8.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@dnicolson are you using OpenAPI or BLE?

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.

@dnicolson, what do you have set for your config?

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

Latest version works… flawlessly! I just tested it here. @dnicolson thank you so much, you're my hero! And @donavanbecker thank you for being so patient with this issue.

good to hear, I will post a new update.

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024

@dnicolson are you using OpenAPI or BLE?

Mostly BLE, I only unboxed the Hub Mini a couple of days ago to debug the issue.

@dnicolson, what do you have set for your config?

Just the defaults with a curtain (now I think the logging may be too verbose, feel free to revert 😅):

        {
            "name": "SwitchBot",
            "credentials": {
                "openToken": "xxx",
                "notice": "Keep your token a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceId": "XXX",
                        "configDeviceName": "Curtain",
                        "configDeviceType": "Curtain",
                        "ble": true,
                        "logging": "standard"
                    }
                ],
                "irdevices": [
                    {
                        "logging": "standard"
                    }
                ],
                "logging": "standard"
            },
            "platform": "SwitchBot"
        }

And not to be pedantic, but a typo:
The devices config section is missing the *Device ID* in the config, Check Your Conifg.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@dnicolson Thanks any spellcheck are appreciated!!

Can you set min and max to like 10 and 90 and see if that resolves if for you?

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024

Yeah, unfortunately still no opening/closing.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

Yeah, unfortunately still no opening/closing.

Can you try the latest beta

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@dnicolson can you try the latest beta?

from homebridge-switchbot.

dnicolson avatar dnicolson commented on June 8, 2024

Unfortunately version 1.12.4-beta.1 hasn't resolved the issue.

from homebridge-switchbot.

donavanbecker avatar donavanbecker commented on June 8, 2024

@dnicolson I think your right that this is a iOS bug

from homebridge-switchbot.

github-actions avatar github-actions commented on June 8, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from homebridge-switchbot.

github-actions avatar github-actions commented on June 8, 2024

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.

from homebridge-switchbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.