-
Notifications
You must be signed in to change notification settings - Fork 100
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
DEVICE_CLASS_TIMESTAMP, DEVICE_CLASS_MOTION & BinarySensorDeviceClass.DOOR deprecated constant which will be removed in HA Core 2025.1 #232
Comments
when the time comes i hope it will be as simple as find and replace all. kinda irritating this is happening yet again. |
I tried a simple find/replace but my code editor (Visual Studio Code) flagged the python syntax as incorrect and I don't know python. I know @kevinvincent flagged this integration as no longer supported, but perhaps he could help us out/point us in the right direction? It's amazing that this code is still in use considering the effort required to keep the sensors in play - which in my case means aggressively monitoring battery life. |
@tggman I believe I was able to get this error to go away. Try replacing your binary_sensor.py file with the attached. I changed lines 23, 25, and 90. I know very little about python, I just looked at another integration I had with the same file and tried to understand how it was done there. Line 23: Line 25: Line 90: |
Thanks so much @jcauble! Really appreciate your detailed help and patch. Your fixes eliminated 2 out of the 3 errors in the log and WyseSense seems to be functioning as expected. Awesome. Thanks again. I followed your logic in an attempt to fix the DEVICE_CLASS_TIMESTAMP error but had to revert those changes back when I received all sorts of errors in the log. Have you had any luck fixing this error? Here are the changes I tried / made to binary_sensor.py which resulted in those log errors and which I reverted back:
Any additional help you can provide would be greatly appreciated. |
@tggman I’m not seeing that error, where do you see it? I’m running HA 2024.10.1. I saw the errors for door and motion in my home assistant logs, but I only noticed them because I was having an unrelated problem with Wyzesense. |
I too am running HAC 2024.10.1 The error: ... is under Settings/System/Logs - just like the other 2. Your error msg might be burried/reported in the same block with similar errors - like for example, the nest_protect error in the following: Logger: homeassistant.const DEVICE_CLASS_TIMESTAMP was used from wyzesense, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.TIMESTAMP instead, please report it to the author of the 'wyzesense' custom integration |
I figured out the fix. Here are the changes I made: At Line 17: At line 20: At Line 91: Here's the revised file: |
Hey this is great! I applied the above patch, but I'm still having problems with my wyze contact sensors (v2) not reporting back to HA. They seem to have stopped working on 9/25 which would have been the update to 2024.9.3. I am currently running 2024.10.1. I tired replacing the battery in one door sensor, but still no change. I see you are running 2024.10.1. Assuming your sensors are working, is there another fix you implemented as well? |
You might try unplugging the usb dongle, plugging it back in, and restarting home assistant. I’ve had this happen numerous times and this fixes it. |
Beautiful. This was it. Thanks! |
I've updated the code to resolve the all of the errors. Feel free to try out my newer code. https://github.com/stewjoel/ha-wyzesense/ |
i applied stewjoel's edits to binary_sensor.py in my own fork. so far so good. the commits did overwrite the previous fix i applied from issue #189 so we'll see how that goes.
replaced with:
|
for the life of me i can't figure out why @stewjoel fixes have now made this integration incompatible with hacs. i've tried completely uninstalling/reinstalling and have modified the manifest.json to remove all the install requirements or alternately add "aiofiles==0.4.0". no matter what i try i still get the error: the version xxxxxx for this integration can not be used with hacs hacs does some asinine parsing of the python scripts instead of just copying them to the custom_components directory (which works manually without fail so making hacs happy is the problem here). |
All I can tell you is that the above changes fixed the issue for me with no adverse consequences. |
@tggman Somehow I entirely missed your fix. That's great and may have saved me some time. @stanwebber I honestly haven't even looked at the HACS issue. I don't necessarily want to spend the time considering that there is maybe only a handful of people using this and manually adding to the custom_components is a simple process. If anyone wants to spend time looking at it, feel free to push changes to my branch and I can take a look. |
I just wanted to say that I use this integration and am extremely grateful for any efforts made for continuing support! Thanks all! |
ok, i figured out the problem with hacs. my fork did not have any associated tags so i published a release with the tag matching the version listed in the manifest.json and hacs is happy now. incidentally, i discovered erlanger (authored pull request for issue #189) published a fix in his fork for deprecated device_class_timestamp/motion/door back in april. i'm trying out his code right now and it also appears to be solid. |
Thanks for keeping this going guys! I still have half a dozen of the motion sensors in use and with the latest HA update they all stopped working. I replaced the binary_sensor.py and they all work again. Thank you so much. I do not have to buy all new sensors for the time being. I really appreciate it! |
Thank You @tggman |
I am seeing in the logs the following:
DEVICE_CLASS_TIMESTAMP was used from wyzesense, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.TIMESTAMP instead, please report it to the author of the 'wyzesense' custom integration
DEVICE_CLASS_MOTION was used from wyzesense, this is a deprecated constant which will be removed in HA Core 2025.1. Use BinarySensorDeviceClass.MOTION instead, please report it to the author of the 'wyzesense' custom integration
DEVICE_CLASS_DOOR was used from wyzesense, this is a deprecated constant which will be removed in HA Core 2025.1. Use BinarySensorDeviceClass.DOOR instead, please report it to the author of the 'wyzesense' custom integration
Is this something easy to update?
The text was updated successfully, but these errors were encountered: