Open wez opened 9 months ago
The workaround is to remove the API Key and govee email/password, but it's not a great workaround.
Not sure how plausible it is, but I think an ideal scenario would be for the add-on to start in a sort of offline mode if there's an outage, rather than throwing an exception. That would still allow LAN control devices to function. And perhaps at some interval (every 5 minutes? 10 minutes?), it would check that connectivity has been restore and if so, restore the rest of the functionality.
I am sure this is no small task, just thinking best case scenario.
The challenge is this: when first starting up, the names and rooms are retrieved from the APIs and those affect how the entities get created in home assistant. So we're deliberately gating startup on successfully reaching govee, because the first-run experience is degraded and higher effort if there is some kind of connectivity problem when users are setting things up. There are a decent number of users that are doing things with their network access in the name of security that will be impacted by this.
We could make changes to do this gating only the first start, but we'd then need to have some kind of persistent memory, and right now we are, except for cache data which can be discarded, stateless.
So there's some more general work to be done here to manage persistent state (eg: there'd need to be ways to see/edit/delete it) before we can make this particular scenario nicer.
Does that only affect discovery of new devices, or is that necessary for existing devices as well? It makes sense to me that attempting to configure new devices without cloud connectivity would be problematic
if there is no internet connection, then you won't be able to use either the iot or platform APIs, so you won't be able to discover them or talk to them.
For the LAN api, we don't need internet access to discover or control them, but the LAN API has no naming metadata so if we discover a device on the LAN and don't have internet access it will end up with a name like SKU_SHORTID
instead of something more meaningful.
Of course I can't speak for everybody, but personally I have no problem with saying, "internet access required for initial setup of ALL devices, even LAN-controlled ones (If you want meaningful names)".
But as long as the addon is still able to start & run in those scenarios, then we can still control LAN devices while offline, and resume full control once the outage is resolved.
I am thinking temporary outages, not fully isolated networks, as I don't see the point of that here, as so much functionality relies on the various cloud based APIs
I'm in agreement, however, it doesn't change the amount of work required for this to be realized.
it doesn't change the amount of work required for this to be realized.
Absolutely, I understand it's no small task. Thanks again
here's the log from trying to start with no internet connectivity.
Originally posted by @tankdeer in https://github.com/wez/govee2mqtt/issues/30#issuecomment-1892941079