Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessories disappear then reappear #44

Open
ifeign opened this issue Sep 3, 2019 · 35 comments
Open

Accessories disappear then reappear #44

ifeign opened this issue Sep 3, 2019 · 35 comments
Labels
Milestone

Comments

@ifeign
Copy link

ifeign commented Sep 3, 2019

I've noticed that lately every few days all Neato accessories disappear only to reappear after restarting Homebridge. They reappear in the wrong room and I have to set up all my scenes involving Neato all over again. So far it's happened twice this week. I don't see anything in the logs but I'll look harder and update here if I find something relevant

@Krocko
Copy link

Krocko commented Sep 6, 2019

I have the same. It happens if the internet connection get lost. Then all zone accessories disappear from the home app.
If the internet connection is there again and i restart the homebridge, all zone accessories will be added again.

@ifeign
Copy link
Author

ifeign commented Sep 6, 2019

When your zone accessories reappear, do they end up in a different room? Mine always reappear in the same room as my Homebridge hub instead of the separate Neato room I created.

@Krocko
Copy link

Krocko commented Sep 6, 2019

Yes, they are all in the standard room.

@ifeign
Copy link
Author

ifeign commented Sep 11, 2019

It happened again yesterday after I added a new plugin to my config, except this time it was worse. Now that I’m on iOS 13 it changed the names of everything to “[robot name] - [zone name]” instead of “clean the [zone name]”

Edit: now they’ve just disappeared. I haven’t changed anything, I opened my Home app this morning and the zones are gone.

@naofireblade
Copy link
Owner

Ok I understand that the accessories reappear in a different room after restarting homebridge. Do they disappear as well after restarting homebridge or while it is running?

@ifeign
Copy link
Author

ifeign commented Sep 14, 2019 via email

@naofireblade
Copy link
Owner

I will read into the caching of homebridge. In previous versions of my plugin, homebridge just crashed when the neato servers were not available. In the current version, I catch these problems but the result is, that I get no robots if the neato server is offline.

An easy alternative would be to add the robots manually to the homebridge config as accessories, but I don't want to burden the users with that additional step, so I need to find another way.

@ifeign
Copy link
Author

ifeign commented Sep 19, 2019

Thanks for looking into it. I have an idea for a sloppy fix, but it'd only work for iOS 13 and up. If you can make the switches appear as a grouped accessory, then even if they do appear in the wrong room it'd be easy to move everything over to the right place in one go. Currently all the robot functions except the zones are grouped.

@naofireblade
Copy link
Owner

The zones are not grouped on purpose to be able to sort them into different rooms.

I‘m currently beta testing a new release with @ DJay-X that reduces the API calls massively which should stop the connection problems with the resulting drop in/outs.

A definite solution will be adding a cache, I‘m still looking into that.

@ifeign
Copy link
Author

ifeign commented Dec 11, 2019

This has happened several times this week. First time was after a power outage, second I have no idea

@JamieWhite
Copy link

@naofireblade any chance of getting access to that beta? I’ve been experimenting with a HomeKit automation that triggers Neato when I leave the house but due to the deleting and readding the shortcut loses reference to the robot and can’t run it.

Not having a JavaScript background I’ve been trying to slowly figure out how to hack the caching in myself (or don’t delete and re add) but admittedly it’s a slow process 😄

@naofireblade
Copy link
Owner

Hi, sorry to hear that.
The beta to reduce the number of API calls was already released in v0.7.0 (current ist v0.7.2).
I had no time yet to start working on a cache to store the devices despite connection problems.

@ifeign
Copy link
Author

ifeign commented Mar 10, 2020

I just wanted to check in about this. Everything reset again because my router updated its firmware today. I understand you have time constraints, but when you do get a chance to work on things again, this is a pretty major bug

@mtressl
Copy link

mtressl commented May 12, 2020

+1 for a fix to the zones problem.

@alecc131
Copy link

alecc131 commented Jun 8, 2020

+1!

@alecc131
Copy link

Another nudge here. Would really love for the accessories to cache!

Let me know if there’s anything I can do to support / fast track this development.

@ifeign
Copy link
Author

ifeign commented Jul 14, 2020

It would be ideal to add cached accessories. I’d rather go in and manually delete the the cache when things change (like adding or removing a zone) than the current behavior

@jlg89
Copy link

jlg89 commented Aug 13, 2020

I'm seeing the same behavior here. When the plugin can't reach the Neato servers, the accessories disappear from HomeKit, and when they reappear they're treated as new accessories, so they end up in the default room with default settings. Standard behavior should probably be something like, if the Neato server can't be reached, the plugin keeps the cached accessory config as-is until server connection is available (so the accessory would remain in HomeKit but show as "no response"), then checks the cached config against whatever is received from the Neato server, making any necessary adjustments at that point.

@alecc131
Copy link

alecc131 commented Sep 9, 2020

Any update here? I keep experiencing this problem

@JamieWhite
Copy link

From what I can tell we need to copy this template https://github.com/homebridge/homebridge-plugin-template/blob/18a88dd8dc6390ce5c408def6bf7ba45d6f4a789/src/platform.ts#L11

Making a class that implements DynamicPlatformPlugin. There's a function configureAccessory(accessory: PlatformAccessory) { that homebridge calls with the cached accessories. You then assign that to a property on the class.

Next step when recreating out accessories we need to check which ones exist already and don't recreate. In the sample it's done here https://github.com/homebridge/homebridge-plugin-template/blob/18a88dd8dc6390ce5c408def6bf7ba45d6f4a789/src/platform.ts#L78

Im trying to play around but Im a complete Javascript noob.

@naofireblade
Copy link
Owner

naofireblade commented Apr 28, 2021

Working on this right now. I have to convert the plugin to typescript and dynamic platform. I will report back here when a beta is available.

@naofireblade
Copy link
Owner

Good news, I got the dynamic platform working and robots no longer disappear. I still have some work to do to move all the functionality to typescript and improve some stuff.

@JamieWhite
Copy link

Good news, I got the dynamic platform working and robots no longer disappear. I still have some work to do to move all the functionality to typescript and improve some stuff.

You should setup a patreon or some way to donate. Ive literally spent days trying to figure this out but not been a JS dev I really struggled. I'd love to buy you a beer.

@ifeign
Copy link
Author

ifeign commented Apr 30, 2021

Good news, I got the dynamic platform working and robots no longer disappear. I still have some work to do to move all the functionality to typescript and improve some stuff.

You should setup a patreon or some way to donate. Ive literally spent days trying to figure this out but not been a JS dev I really struggled. I'd love to buy you a beer.

Agreed! Many plugins now have a donate option that shows up if you use Homebridge UI X

@naofireblade
Copy link
Owner

You should setup a patreon or some way to donate. Ive literally spent days trying to figure this out but not been a JS dev I really struggled. I'd love to buy you a beer.

I have a BuyMeACoffee profile. I will add the donation link to homebridge, when the next release of the plugin gets verified.

@naofireblade
Copy link
Owner

I published version 1.0.0-beta.2 . Some TODOs remain until the final release.

You can install the beta with npm install -g homebridge-neato@beta

Changelog:

1.0.0-beta.1

  • Added bin full sensor
  • Added config-ui support for all options
  • Added config parameter prefix to use robot name as prefix for service names
  • Changed service names to not include robot name as prefix by default
  • Changed background update to use better default intervals (1 minute while cleaning, 30 minutes while idle)
  • Changed config parameter refresh. Renamed to backgroundUpdate, unit changed to minute and will only be used during idle
  • Changed config parameter hidden. Renamed to services, now takes list of services that should be visible. Default are all available services.
  • Fixed robots no longer disappear or change the room after connection issues with the Neato API
  • Fixed plugin no longer crashes if non smart robot is assigned in neato account
  • Fixed options for eco, nogo lines, extra care are now saved in homebridge and will no longer be overridden by Neato API

TODO until 1.0.0 release

  • Room cleaning (separate devices to be moved to different rooms)
  • Spot size
  • Retrying when no connection

@naofireblade
Copy link
Owner

The code for the beta can be found here: https://github.com/naofireblade/homebridge-neato/tree/dynamic-platform

@ekke1
Copy link

ekke1 commented May 4, 2021

The good news is: the beta version (1.0.0 beta.2) is now creating at least one robot, but is still missing the second one:
I would love to have both robots back ;-)

May 4 20:54:12 Rasp4 homebridge[5279]: [04/05/2021, 8:54:12 pm][NeatoVacuumRobot] Neato account has 2 robot s
May 4 20:54:12 Rasp4 homebridge[5279]: [04/05/2021, 8:54:12 pm] [NeatoVacuumRobot] Error getting robot meta information: Error: Request failed with status code 404: null
May 4 20:54:13 Rasp4 homebridge[5279]: [04/05/2021, 8:54:13 pm] [NeatoVacuumRobot] [Sauger1] Robot created

@naofireblade
Copy link
Owner

naofireblade commented May 5, 2021

Thanks for testing! Is the second robot connected to the internet?
Can you install beta.3 and run homebridge in debug mode and post the output to help identify the problem?

@ekke1
Copy link

ekke1 commented May 5, 2021 via email

@naofireblade
Copy link
Owner

Alright, can u disconnect the robot again, restart homebridge and see if the robot still exists there? That would be cool.

@ekke1
Copy link

ekke1 commented May 5, 2021 via email

@DJay-X
Copy link

DJay-X commented May 13, 2021

@naofireblade Thanks for your work. Meanwhile I was also able to install the latest beta.6
Start of the homebridge works and the log is looking good I think. Not much, but no error.

�[37m[13.5.2021, 09:47:02] �[39mLoaded plugin: homebridge-neato@1.0.0-beta.6
�[37m[13.5.2021, 09:47:02] �[39mRegistering platform 'homebridge-neato.NeatoVacuumRobot'
�[37m[13.5.2021, 09:47:09] �[39m�[36m[NeatoVacuumRobot]�[39m Initializing NeatoVacuumRobot platform...
�[37m[13.5.2021, 09:47:14] �[39m�[36m[NeatoVacuumRobot]�[39m Neato account has 1 robot
�[37m[13.5.2021, 09:47:14] �[39m�[36m[NeatoVacuumRobot]�[39m �[90mPlugin Cache has 1 robot�[39m
�[37m[13.5.2021, 09:47:14] �[39m�[36m[NeatoVacuumRobot]�[39m �[90m[Neato D7] Cached robot found in Neato account.�[39m
�[37m[13.5.2021, 09:47:14] �[39m�[36m[NeatoVacuumRobot]�[39m �[90m[Neato D7] Connecting to cached robot and updating information.�[39m
�[37m[13.5.2021, 09:47:17] �[39m�[36m[NeatoVacuumRobot]�[39m �[90m[Neato D7] Performing background update�[39m
�[37m[13.5.2021, 09:47:17] �[39m�[36m[NeatoVacuumRobot]�[39m [Neato D7] Successfully loaded robot from cache
�[37m[13.5.2021, 09:47:17] �[39m�[36m[NeatoVacuumRobot]�[39m �[90m[Neato D7] Background update done. Next update in 30 minutes.�[39m
�[37m[13.5.2021, 09:47:17] �[39m�[36m[NeatoVacuumRobot]�[39m �[90m[Neato D7] Options loaded from cache eco: true, noGoLines: true, extraCare: false�[39m

But am I doing something wrong?
In Eve App the Robot is not showing up at all. In Home App only as one single tile "House" which is not supported in any way. Not switches, no Dock (Anwesenheit).

Napkin 13 05 21, 8 27 49 AM

{
            "email": "mail@mail.com",
            "password": "xxxx-xxxx-xxxx",
            "language": "de",
            "prefix": true,
            "backgroundUpdate": 30,
            "services": [
                "clean",
                "cleanZone",
                "cleanSpot",
                "goToDock",
                "dockState",
                "binFull",
                "eco",
                "schedule",
                "findMe",
                "battery"
            ],
            "platform": "NeatoVacuumRobot"
        },

@ekke1
Copy link

ekke1 commented Aug 6, 2021 via email

@GitHubGoody
Copy link

@naofireblade I recently installed Homebridge. My Neato vacuum keeps moving back to the default room as originally mentioned in this issue. I'm on v0.7.3 of your plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants