odya / hass-ina219-ups-hat

Home Assistant UPS Hat integration. Waveshare and others based on INA219
MIT License
7 stars 2 forks source link

integration 'ina219_ups_hat' accesses hass.helpers.discovery. This is deprecated and will stop working in Home Assistant 2024.11 #11

Open CBDesignS opened 1 month ago

CBDesignS commented 1 month ago

Just a heads up that Home assistant is depreciating accesses hass.helpers.discovery.. the HA Logs show the following warning:-

Detected that custom integration 'ina219_ups_hat' accesses hass.helpers.discovery. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from discovery directly at custom_components/ina219_ups_hat/sensor.py, line 70: hass.helpers.discovery.load_platform('binary_sensor', DOMAIN, {, please create a bug report at https://github.com/odya/hass-ina219-ups-hat/issues Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 645: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues

rmtucker commented 1 month ago

So if this is not fixed it will no longer work in HA? I was just about to purchase the hat,but not sure what to do now.

CBDesignS commented 1 month ago

it will work up to Nov 2024 as that is when 2024.11 will be due to be released. This should be fixable by the repo/code owner and be a seamless update once they get round to it, or even someone else may clone the repo and fix it as there seems to be a few users that use this.

rmtucker commented 3 weeks ago

Hmm it seems someone has forked this and added some fixes,but unfortunately not for this problem!

CBDesignS commented 3 weeks ago

if Andrew fixes the bugs and his code works it might be better to use his fork until this repo pulls the updates. HA complains about a couple of other things, the battery reporting unit and summit else I can not think of right now. unfortunately this level of code is well above my station so I have to wait on others doing the hard work fixing things, we have to hope others can help or we might be stuck until someone than uses the ups come up with a fix.. I here Argon40 are working on an ups device for there cases so maybe it might be similar and we can use their code if push comes to shove, or use some of their code to fix this.

rmtucker commented 22 hours ago

You have been most helpful with this,but i am still sitting on the fence about purchasing the waveshare ups. Is there a method other than this for implementing the ups for safe shutdown,in case no fixes are forthcoming? I am using hassio on a raspberry pi 3 and have had sd cards corrupted in the past through power cuts. And i am not sure if it is possible to use the waveshare default scripts in hassio,at least that would be a backup just without the integration and dashboard stuff. Any advice would be greatly appreciated.

CBDesignS commented 19 hours ago

I just installed this and used it as is. I think there is similar version of this but with less bells and whistles but I can not remember if its was in the hacs store or it was a link to add it to the hacs store. If I find the link I will let you know.

As for the corrupt sd card, its the big down side of using a raspy pi in any scenario, they corrupt with ease and it is advised to use an external drive of some kind when using hassio mainly due to the amount of data writing and reading, (make sure you also backup your data daily, the addon I use backs up locally and to a google drive account, if the shit hits the fan and the hdd dies I still have a G drive backup I can restore) I used to use a laptop 2.5" hdd in a usb caddy since the pi can boot form usb, I then upgraded to a 2.5" ssd drive in the same caddy and the load times were 1/2 that of the hdd. Then I moved up a pi 4 and got the Argon40 case with built in ngff ssd . Now about 6 months later it looks like I am going to have to retire the rpi4 and build a small pc to run the whole thing as I am out growing the power of the rpi4. 90% of my house is now controlled by HA, from boiling the kettle, lowering the lounge blinds when its dark , telling me there is a person outside the door right thru to monitoring the temperature of each room. A guy in one video I watched said using HA is akin to being addicted to crack, the more you use it the more you want to use it and it takes over our life..

rmtucker commented 18 hours ago

Yes there is another in the hacs store https://github.com/uvjim/rpi_waveshare_ups Don't know if there are any install problems though. If it works it may be a backup if there is no fix. Thank you.