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

Core 2022.4.0 looses sensor attributes #223

Closed
sweichbr opened this issue Apr 6, 2022 · 16 comments
Closed

Core 2022.4.0 looses sensor attributes #223

sweichbr opened this issue Apr 6, 2022 · 16 comments

Comments

@sweichbr
Copy link

sweichbr commented Apr 6, 2022

I know this project is technically dead, but I just updated my HA to 4.0 and all wyze sense attributes are gone (and we all know how important the battery level is).

Anyone know what the issue may be?

@sweichbr
Copy link
Author

sweichbr commented Apr 6, 2022

Falling back to 3.8 and the sensors are back.

@stanwebber
Copy link

i can confirm this behavior. i'll wait to see if anything changes in 2022.4.1, but if not i'll be rolling back to 2022.3.8 and staying there maybe indefinitely.

@bschatzow
Copy link

Same for me. I did not notice it on the beta ( I wish I had seen it there and reported it).

@strikeir13
Copy link

This is because of the change from device_state_attributes to extra_state_attributes. There is an open pull request to resolve this, but the change in the pull request can also be manually added to address the error: #218

@stanwebber
Copy link

i have the fix in #218 applied, but the sensor attributes are still lost in 2022.4.0.

@bschatzow
Copy link

I manually changed my file and the attributes are back.

@sweichbr
Copy link
Author

sweichbr commented Apr 7, 2022

Yup. Worked for me too. Thanks @strikeir13 for the tip.

@sweichbr sweichbr closed this as completed Apr 7, 2022
@stanwebber
Copy link

well hell. thought i had merged a pull request with this fix in my fork back in jan, but i must have forgotten about it. merged the fix and updated my custom components, but the attributes are still missing. not sure what to look at next.

@sweichbr
Copy link
Author

sweichbr commented Apr 8, 2022 via email

@bastero
Copy link

bastero commented Apr 9, 2022

I manually changed my file and the attributes are back.

Forgive my ignorance...Can you be more specific about the change in 'custom_components/wyzesense/binary_sensor.py' ?

What I understand is to change the function's name i.e. 'device_state_attributes' to 'extra_state_attributes'. save and reboot HA. If there is any other change(s) required please advise.

However, this change below doesn't show the attributes once I reboot HA. Please clarify, thank you.

   def extra_state_attributes(self):
        """Attributes."""
        attributes = self._data.copy()
        del attributes[ATTR_STATE]
        del attributes[ATTR_AVAILABLE]

@bschatzow
Copy link

The only change I made to my binary_sensor.py file was

    @property
    def extra_state_attributes(self):

Make sure that you used a text editor and did not change any of the spaces.
Mine worked as soon as I did a restart or HA

@Kev7274
Copy link

Kev7274 commented Apr 9, 2022

I manually changed my file and the attributes are back.

Forgive my ignorance...Can you be more specific about the change in 'custom_components/wyzesense/binary_sensor.py' ?

What I understand is to change the function's name i.e. 'device_state_attributes' to 'extra_state_attributes'. save and reboot HA. If there is any other change(s) required please advise.

However, this change below doesn't show the attributes once I reboot HA. Please clarify, thank you.

   def extra_state_attributes(self):
        """Attributes."""
        attributes = self._data.copy()
        del attributes[ATTR_STATE]
        del attributes[ATTR_AVAILABLE]

Same here,doesn't work.

@bastero
Copy link

bastero commented Apr 9, 2022

The only change I made to my binary_sensor.py file was

    @property
    def extra_state_attributes(self):

Correction: It actually took some time but its now indicating battery attributes as it did previously. Thank you!!

@stanwebber
Copy link

it's been 2 days and i've restarted the host and hass a couple times, but i'm not seeing any attributes. i even pulled the custom components folder via sftp to manually verify the binary_sensor.py file had the fix and it did.

@Kev7274
Copy link

Kev7274 commented Apr 9, 2022

Everything seems to be working again. I had to retrigger the sensors for them to show up.

@stanwebber
Copy link

working now--all devices need to be physically triggered after the change. i lost a contact sensor (dead even with fresh battery) which added to the confusion.

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

No branches or pull requests

6 participants