EverythingSmartHome / everything-presence-one

Official Repo for the Everything Presence One sensor!
411 stars 72 forks source link

No connection after upgrade to 1.2.5 stable #207

Closed atle-dahlman closed 2 months ago

atle-dahlman commented 3 months ago

Just upgraded Everything Presence One to 1.2.5 stable. Now it won't connect to Home Assistant.

Log shows:

INFO Reading configuration /config/esphome/everything-presence-one-xxxxxx.yaml... INFO Starting log output from 192.168.1.48 using esphome API INFO Successfully connected to everything-presence-one-xxxxxx @ 192.168.1.48 in 0.107s WARNING everything-presence-one-xxxxxx @ 192.168.1.48: Connection error occurred: everything-presence-one-xxxxxx @ 192.168.1.48: The connection dropped immediately after encrypted hello; Try enabling encryption on the device or turning off encryption on the client (ESPHome Logs 2024.7.1).

brutus1975cdn commented 3 months ago

Changing my packages to:

packages: EverythingSmartTechnology.Everything_Presence_One: url: https://github.com/everythingsmarthome/everything-presence-one files: everything-presence-one-sen0609.yaml ref: main refresh: 0s

Solved the issue for me.

Changing the refresh rate (I'm guessing this is how often it looks for an update on Github?) to something like 3600 - does that fix my local system and not hammer Github constantly?

BenHolmes commented 3 months ago

Can you try and change the packages section to this:

packages:
  EverythingSmartTechnology.Everything_Presence_One:
    url: https://github.com/everythingsmarthome/everything-presence-one
    files: everything-presence-one-sen0609.yaml
    ref: main
    refresh: 0s

Solved it! This is the best solution! Thank you so much for your help!! 😄

Make sure and revert that back to the way it was, as leaving it will cause a performance hit to your system - should be good to put back to standard now

So interesting... after getting updated to 1.2.5 switching the line from

packages:
  EverythingSmartTechnology.Everything_Presence_One:
    url: https://github.com/everythingsmarthome/everything-presence-one
    files: everything-presence-one-sen0609.yaml
    ref: main
    refresh: 0s

to

packages:
  Everything_Smart_Technology.Everything_Presence_One: github://everythingsmarthome/everything-presence-one/everything-presence-one-sen0609.yaml@main

reverts the version back from 1.2.5 to 1.2.4. Despite it supposedly being the same package.

Can you try and change the packages section to this:

packages:
  EverythingSmartTechnology.Everything_Presence_One:
    url: https://github.com/everythingsmarthome/everything-presence-one
    files: everything-presence-one-sen0609.yaml
    ref: main
    refresh: 0s

Solved it! This is the best solution! Thank you so much for your help!! 😄

Make sure and revert that back to the way it was, as leaving it will cause a performance hit to your system - should be good to put back to standard now

It looks like like this line will update you without needing to remove from home assistant, remove the api line, or face performance issues with 0s refresh.

Simply remove the @main reference.

packages:
  Everything_Smart_Technology.Everything_Presence_One: github://everythingsmarthome/everything-presence-one/everything-presence-one-sen0609.yaml

curious why @main would change anything

brutus1975cdn commented 3 months ago

packages: Everything_Smart_Technology.Everything_Presence_One: github://everythingsmarthome/everything-presence-one/everything-presence-one-sen0609.yaml

Ok. Did this. everything is online, will advise if it changes.

Thank you.

dmshimself commented 3 months ago

I've hit this issue too and I wonder if it might be possible to pop up a warning somewhere which suggests that you don't use the new ESPHome manufacturer provided update feature if you also have used ESPHome to update the device? Ages back ESPHome went through highly recommending encryption be applied and so I think many people will have done this and eagerly press the button to update.

liquidbrains commented 3 months ago

I've hit this issue too and I wonder if it might be possible to pop up a warning somewhere which suggests that you don't use the new ESPHome manufacturer provided update feature if you also have used ESPHome to update the device? Ages back ESPHome went through highly recommending encryption be applied and so I think many people will have done this and eagerly press the button to update.

Continuing on this, "Adopting" the EP1 device into ESPHome sets an encryption key by default. This seems like a conflict between expected configurations that could cause repeat issues?

PHLAK commented 2 months ago

I've run into this issue a few times including as recently as this morning. Been able to get the device working again by re-flashing manually.

However, I was wondering if there's a way to disable the Home Assistant update notification for these devices to prevent this from happening in the future.

Ocramius commented 2 months ago

FWIW, I've just run the software update proposed by HA for the official EP1 today (fresh off the shelf) and it's bricked again.

Is there an official "setting up with ESPHome" guide somewhere? The default adoption approach via ESPHome leads to a bricked device at every update, which is getting kinda tiresome...

EverythingSmartHome commented 2 months ago

FWIW, I've just run the software update proposed by HA for the official EP1 today (fresh off the shelf) and it's bricked again.

Is there an official "setting up with ESPHome" guide somewhere? The default adoption approach via ESPHome leads to a bricked device at every update, which is getting kinda tiresome...

Appreciate it's not easy from a user perspective to tell, but it's not the update thats at issue. It's that you are overwriting your encryption key as above. But I'm in agreement that it's not easy to tell what's happening from a user perspective.

Anyways, update 1.2.6 does actually disable the new GitHub entity by default. This should stop you updating this way and overwriting the key moving forward

Ocramius commented 2 months ago

@EverythingSmartHome thanks, glad to hear of the 1.2.6 changes! Re-flashing tonight 🤞

PHLAK commented 2 months ago

Anyways, update 1.2.6 does actually disable the new GitHub entity by default. This should stop you updating this way and overwriting the key moving forward

@EverythingSmartHome Perfect, thank you!

sumitkm commented 2 months ago

Okay, I am confused. So the solution is to remove Encryption? But if I do that ESPHome complains that device doesn't have encryption. How do I get rid of encryption requirement from ESPHome? I guess I am talking to myself, I'll go figure out.

ESPHome is bugging me out at the moment. All my presence sensors are either broken or stuck failing to upgrade. I think the encryption module is too big, so my 1MB Wemos boards, that I used to bootleg a few of these, are out of space for OTA!

OKAY, I am back! The advice to remove encryption key isn't great, because it will fail to upgrade ESP Home firmware the next time. You can't have "Auto Adopt" in HA and not have encryption key. Once you have encryption key, you can't remove it and install again so you'll be stuck with your version of ESP.

So, whatever the fix has been deployed in 1.2.6, I hope it sticks.

My bootlegged ones don't have "Auto Discover" feature coded in. So, I can still get away without encryption and for those who have used Wemos D1 boards as per the original video, have only 1MB RAM so encryption will likely kill OTA upgrades in future if you include encryption module.

That's an evening spent fixing 5 presence sensors (2 Presence Light, 1 Presence One and 2 bootlegged ones). Phew!

EverythingSmartHome commented 2 months ago

The advice to remove encryption key isn't great, because it will fail to upgrade ESP Home firmware the next time. You can't have "Auto Adopt" in HA and not have encryption key. Once you have encryption key, you can't remove it and install again so you'll be stuck with your version of ESP.

Just to clarify, I was stating that removing the encryption key is one option, but I also provided another option to resolve. What you are saying isn't strictly true, you can absolutely remove the encryption key without issue and still upgrade anytime. You just need to ensure that both sides match (either both have the encryption key or both don't use it). You can absolutely auto adopt in HA and not use the encryption key. And you can absolutely remove the encryption key once using it.

Glad you got it working in the end and hope that helps clarify