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

Echonet Lite disconnecting sporadically until restart #181

Open
16thompn opened this issue Apr 30, 2024 · 31 comments
Open

Echonet Lite disconnecting sporadically until restart #181

16thompn opened this issue Apr 30, 2024 · 31 comments

Comments

@16thompn
Copy link

Good morning

I have been having this issue with my Mistsubishi Electric MSZ AP25/70 Aircon units since March and have tried numerous things to solve the problem.

After restarting home assistant, the aircons connect successfully and will maintain a connection anywhere from a few hours to several days before they become unavailable in home assistant and will not reconnect until the home assistant system is restarted. They still remain connected through the Mitsubishi App as well as through Google Home. They were running without issue for about 18 months before this issue began. I had not updated or changed anything on my homeassistant OS in about 6 months. Since then, I have updated to the latest version of echonet as well as updated the homeassistant core and homeassistant OS.

I have ensured that my router keeps these aircons on a static IP so that should not be the issue. I have enabled the debug log and posted the results below. You can see it is working normally before it seemingly begins timing out and will not reconnect. I'm not sure if this is an issue with the integration or my own personal setup. I have tried deleting and re-adding the devices since updating to the latest version of echonet. Any help would be greatly appreciated as I love the integration and use it everyday.

Please let me know if you need any more info. The debug log was 40mb as I enabled it immediately after restarting and it took three days before the latest disconnection issue so have included just the snippet below.

Cheers
Nick

2024-04-30 11:54:42.140 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.office_aircon is taking over 10 seconds
2024-04-30 11:54:42.151 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.kitchen_aircon is taking over 10 seconds
2024-04-30 11:54:42.151 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.rumpus_aircon is taking over 10 seconds
2024-04-30 11:54:42.179 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.bedroom_aircon is taking over 10 seconds
2024-04-30 11:55:02.494 DEBUG (MainThread) [custom_components.echonetlite] 
ECHONETlite polling update data:
 - Operation status 0x80(128): off
 - Air flow rate setting 0xa0(160): auto
 - Automatic control of air flow direction setting 0xa1(161): non-auto
 - Automatic swing of air flow setting 0xa3(163): not-used
 - Air flow direction (vertical) setting 0xa4(164): upper
 - Air flow direction (horizontal) setting 0xa5(165): right
 - Operation mode setting 0xb0(176): cool
 - Set temperature value 0xb3(179): 23
 - Measured value of room temperature 0xbb(187): 26
 - Measured outdoor air temperature 0xbe(190): 126

2024-04-30 11:55:02.495 DEBUG (MainThread) [custom_components.echonetlite.climate] Called async_update_callback on Office Aircon.
Changed: True
Update data: {128: 'off', 160: 'auto', 161: 'non-auto', 163: 'not-used', 164: 'upper', 165: 'right', 176: 'cool', 179: 23, 187: 26, 190: 126}
Old data: {128: 'off', 160: 'auto', 161: 'non-auto', 163: 'not-used', 164: 'upper', 165: 'right', 176: 'cool', 179: 23, 187: 26, 190: 126}
2024-04-30 11:55:02.505 DEBUG (MainThread) [custom_components.echonetlite] 
ECHONETlite polling update data:
 - Operation status 0x80(128): off
 - Air flow rate setting 0xa0(160): auto
 - Automatic control of air flow direction setting 0xa1(161): non-auto
 - Automatic swing of air flow setting 0xa3(163): not-used
 - Air flow direction (vertical) setting 0xa4(164): upper
 - Air flow direction (horizontal) setting 0xa5(165): left
 - Operation mode setting 0xb0(176): cool
 - Set temperature value 0xb3(179): 20
 - Measured value of room temperature 0xbb(187): 23
 - Measured outdoor air temperature 0xbe(190): 126

2024-04-30 11:55:02.506 DEBUG (MainThread) [custom_components.echonetlite.climate] Called async_update_callback on Kitchen Aircon.
Changed: True
Update data: {128: 'off', 160: 'auto', 161: 'non-auto', 163: 'not-used', 164: 'upper', 165: 'left', 176: 'cool', 179: 20, 187: 23, 190: 126}
Old data: {128: 'off', 160: 'auto', 161: 'non-auto', 163: 'not-used', 164: 'upper', 165: 'left', 176: 'cool', 179: 20, 187: 23, 190: 126}
2024-04-30 11:55:02.611 DEBUG (MainThread) [custom_components.echonetlite] 
ECHONETlite polling update data:
 - Operation status 0x80(128): off
 - Automatic control of air flow direction setting 0xa1(161): non-auto
 - Air flow rate setting 0xa0(160): auto
 - Automatic swing of air flow setting 0xa3(163): not-used
 - Air flow direction (vertical) setting 0xa4(164): upper
 - Air flow direction (horizontal) setting 0xa5(165): right
 - Measured cumulative power consumption 0x85(133): 913700
 - Operation mode setting 0xb0(176): cool
 - Set temperature value 0xb3(179): 21
 - Measured value of room temperature 0xbb(187): 25
 - Measured outdoor air temperature 0xbe(190): 126

2024-04-30 11:55:02.612 DEBUG (MainThread) [custom_components.echonetlite.climate] Called async_update_callback on Rumpus Aircon.
Changed: True
Update data: {128: 'off', 161: 'non-auto', 160: 'auto', 163: 'not-used', 164: 'upper', 165: 'right', 133: 913700, 176: 'cool', 179: 21, 187: 25, 190: 126}
Old data: {128: 'off', 161: 'non-auto', 160: 'auto', 163: 'not-used', 164: 'upper', 165: 'right', 133: 913700, 176: 'cool', 179: 21, 187: 25, 190: 126}
2024-04-30 11:55:02.638 DEBUG (MainThread) [custom_components.echonetlite] 
ECHONETlite polling update data:
 - Operation status 0x80(128): off
 - Automatic control of air flow direction setting 0xa1(161): non-auto
 - Air flow rate setting 0xa0(160): auto
 - Automatic swing of air flow setting 0xa3(163): not-used
 - Air flow direction (vertical) setting 0xa4(164): lower
 - Air flow direction (horizontal) setting 0xa5(165): right
 - Measured cumulative power consumption 0x85(133): 321000
 - Operation mode setting 0xb0(176): cool
 - Set temperature value 0xb3(179): 18
 - Measured value of room temperature 0xbb(187): 23
 - Measured outdoor air temperature 0xbe(190): 126


2024-04-30 11:55:02.639 DEBUG (MainThread) [custom_components.echonetlite.climate] Called async_update_callback on Bedroom Aircon.
Changed: True
Update data: {128: 'off', 161: 'non-auto', 160: 'auto', 163: 'not-used', 164: 'lower', 165: 'right', 133: 321000, 176: 'cool', 179: 18, 187: 23, 190: 126}
Old data: {128: 'off', 161: 'non-auto', 160: 'auto', 163: 'not-used', 164: 'lower', 165: 'right', 133: 321000, 176: 'cool', 179: 18, 187: 23, 190: 126}
2024-04-30 11:55:12.796 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.office_aircon_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 11:55:12.800 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.kitchen_aircon_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 11:55:12.849 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.rumpus_aircon_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 11:55:12.867 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.bedroom_aircon_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 11:55:32.796 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 11:55:32.798 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 11:55:32.850 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 11:55:32.867 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 11:55:42.142 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.office_aircon is taking over 10 seconds
2024-04-30 11:55:42.154 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.kitchen_aircon is taking over 10 seconds
2024-04-30 11:55:42.154 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.rumpus_aircon is taking over 10 seconds
2024-04-30 11:55:42.182 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.bedroom_aircon is taking over 10 seconds`
2024-04-30 11:56:12.797 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.office_aircon_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 11:56:12.800 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.kitchen_aircon_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 11:56:12.857 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.rumpus_aircon_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 11:56:12.868 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.bedroom_aircon_automatic_control_of_air_flow_direction_setting is taking over 10 seconds

@jacobw
Copy link

jacobw commented May 1, 2024

I'm getting a similar issue. I've been trying to isolate the issue and found this issue. All of my heat pumps have the same issue, like the orig poster, the Mitsubishi app still works fine.

2024-04-30 02:14:28.705 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.may_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:14:28.706 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.sw2_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:14:28.889 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.main_bedroom_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:14:48.705 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:14:48.706 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:14:48.889 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:14:58.706 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.may_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:14:58.890 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.sw2_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:14:58.891 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.main_bedroom_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:15:18.706 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 02:15:18.890 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 02:15:18.891 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 02:15:23.016 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.may_heatpump is taking over 10 seconds
2024-04-30 02:15:23.016 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.sw2_heatpump is taking over 10 seconds
2024-04-30 02:15:23.016 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.main_bedroom_heatpump is taking over 10 seconds
2024-04-30 02:15:28.706 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.may_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:15:28.707 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.sw2_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:15:28.890 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.main_bedroom_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:15:48.706 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:15:48.707 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:15:48.890 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:15:58.708 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.may_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:15:58.890 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.sw2_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:15:58.892 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.main_bedroom_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:16:18.707 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 02:16:18.891 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 02:16:18.893 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 02:16:23.016 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.may_heatpump is taking over 10 seconds
2024-04-30 02:16:23.016 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.sw2_heatpump is taking over 10 seconds
2024-04-30 02:16:23.016 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.main_bedroom_heatpump is taking over 10 seconds
2024-04-30 02:16:28.707 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.may_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:16:28.709 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.sw2_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:16:28.892 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.main_bedroom_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:16:48.707 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:16:48.708 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:16:48.892 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:16:58.708 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.may_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:16:58.892 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.sw2_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:16:58.894 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.main_bedroom_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:17:18.709 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 02:17:18.892 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 02:17:18.894 WARNING (MainThread) [homeassistant.components.select] Updating echonetlite select took longer than the scheduled update interval 0:00:30
2024-04-30 02:17:23.016 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.may_heatpump is taking over 10 seconds
2024-04-30 02:17:23.016 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.sw2_heatpump is taking over 10 seconds
2024-04-30 02:17:23.016 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.main_bedroom_heatpump is taking over 10 seconds
2024-04-30 02:17:28.709 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.may_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:17:28.709 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.sw2_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:17:28.893 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.main_bedroom_heatpump_measured_cumulative_power_consumption is taking over 10 seconds
2024-04-30 02:17:48.709 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:17:48.710 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:17:48.894 WARNING (MainThread) [homeassistant.components.sensor] Updating echonetlite sensor took longer than the scheduled update interval 0:00:30
2024-04-30 02:17:58.710 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.may_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:17:58.894 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.sw2_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds
2024-04-30 02:17:58.895 WARNING (MainThread) [homeassistant.helpers.entity] Update of select.main_bedroom_heatpump_automatic_control_of_air_flow_direction_setting is taking over 10 seconds

@nao-pon
Copy link
Collaborator

nao-pon commented May 2, 2024

This integration may be the cause, but we were unable to determine the problem from the log file.
Please try the following measures to rule out any influence from the network environment.

  1. Restart the LAN hub
  2. Restart the network router
  3. Power cycle the air conditioner

Continue to observe after taking the above measures.

@jacobw
Copy link

jacobw commented May 3, 2024

I've had to rollback as I can't have my home as a test environment overnight sorry. I can say that I'm a network engineer and it wasn't a network issue cause such significant delays observed over days. I also have 3 Mistsubishi heatpumps (2 x AP25 and 1 AP35) and they all had the issue at the same time, so I think that eliminates the heat pump being the issue.

I notice the orig poster has the same model heatpumps.

I'll try and roll forward during the day but not sure if it will be long enough to trigger it.

Are there some manual debug commands I can run to figure out what is causing the issue when it happens?

@scottyphillips
Copy link
Owner

@16thompn So if I understand this correctly - this issue started in March, but at the time you had not performed any sort of update of either home assistant or this component, having not updated in 6 months? Has anything else in your environment possibly changed?

Do you add the devices manually using their IP address, or do you use the auto discover function (which relies heavily on multicast?) Perhaps try enabling the force polling option too to see if that helps?

@scottyphillips
Copy link
Owner

I would be adding the devices manually using their IP address rather then auto discover if that is what is being used at this point. It could possibly be some issue with IGMP snooping killing off multicast queries after a certain period of time? I have had no end of dramas with IGMP snooping for similar integrations which rely on multicast?

@scottyphillips
Copy link
Owner

@jacobw as you are a network engineer, fire up Wireshark on a spare laptop and monitor the traffic over a period of time to see if you can identify what is going on?

@jacobw
Copy link

jacobw commented May 4, 2024

Does the autodiscover process not just get the ip and save it?

@16thompn
Copy link
Author

16thompn commented May 7, 2024

@16thompn So if I understand this correctly - this issue started in March, but at the time you had not performed any sort of update of either home assistant or this component, having not updated in 6 months? Has anything else in your environment possibly changed?

Do you add the devices manually using their IP address, or do you use the auto discover function (which relies heavily on multicast?) Perhaps try enabling the force polling option too to see if that helps?

Apologies for the delay in getting back!

That's correct. The HomeAssistant version had not been touched for over 6 months (including not updating) and I also had not installed any new software or integrations or even added any new devices. Everything was working so didn't touch it! We have not changed routers or anything to do with the internet set up.

I manually locked the IP address of my HVAC systems in my router settings and then manually added the IP addresses to the EchoNet integration. This worked rather flawlessly for about 18 months.

Since this I have tried restarting the router and lan hub, HA, power cycles the aircons and readd them again. It works for several days but still disconnects shortly after.

I have actually added a restart HA button to my interface as a temporary measure and this works a treat as they will always be reconnected when the system reboots

20240507_220415000_iOS

Let me know if I can provide any more information or if there are any other debugging logs that I could access to shed more light on the issue.

Cheers
Nick

@scottyphillips
Copy link
Owner

scottyphillips commented May 7, 2024

@16thompn To be frank it is difficult for me to attribute your issues to any fault in the custom component. As you said - you hadn't updated anything, it worked flawlessly for 6 months and then you started encountering issues. Your issue cannot have been caused by some issue with the custom component since it was working for 6 months. 6 months of issue free performance is hardly indicative of any undetected defect in the code. If you had said you updated to version X of either Home assistant and/or the custom component, and then the issues started there would be a clear causality and we could look at what changed in the code or not. But in your case we cannot. How exactly are you running Home Assistant? Unfortunately I do not have the time available to work on this. The only thing I suggest at this stage is to roll back to version 1.7.9 as there have been some significant updates in 1.8.0.

@16thompn
Copy link
Author

16thompn commented May 9, 2024

I am running HA on a Raspberry Pi 4. The integration has now been working without issue for 72 hours since the last restart. I appreciate your feedback and if I continue to have it drop out I will try rolling back. It does make sense that something else might be going wrong given that it worked without issue for so long. I just can't work out what that might be given the lack of any changes to the system! I will update if I find any more useful info.

My only thought is that if the request is timing out, is there a way to increase this? Can I do this manually anywhere?

Thanks again

@BlairC1
Copy link

BlairC1 commented Aug 18, 2024

I thought mine was dropping randomly too but turns out it wasn't random - it was the microwave! Interestingly all of my other 2.4ghz devices stay online and the Mitsubishi app shows it online but anything done in the app doesn't control the AC. I'm using a MAC-588IF, maybe they don't handle interference very well. I haven't tried changing 2.4ghz channel yet.

@16thompn
Copy link
Author

I thought mine was dropping randomly too but turns out it wasn't random - it was the microwave! Interestingly all of my other 2.4ghz devices stay online and the Mitsubishi app shows it online but anything done in the app doesn't control the AC. I'm using a MAC-588IF, maybe they don't handle interference very well. I haven't tried changing 2.4ghz channel yet.

Oh that's an interesting thought. We use our microwave very frequently so will have to do some testing to see if that's what is causing it. It could explain why it only began recently when we got a new microwave. Not sure if they are correlated as I can't remember exact dates. I'm away for a couple of weeks now but will see when I get back if this causes the issue! Thanks for your input :)

@BlairC1
Copy link

BlairC1 commented Aug 27, 2024

FYI - I've switched from channel 11 to channel 1 on my 2.4ghz network and so far so good for me.

@16thompn
Copy link
Author

FYI - I've switched from channel 11 to channel 1 on my 2.4ghz network and so far so good for me.

Thanks so much for the info again. I am home next week so will switch everything over and report back. Hopefully this is the issue 😊

@IsaacInsoll
Copy link

Hi,
I have the same problem with it dropping out and a HA restart fixing the problem and then it seems to last a few days to a week. I can still use the mitsubishi app so the actual physical device is still connected and working. I'll try changing the channel too and see what happens

@16thompn
Copy link
Author

Hi,

I have the same problem with it dropping out and a HA restart fixing the problem and then it seems to last a few days to a week. I can still use the mitsubishi app so the actual physical device is still connected and working. I'll try changing the channel too and see what happens

I went to go change the channel on my router but am using a Deco mesh wifi and they don't let you adjust your routers channel number. I have noted as well that it does not disconnect from the Mitsubishi wifi app despite being disconnected from HA.

@nao-pon
Copy link
Collaborator

nao-pon commented Sep 15, 2024

When an issue occurs, does an integrated device reload resolve the issue rather than an HA restart?

If a device reload resolves it, you can use automation to fix it.

@IsaacInsoll
Copy link

IsaacInsoll commented Sep 15, 2024 via email

@nao-pon
Copy link
Collaborator

nao-pon commented Sep 15, 2024

It is likely that the pychonet UDP server is experiencing some communication problems, but I have not experienced any problems in either my production or test environments, so I am still unable to speculate on what to do about it.

@josh-shaw-dev
Copy link

I've been seeing this recently as well.

I have changed a fair bit on my end so I'm debugging bits as I go along and I am currently looking at pychonet to track down the behavior in pychonet currently so will open up an issue there to see if we can get to the bottom of it

scottyphillips/pychonet#75

@IsaacInsoll
Copy link

Thanks so much for checking this out Josh.
This same problem has been frustrating for months. I'm a JS dev but haven't touched python before and haven't looked at the insides of HA before and didn't really know how to start troubleshooting it

@josh-shaw-dev
Copy link

After debugging for a week or so to try get to the bottom of this, I think I found my issue though I'm not 100% certain of the cause yet.

Setup:
MSZ-AP20VGD - mitsi heat pump
MAC-568-IF-E - wifi interface to heat pump
Wifi provided by unifi access points
Pfsense as the router/firewall with VLANS for certain networks
My IOT devices live on a seperate VLAN, the home assistant server also is on another different VLAN
IOT VLAN - No internet access, 2.4ghz, custom settings
LAN_VLAN - Normal internet access, 2.4ghz/5gz, settings on auto in unifi management

MAC-568-IF-E - wifi interface lives on IOT_VLAN
Running tcpdump on the access point that the wifi interface was connected to I could see ocasionally the first packet leaving the Unifi access point though not getting a reply from the echonet device.
This would happen with ping in the same randomness
It would happen either from my desktop or server

I did a reset on the MAC-568-IF-E wifi interface and made it connect to LAN_VLAN so it had access to the internet and set it up again and that so far (12 hours) has not had any errors/warning from home assistant and it appears to be back to solidly reliable

I'm not sure what the exact cause is as the IOT wifi network does have some custom settings and is blocked from internet access compared to the LAN_VLAN network

At this stage it appears the network setup or the reset has solved the issue. I will give it a week and attempt to put it back on the IOT network and see what happens.

I tried to do a device reload but it doesn’t connect. I can ping the device so the IP hasn’t changed and the Mitsubishi app still works.

@IsaacInsoll do you happen to see any ocasional packet loss when pinging, mine was happening on the first ping and it would randomly be dropped

@IsaacInsoll
Copy link

I've just done a ping from local machine and it seems like there is no dropouts at the moment.
It seems like everything is working at the moment. My HA container has been up for 36 days but I often restart from within HA when the AC drops (which presumably doesn't reset docker container uptime) out so I can't tell what my actual uptime is.

A few notes on my setup if it helps at all

  • Statically assigned IP (from PiHole) and the whole network is just one basic LAN/WIFI network (IE: no different vlans/subnets or anything)
  • MAC-568IF-E installed into my AC unit, and I don't have any other wifi or network connectivity issues I'm aware of even though I have heaps of devices on the network.

I'm super happy to do any other troubleshooting that can help either now (while it's working) or if you want to give me some testing procedures to isolate the issue next time it dies.

Thanks again!

Pinging livingroom-aircon [192.168.0.126] with 32 bytes of data:
Reply from 192.168.0.126: bytes=32 time=6ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=1ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=4ms TTL=255
Reply from 192.168.0.126: bytes=32 time=4ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=1ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=4ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=5ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=1ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=4ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=1ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=5ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=1ms TTL=255
Reply from 192.168.0.126: bytes=32 time=5ms TTL=255
Reply from 192.168.0.126: bytes=32 time=1ms TTL=255
Reply from 192.168.0.126: bytes=32 time=1ms TTL=255
Reply from 192.168.0.126: bytes=32 time=1ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=4ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=1ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=4ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=4ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=3ms TTL=255
Reply from 192.168.0.126: bytes=32 time=4ms TTL=255
Reply from 192.168.0.126: bytes=32 time=2ms TTL=255
Reply from 192.168.0.126: bytes=32 time=5ms TTL=255

Ping statistics for 192.168.0.126:
    Packets: Sent = 69, Received = 69, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 6ms, Average = 2ms

@josh-shaw-dev
Copy link

Can you post the docker inspect output for your container, is it on host network or mapped ports?

Also another thing to try, this script will use the underlying library to poll you aircon machine for its on/off status
Might be an idea to get it working when home assistant is working and when home assistant breaks then try it and see if there is any output

Only tested on linux, windows was going on about not being able to create a non blocking socket I think

python -m venv venv
source venv/bin/activate
pip install pychonet

python aircon_test.py "192.168.0.126"

aircon_test.zip

@IsaacInsoll
Copy link

I'm running this in Container Manager on synology and can't see a way to do a docker inspect. Here's the compose file which I presume answers the question?

version: "3"
services:
  homeassistant:
   container_name: homeassistant
   image: homeassistant/home-assistant:latest
   network_mode: "host"
   environment:
     WHEELS_LINKS: https://wheels.home-assistant.io/musllinux/
     TZ: 'Australia/Brisbane'
   volumes:
     - './homeassistant/config:/config'
   restart: unless-stopped

I'll test out that script on WSL2 tonight and see if I can get it working (while aircon is in running state so we have a baseline). I've got linux boxes at work but not at home

@IsaacInsoll
Copy link

IsaacInsoll commented Dec 2, 2024

Sorry for the insane delay on responding to this.
I've noticed the dropouts have still been happening and as previously discussed a HA reboot fixes it for a few days.
I've noticed that if I turn on the AC with the physical remote I'll sometimes see the AC appear as online in HA for a minute (i can't interact with it, and it goes back online) but I thought that might be a useful hint.

I finally ran the task you provided and this is the output

    ~/Downloads ▓▒░ python aircon_test.py "192.168.0.126"           ░▒▓ ✔  took 6s   Downloads   at 12:26:33 
2024-12-02 12:26:40.000921 Attempting discover of 192.168.0.126
2024-12-02 12:27:10.074914 Finshed discover
Traceback (most recent call last):
  File "/home/isaac/Downloads/aircon_test.py", line 36, in <module>
    asyncio.run(main(sys.argv))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/isaac/Downloads/aircon_test.py", line 27, in main
    aircon = HomeAirConditioner(target, server)
  File "/home/isaac/Downloads/venv/lib/python3.10/site-packages/pychonet/HomeAirConditioner.py", line 287, in __init__
    EchonetInstance.__init__(
  File "/home/isaac/Downloads/venv/lib/python3.10/site-packages/pychonet/EchonetInstance.py", line 56, in __init__
    self._epc_data = self._api._state[self._host]["instances"][self._eojgc][
KeyError: 1

@IsaacInsoll
Copy link

image

The Air Con is currently in "unavailable" state for the last few days. I haven't done a HA restart yet to fix it, but here's something that might help with troubleshooting the issue:

Whenever we use the physical remote to change settings: HA picks it up immediately and the device is temporarily online for a minute before reverting to unavailable state.

As previously discussed: it's still controllable from the factory Mitsubishi app as well.

I'm not sure what else I can to do help test it but please let me know if there is something I can do.

@josh-shaw-dev
Copy link

Host mode so is directly on the nas network interface so udp will work

network_mode: "host"

Looking at the timing here that's 30 seconds and it fails to discover hence the error thrown below it

2024-12-02 12:26:40.000921 Attempting discover of 192.168.0.126
2024-12-02 12:27:10.074914 Finshed discover

I'm leaning towards something wrong in your network, like what was causing my issue.

You might need to break out wireshark and monitor the traffic to see whats happening

@IsaacInsoll
Copy link

Thanks for your help so far. I was running this in WSL2 on Windows 11 which can do some weird stuff with docker networking so I thought I'd run the same steps via SSH to my NAS which is literally the machine running home assistant.

I'm a python noob and not sure how I've messed this up

Isaac@NAS:/volumeUSB1/usbshare$ cd test
Isaac@NAS:/volumeUSB1/usbshare/test$ python -m venv venv
Isaac@NAS:/volumeUSB1/usbshare/test$ source venv/bin/activate
(venv) Isaac@NAS:/volumeUSB1/usbshare/test$ pip install pychonet
WARNING: The directory '/volume1/@fake_home_link/Isaac/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting pychonet
  Downloading pychonet-2.6.13-py3-none-any.whl (83 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83.1/83.1 KB 2.8 MB/s eta 0:00:00
Collecting deprecated
  Downloading Deprecated-1.2.15-py2.py3-none-any.whl (9.9 kB)
Collecting wrapt<2,>=1.10
  Downloading wrapt-1.17.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (85 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.6/85.6 KB 69.2 MB/s eta 0:00:00
Installing collected packages: wrapt, deprecated, pychonet
Successfully installed deprecated-1.2.15 pychonet-2.6.13 wrapt-1.17.0
WARNING: You are using pip version 22.0.4; however, version 24.3.1 is available.
You should consider upgrading via the '/volumeUSB1/usbshare/test/venv/bin/python -m pip install --upgrade pip' command.
(venv) Isaac@NAS:/volumeUSB1/usbshare/test$ python aircon_test.py "192.168.0.126"
Traceback (most recent call last):
  File "aircon_test.py", line 5, in <module>
    from pychonet.lib.udpserver import UDPServer
  File "/volumeUSB1/usbshare/test/venv/lib/python3.8/site-packages/pychonet/__init__.py", line 1, in <module>
    from pychonet.echonetapiclient import ECHONETAPIClient  # noqa
  File "/volumeUSB1/usbshare/test/venv/lib/python3.8/site-packages/pychonet/echonetapiclient.py", line 25, in <module>
    from pychonet.lib.epc_functions import EPC_SUPER_FUNCTIONS
  File "/volumeUSB1/usbshare/test/venv/lib/python3.8/site-packages/pychonet/lib/epc_functions.py", line 89, in <module>
    def _call_int(data: bytes | list):
TypeError: unsupported operand type(s) for |: 'type' and 'type'

@josh-shaw-dev
Copy link

Thanks for your help so far. I was running this in WSL2 on Windows 11 which can do some weird stuff with docker networking so I thought I'd run the same steps via SSH to my NAS which is literally the machine running home assistant.

I'm a python noob and not sure how I've messed this up

Isaac@NAS:/volumeUSB1/usbshare$ cd test
Isaac@NAS:/volumeUSB1/usbshare/test$ python -m venv venv
Isaac@NAS:/volumeUSB1/usbshare/test$ source venv/bin/activate
(venv) Isaac@NAS:/volumeUSB1/usbshare/test$ pip install pychonet
WARNING: The directory '/volume1/@fake_home_link/Isaac/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting pychonet
  Downloading pychonet-2.6.13-py3-none-any.whl (83 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83.1/83.1 KB 2.8 MB/s eta 0:00:00
Collecting deprecated
  Downloading Deprecated-1.2.15-py2.py3-none-any.whl (9.9 kB)
Collecting wrapt<2,>=1.10
  Downloading wrapt-1.17.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (85 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85.6/85.6 KB 69.2 MB/s eta 0:00:00
Installing collected packages: wrapt, deprecated, pychonet
Successfully installed deprecated-1.2.15 pychonet-2.6.13 wrapt-1.17.0
WARNING: You are using pip version 22.0.4; however, version 24.3.1 is available.
You should consider upgrading via the '/volumeUSB1/usbshare/test/venv/bin/python -m pip install --upgrade pip' command.
(venv) Isaac@NAS:/volumeUSB1/usbshare/test$ python aircon_test.py "192.168.0.126"
Traceback (most recent call last):
  File "aircon_test.py", line 5, in <module>
    from pychonet.lib.udpserver import UDPServer
  File "/volumeUSB1/usbshare/test/venv/lib/python3.8/site-packages/pychonet/__init__.py", line 1, in <module>
    from pychonet.echonetapiclient import ECHONETAPIClient  # noqa
  File "/volumeUSB1/usbshare/test/venv/lib/python3.8/site-packages/pychonet/echonetapiclient.py", line 25, in <module>
    from pychonet.lib.epc_functions import EPC_SUPER_FUNCTIONS
  File "/volumeUSB1/usbshare/test/venv/lib/python3.8/site-packages/pychonet/lib/epc_functions.py", line 89, in <module>
    def _call_int(data: bytes | list):
TypeError: unsupported operand type(s) for |: 'type' and 'type'

I wouldnt run it on WSL as I'm sure it will have the same issue as docker and udp packets not being able to be routed correctly

It's throwing errors as your python version on the nas does not support the union operator |. Needs to be above 3.10

You will want to test on a newer distro, download something easy like ubuntu or linux mint, in windows download the LTS iso and use rufus to burn it to a usb stick and run it live from usb on your pc/laptop

@IsaacInsoll
Copy link

Thanks heaps, will test it out and get back to you :)

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

7 participants