jeatheak / Mitsubishi-WF-RAC-Integration

WF-RAC homeassistant integration
MIT License
119 stars 21 forks source link

Units becoming unavailble #106

Open Pel1can111 opened 1 month ago

Pel1can111 commented 1 month ago

I am currently unsure if this is a problem with my setup or a bug in HA or this plugin but I set up an automation to alert me to any changes in the error code reported by the indoor units. I'm not sure if it started happening after the latest update with this plugin or the latest version of HA but I am randomly getting notifications due to the units becoming unavailable. Looking at the logs they seem to just briefly become unavailable then return to normal. This is something that would not be noticable if it were not for the notifications I had set up.

Please could other users just check their logbook and see if their units are doing the same so I know if this is a problem with HA or something with my units?

Thanks

drawgas commented 1 month ago

I can confirm, after latest update - units started frequently becomming unavailable. Restarting HA not always helps

jeatheak commented 1 month ago

Hi,

This is indeed because of the latest update. There were some feature requests about the availability of the device when you power it off. See #98.

I implemented this change. But this also means that if a call from the home assistant fails the AC unit, it becomes unavailable. That a call fails is a known issue and cannot be fixed at the moment unfortunately.

So you can change your automation to only report after X tries or I will implement a disable or X count before the unit becomes unavailable. I'm not sure yet.

Sorry for the inconvenience but I think the ability to make the unit unavailable after some time should be there.

Pel1can111 commented 1 month ago

Thanks for the update. Aside from the notifications its not been causing any trouble operating the units so I will modify the automation to prevent false notifications, still nice to know the cause.

Thanks :)

drawgas commented 1 month ago

Thanks for the update. Yes, it would be nice to have the option "unavailable after x retries" as currently it's a bit too frequent :)

290989 commented 1 month ago

I'm having this problem quite often at the moment. Sometimes the device remains unavailable. I've tried turning off the fuse, but that often didn't help either.

Is it possible to find another solution? I have many automations that react to the state of room temperature etc. and thus send changes to the air conditioning. Now, since the update, my device is sometimes unavailable 5-6 times an hour. Therefore, my regulations do not work reliably because they trigger at certain times (half an hour, full hour, etc.).

I would be very happy about an idea or solution.

Is the version before 2024.6 the 2024.2.1? Can I install the older version again?

IMG_0345

Now, since half an hour one of the devices is unavailable again.

290989 commented 1 month ago

@jeatheak An indoor unit was not available again for two hours today. I then deleted it and wanted to add it again. I then got the following error:

IMG_0355

After I turned the fuse off and on again, it worked again. Does this help to solve the problem?

jeatheak commented 1 month ago

Hi,

As far as I can see this is not a problem I can solve. The unit is really unavailable at that moment. If max retries have been exceeded it means that it cannot connect to the unit (get no response).

Did you try the smart-m air app at the same time?

The only thing I can try to add is an X count before putting it unavailable. But I think the unit is still unavailable and won't respond to your commands.

Before the update this was also happening but it was never visible in homeassistant.

Do you have more instances (homeassistant, apps) polling the unit? This can also cause some connectivity issues. The wifi module really does not like multiple connections as far as I know.

Edit: I maybe can add an option to disable the availability option.

290989 commented 3 weeks ago

Edit: I maybe can add an option to disable the availability option.

That would be nice. Thank you πŸ‘ŒπŸ»

I have only the Smart M-Air App & Home Assistant. Could it be, that the many pings if it’s available is to much & the unit is unavailable then?

Rorrik404 commented 3 weeks ago

As far as I can see this is not a problem I can solve. The unit is really unavailable at that moment. If max retries have been exceeded it means that it cannot connect to the unit (get no response).

Edit: I maybe can add an option to disable the availability option.

Agreed the unit really is offline at those points. I've tested mine via a post request and get a failure to establish connection. I've found that putting a DNS block on iot.smartmair.com has decreased the timeouts. Ultimately I think it's badly coded firmware on the AC side.

Adding an option to disable the availability check would be very useful. Likewise maybe adding an extending delay (to a point) for rechecks. E.g. GetStatus -> Fail -> Try again -> Fail -> Wait 30 seconds -> Fail -> Wait 1 Minute... Cap at checking every 5 minutes until its back?

290989 commented 3 weeks ago

Do you have more instances (homeassistant, apps) polling the unit? This can also cause some connectivity issues. The wifi module really does not like multiple connections as far as I know.

Do you know what are the 2 Accounts?

IMG_0453

could this be multiple connections?

jeatheak commented 3 weeks ago

Do you know what are the 2 Accounts?

Yes this are the number of registered devices (apps) with the airco unit. As far as I now you can have a maximum of 4 deviecs registeres (so for example: 3 smart-m air apps (different phones) and 1 homeassistant connection)

If it has reach 4 than you need to remove one.

could this be multiple connections?

In theory yes but only when the smart-m air app is activly open on the phone. It even sometimes gives a message that another instance is connected. But this will be resolved after some time. So this should not be a problem.

jeatheak commented 3 weeks ago

@Rorrik404

Agreed the unit really is offline at those points. I've tested mine via a post request and get a failure to establish connection. I've found that putting a DNS block on iot.smartmair.com has decreased the timeouts. Ultimately I think it's badly coded firmware on the AC side.

Yeah indeed I think it is a weirdly designed firmware. I have blocked the complete internet access of the AC's and still have it somethimes.

Adding an option to disable the availability check would be very useful. Likewise maybe adding an extending delay (to a point) for rechecks. E.g. GetStatus -> Fail -> Try again -> Fail -> Wait 30 seconds -> Fail -> Wait 1 Minute... Cap at checking every 5 minutes until its back?

This is a good suggestion. I will look into it.

Rorrik404 commented 3 weeks ago

@jeatheak Adding an extending delay getAirconStat check would likely solve 95% of the issues of the device becoming unavailable in HA. There's nothing you can do about it when the device is actually playing up (as discussed above).

That said a possibly "quick and dirty" fix would be add a "Force Recheck" button to the device page that calls the async_update function.

I found when testing that the device can become available again (constant posts going through without timing out) however HA doesn't update for quite a while. The only quick solution to get it available again is to restart HA so it does a getAirconStat when HA comes back up. Adding a "Force Recheck" button wouldn't solve the issue of it going offline, but would provide a very quick way to run an "has it started behaving again" check and avoid restarting HA.

jeatheak commented 2 weeks ago

It takes a bit more time and testing. Sorry for the delay. Have a very busy period at the moment. You can follow the progress at branch 2024.7

rogermeijer commented 2 weeks ago

I think I am facing similar issues with one unit in particular that becomes unavailable and stays like that. While waiting on 2024.7 (although I am already running 2024.7-beta.2), is there a way to get the unit available again? Restarting HA, redownloading integration, disabling/enabling device, nothing works. Any tips? Thanks a lot!

Pel1can111 commented 2 weeks ago

I think I am facing similar issues with one unit in particular that becomes unavailable and stays like that. While waiting on 2024.7 (although I am already running 2024.7-beta.2), is there a way to get the unit available again? Restarting HA, redownloading integration, disabling/enabling device, nothing works. Any tips? Thanks a lot!

This sounds like an actual problem with the unit, perhaps poor wifi signal in that area? I would suggest trying to access the unit through the smart m-air app and see if its still available there when not available in HA. If its not working via the app then it points towards an issue with the unit and not HA.

2112b commented 1 week ago

Roger, if you mean by unavailable that the unit does no longer responds in HA... This happend here after operating the unit with the remote. (the tempgauge changed colour to green I think)

Eventually, switching the unit off with the Remote returned the control in HA (after a short while)

rogermeijer commented 1 week ago

Thanks for the quick responses, your comments made me look (again) into the given IP addresses and for some reason the IP address of this specific device changed. After reconfiguring the IP address and restarting HA it is available again 🫣

The previous time it went "unavailable", while still working in the Smart M-Air app, it was not an IP issue. It did go back online after redownloading the integrations.

The second time it stayed unavailable, so I skipped the IP check. Sorry for the confusion! Now I need to find a way to fix the IP-address to the device with my current set-up 🧐

perplexityjeff commented 1 week ago

Hi,

I have noticed it mostly with 1 unit that in HA it is seen as 'unavailable' however using Smart M its perfectly controllable which seems weird (that unit is the most used one for sure). Also I see no drop in wifi connections on the router.

I just installed the integration as I just got the airco's but it seems that the checks are a bit to aggresive for availability?