gvigroux / hon

Support of all Haier, Candy, Hoover appliances integrated in the official hOn mobile app. Direct access to all possible services and parameters
MIT License
118 stars 45 forks source link

Problem with Home Assistant 2024.2.1 #123

Closed jstruggler closed 1 week ago

jstruggler commented 4 months ago

Hello, When I upgrade Home Assistant to version 2024.2.1 the integration changed the behaviour when controlling my Hon Oven.

I'm using version 0.6.12 and after the upgrade the Oven sensor misbehave by the following:

Had to rollback Home Assistant to previous version to keep using the integration.

Any ideas?

gvigroux commented 3 months ago

You have the same issue with the latest 2024.2.5?

jstruggler commented 3 months ago

Yes, tried with 2024.2.5, same behaviour.

gvigroux commented 3 months ago

I've made some updates but it should not solve your issue. There is (in theory) no link between this value and the HA version. Can you do a screenshot of all sensors, or at least gives me the name of the sensor with the bad value ?

jstruggler commented 3 months ago

Thank you for your feedback, really appreciated. Updated Hassio to 2024.3.0 and the behaviour is the same. I'm definitely sure that something changed starting of 2024.2.1 that impacted the way this integration works.

I've updated the integration to latest version using HACS and it was a total disaster to me, it stoped working and most sensors become unavailable. I notest, for instance, that const.py no longer has OVEN programs definitions.

Had to rollback everything to have it working again :( image

Reߢgards

gvigroux commented 3 months ago

Sorry about that. I changed a lot all sensor code in the last version due to a change in the HA core. Oven program definitions are now in locale json files. But still I don't understand why your sensors value disappeared... I will some tests on my side to try to understand this

jstruggler commented 3 months ago

Please don't apologise, I'm deeply thankful for your work, your integration helped me a lot with my oven integration with Home assistant. I was wondering if is possible to adjust the v0.6.12 sensor.py file to work with the recent hassio versions.

Thank you

gvigroux commented 3 months ago

I did some test and I'm not able to understand why you lose all sensors when upgrading to the latest version. Before investigating the HA issue, it's better to work on the latest version of the integration. Did you try to delete/install the hOn integration instead of doing just an upgrade ? do you have an error in the logs ?

gvigroux commented 3 months ago

Did you tried to delete/resinstall the latest version of this integration ?

jstruggler commented 3 months ago

Hello, yes, but same result :( image

Error Log: Log details (ERROR)

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:360 Integration: Sensor (documentation, issues) First occurred: 9:30:56 PM (1 occurrences) Last logged: 9:30:56 PM

Error while setting up hon platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/hon/sensor.py", line 117, in async_setup_entry appliances.extend([HonBaseProgram(hass, coordinator, entry, appliance)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hon/sensor.py", line 338, in init if( self._type_id in (APPLIANCE_TYPE.TUMBLE_DRYER)): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'APPLIANCE_TYPE' is not iterable

gvigroux commented 3 months ago

Thanks for the log! I just fix the issue. Now the latest version will work for you. Please update and after we will look at your "Status" sensor. You have a problem with the last one ? (value "Clear" in your last screenshot)

nunopicado commented 3 months ago

Can confirm, it's working again on my tumble dryer. Thank you @gvigroux.

By the way, I noticed you have a list of tested devices. If you want, you can add mine, which I believe is not on the list yet. It's a "Candy Smart Pro CSOE H8A2TE S". Candy is part of the Hoover/Haier ecosystem, and in some models (the newer ones I believe) they are using the HOn app, instead of the Candy owned Simply-Fi app.

Thank you 👍

jstruggler commented 3 months ago

Thanks for the log! I just fix the issue. Now the latest version will work for you. Please update and after we will look at your "Status" sensor. You have a problem with the last one ? (value "Clear" in your last screenshot)

Is working with the latest HA version! Thank you!

Still having the behaviour reported on the initial post, though. The oven status sensor doesn't change when I start the program. I'm using a Candy Oven - FCT825XL WIFI Model

the other sensor have differnt values too. This also impacted my automations.

image

gvigroux commented 3 months ago

That's a good start :) 1) About the "Status" value, now the data is refreshed only one time per minute. So when you test, be sure to wait at least 1 minute to see if the value is good. The decrease it due to a complain of the HAIER company themselves... 2) About "Mode" and "Program" the value were incorrect, do you have the mapping between the number and the text for both parameters ? I will be happy to update.

jstruggler commented 3 months ago

Hello,

Regarding bullet 2) the previous version had the following on the const.py:

OVEN_PROGRAMS = {
"0": "No Program",
"1": "No Program",
"3": "Botton",
"4": "Bottom + fan",
"6": "Convection + fan",
"5": "Convectional",
"25": "Taylor Bake",
"23": "Multi-level",
"28": "Pizza",
}

On the latest version this entry was removed. I believe this was used to covert the Program Number to the Program Name, right?

Regards

gvigroux commented 3 months ago

Now the Program names are in the locale files (with traductions). For the oven you have (i've added 2 value from your list above):

        "oven_program" : {
            "state": {
                "0": "No Program",
                "1": "No Program",
                "3": "Botton",
                "4": "Bottom + fan",
                "5": "Convectional",
                "6": "Convection + fan",
                "10": "Taylor Bake",
                "23": "Multi-level",
                "25": "Taylor Bake",
                "28": "Pizza",
                "54": "Soft+"
            }
        },

but this is not working for the washing machines and I have no clue why

gvigroux commented 2 months ago

I'm not able to find the error on the washing machines... can someone share an account for one day or two (in private) ? I will obviously not touch anything just try to understand why the mapping fails.

gvigroux commented 1 week ago

FYI I ve updated the integration month ago with Program Code and Program Phase to get more details