Problems keeping status
Closed this issue · 6 comments
I also have this integration working for some time, i notice the following since latest releases.
Issue 1 after I restart homeassistant it hangs on loading the integration until i do something with the airpurifier, change mode on the device or turn off or on… then the integration loads and homeassistant starts… otherwise it just hangs until a timeout and the device is greyed out.
Issue 2 After latest releases it looses state, Ha (or node red) turns it … the device turns on but then after few seconds the button turns off (not the device) and the state is out of sync…
See Logging:
2022-05-21 09:54:52 DEBUG (MainThread) [aioairctrl.coap.client] REQUEST: {"state": {"desired": {"CommandType": "app", "DeviceId": "", "EnduserId": "", "pwr": "1"}}}
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Sending request - Token: 8cbd, Remote: <UDP6EndpointAddress 192.168.1.74>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Sending message <aiocoap.Message at 0x7f90ac3100: Type.NON POST (MID 42295, token 8cbd) remote <UDP6EndpointAddress 192.168.1.74>, 1 option(s), 264 byte(s) payload>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Incoming message <aiocoap.Message at 0x7f91c795e0: Type.NON 2.05 Content (MID 42295, token 8cbd) remote <UDP6EndpointAddress 192.168.1.74 (locally 192.168.1.75%eth0)>, 1 option(s), 19 byte(s) payload>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Received Response: <aiocoap.Message at 0x7f91c795e0: Type.NON 2.05 Content (MID 42295, token 8cbd) remote <UDP6EndpointAddress 192.168.1.74 (locally 192.168.1.75%eth0)>, 1 option(s), 19 byte(s) payload>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Response <aiocoap.Message at 0x7f91c795e0: Type.NON 2.05 Content (MID 42295, token 8cbd) remote <UDP6EndpointAddress 192.168.1.74 (locally 192.168.1.75%eth0)>, 1 option(s), 19 byte(s) payload> matched to request <PlumbingRequest at 0x7f90823160 around <aiocoap.Message at 0x7f90ac3100: Type.NON POST (MID 42295, token 8cbd) remote <UDP6EndpointAddress 192.168.1.74>, 1 option(s), 264 byte(s) payload> with 2 callbacks>
2022-05-21 09:54:52 DEBUG (MainThread) [aioairctrl.coap.client] RESPONSE: b'{"status":"failed"}'
2022-05-21 09:54:52 DEBUG (MainThread) [aioairctrl.coap.client] set_control_value failed. resyncing...
2022-05-21 09:54:52 DEBUG (MainThread) [aioairctrl.coap.client] syncing
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Sending request - Token: 8cbe, Remote: <UDP6EndpointAddress 192.168.1.74>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Sending message <aiocoap.Message at 0x7f91c79940: Type.NON POST (MID 42296, token 8cbe) remote <UDP6EndpointAddress 192.168.1.74>, 1 option(s), 8 byte(s) payload>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Incoming message <aiocoap.Message at 0x7f91c79400: Type.NON 2.05 Content (MID 42296, token 8cbe) remote <UDP6EndpointAddress 192.168.1.74 (locally 192.168.1.75%eth0)>, 1 option(s), 8 byte(s) payload>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Received Response: <aiocoap.Message at 0x7f91c79400: Type.NON 2.05 Content (MID 42296, token 8cbe) remote <UDP6EndpointAddress 192.168.1.74 (locally 192.168.1.75%eth0)>, 1 option(s), 8 byte(s) payload>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Response <aiocoap.Message at 0x7f91c79400: Type.NON 2.05 Content (MID 42296, token 8cbe) remote <UDP6EndpointAddress 192.168.1.74 (locally 192.168.1.75%eth0)>, 1 option(s), 8 byte(s) payload> matched to request <PlumbingRequest at 0x7f90823340 around <aiocoap.Message at 0x7f91c79940: Type.NON POST (MID 42296, token 8cbe) remote <UDP6EndpointAddress 192.168.1.74>, 1 option(s), 8 byte(s) payload> with 2 callbacks>
2022-05-21 09:54:52 DEBUG (MainThread) [aioairctrl.coap.client] synced: 161A0377
2022-05-21 09:54:52 DEBUG (MainThread) [aioairctrl.coap.client] set_control_value failed. retrying...
2022-05-21 09:54:52 DEBUG (MainThread) [aioairctrl.coap.client] REQUEST: {"state": {"desired": {"CommandType": "app", "DeviceId": "", "EnduserId": "", "pwr": "1"}}}
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Sending request - Token: 8cbf, Remote: <UDP6EndpointAddress 192.168.1.74>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Sending message <aiocoap.Message at 0x7f91c79700: Type.NON POST (MID 42297, token 8cbf) remote <UDP6EndpointAddress 192.168.1.74>, 1 option(s), 264 byte(s) payload>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Incoming message <aiocoap.Message at 0x7f9a2bab50: Type.NON 2.05 Content (MID 42297, token 8cbf) remote <UDP6EndpointAddress 192.168.1.74 (locally 192.168.1.75%eth0)>, 1 option(s), 20 byte(s) payload>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Received Response: <aiocoap.Message at 0x7f9a2bab50: Type.NON 2.05 Content (MID 42297, token 8cbf) remote <UDP6EndpointAddress 192.168.1.74 (locally 192.168.1.75%eth0)>, 1 option(s), 20 byte(s) payload>
2022-05-21 09:54:52 DEBUG (MainThread) [coap] Response <aiocoap.Message at 0x7f9a2bab50: Type.NON 2.05 Content (MID 42297, token 8cbf) remote <UDP6EndpointAddress 192.168.1.74 (locally 192.168.1.75%eth0)>, 1 option(s), 20 byte(s) payload> matched to request <PlumbingRequest at 0x7f91c79b20 around <aiocoap.Message at 0x7f91c79700: Type.NON POST (MID 42297, token 8cbf) remote <UDP6EndpointAddress 192.168.1.74>, 1 option(s), 264 byte(s) payload> with 2 callbacks>
2022-05-21 09:54:52 DEBUG (MainThread) [aioairctrl.coap.client] RESPONSE: b'{"status":"success"}'
Hopefully this can be fixed… did not have this behaviour before…
Greetings
AC4236 My Device
Philips AirPurifier (with CoAP)
v0.10.7
Workaround...
-
Start Home Assistant... wait until the message comes that the plugin is loading...then turn on or off the device manualy so that the integration suddenly sees the airpurifier.
-
After the integration has loaded and looses track...Restart the integration
--> integrations --> AC4236 My Device --> reload
Does v0.10.8
make a difference for you?
The log doesn't show that it hangs on loading. Please write a separate issue for that with a log that shows what is going on. I'll change the title to reflect the second issue.
And can you please enable logging for the integration with:
custom_components.philips_airpurifier_coap: debug
Hi Thanx for the responce.
I updated the integration.
Same issues remanes sadly
I did the following steps:
I removed the integration and the device entirely from HA to make a clean install and test.
I installed the latest repository, rebooted and added the integration.
**2022-05-30 13:24:00 WARNING (MainThread) [custom_components.philips_airpurifier_coap.config_flow] Timeout, host 192.168.1.74 looks like a Philips AirPurifier but doesn't answer, aborting**
2022-05-30 13:24:33 INFO (MainThread) [homeassistant.setup] Setting up philips_airpurifier_coap
2022-05-30 13:24:33 INFO (MainThread) [homeassistant.setup] Setup of domain philips_airpurifier_coap took 0.0 seconds
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.components.fan] Setting up fan.philips_airpurifier_coap
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.philips_airpurifier_coap
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.components.switch] Setting up switch.philips_airpurifier_coap
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.components.light] Setting up light.philips_airpurifier_coap
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.components.select] Setting up select.philips_airpurifier_coap
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new fan.philips_airpurifier_coap entity: fan.my_device
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.philips_airpurifier_coap entity: sensor.my_device_air_quality_index
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.philips_airpurifier_coap entity: sensor.my_device_indoor_allergen_index
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.philips_airpurifier_coap entity: sensor.my_device_pm2_5
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.philips_airpurifier_coap entity: sensor.my_device_total_volatile_organic_compounds
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.philips_airpurifier_coap entity: sensor.my_device_filter_pre
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.philips_airpurifier_coap entity: sensor.my_device_filter_hepa
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.philips_airpurifier_coap entity: sensor.my_device_filter_active_carbon
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.philips_airpurifier_coap entity: light.my_device_display_backlight
2022-05-30 13:24:47 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.philips_airpurifier_coap entity: light.my_device_light_brightness
Then I restarted home assistant and same issue occurs....
2022-05-30 13:44:54 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] async_step_dhcp: called, found: DhcpServiceInfo(ip='192.168.1.74', hostname='airpurifierbeneden', macaddress='047863d848e8')
2022-05-30 13:44:54 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] trying to configure host: 192.168.1.74
2022-05-30 13:44:54 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] got a valid client for host 192.168.1.74
2022-05-30 13:44:54 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] trying to get status
**2022-05-30 13:45:24 WARNING (MainThread) [custom_components.philips_airpurifier_coap.config_flow] Timeout, host 192.168.1.74 looks like a Philips AirPurifier but doesn't answer, aborting**
2022-05-30 13:47:30 INFO (MainThread) [custom_components.philips_airpurifier_coap.timer] Calling timeout callback...
After Two minutes HA finaly starts after the timeout and the device status in unavailable.
If i just start the App on my iphone (airmatters) then the device directly reponse and the device in HA is suddenly available.
The workaround is to start the App on my Iphone. As soon as it sees the Airpurifier the device also responses back to Home assistant.
I Also see this in the loggin this morning:
2022-05-31 08:59:17 INFO (MainThread) [homeassistant.components.websocket_api.http.connection] [547142263808] Connection closed by client
2022-05-31 09:00:26 INFO (MainThread) [custom_components.philips_airpurifier_coap.timer] Calling timeout callback...
2022-05-31 09:00:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.philips] reconnect: called for host AirPurifierBeneden.fritz.box
2022-05-31 09:00:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.philips] reconnect: cancelling reconnect task for host AirPurifierBeneden.fritz.box
2022-05-31 09:00:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.philips] reconnect: creating new reconnect task for host AirPurifierBeneden.fritz.box
2022-05-31 09:00:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.timer] Timeout callback finished!
2022-05-31 09:00:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.timer] Starting Timer 180s.
2022-05-31 09:00:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.philips] Reconnecting...
2022-05-31 09:00:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.timer] Timer cancelled: ('RESET',)
2022-05-31 09:00:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.timer] Starting Timer 180s.
2022-05-31 09:03:26 INFO (MainThread) [custom_components.philips_airpurifier_coap.timer] Calling timeout callback...
2022-05-31 09:03:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.philips] reconnect: called for host AirPurifierBeneden.fritz.box
2022-05-31 09:03:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.philips] reconnect: cancelling reconnect task for host AirPurifierBeneden.fritz.box
2022-05-31 09:03:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.philips] reconnect: creating new reconnect task for host AirPurifierBeneden.fritz.box
2022-05-31 09:03:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.timer] Timeout callback finished!
2022-05-31 09:03:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.timer] Starting Timer 180s.
2022-05-31 09:03:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.philips] Reconnecting...
2022-05-31 09:03:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.timer] Timer cancelled: ('RESET',)
2022-05-31 09:03:26 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.timer] Starting Timer 180s.
I can Control the Airpurifier with Home Assistant. The logging says every few minutes timeout callback reconnecting etc.
is this supposed to happen?
Grtz Alexander
The first log (two posts up) shows how the integration sets up itself. What is irritating is, that you first get a timeout but then still see how the entities are all setup. So I assume, it times out but then still gets a connection to the device. Otherwise, it wouldn't go into the setup mode.
The seond log (two posts up) shows how the system discovers your device through autodiscovery (DHCP). But then the device fails to respond for a status call, so then it aborts. That doesn't matter as you already configured the same device manually before. It would have aborted anyhow as it cannot configure the same device twice.
The third log (one post up) shows the timer cycle. When the integration realizes that the device becomes unresponsive, it stops the current "dialogue" and resets itself to start a new "conversation" with the device. That happens every 180s of not being able to talk to the device. So that is totally normal and for some people it helps to get the connection back.
Overall, I feel you have the connectivity problem that so many of us have (including myself). It's just not stable and I have no idea how to fix that. That's why I'll close this issue.