MyHOME icon indicating copy to clipboard operation
MyHOME copied to clipboard

MYHOME stops to update data.

Open fab-70 opened this issue 4 years ago • 3 comments

Hi all periodically (few times a week) the integration stops to update data... below the log of the error. Then i need to restart HA and all works properly. I suppose this is a bug. If this is due to my system, Is there a way to capture this event and automatically restart HA / MYHOME integration? Many thanks for any feedback/suggestion.

Fabio

This error originated from a custom integration.

Logger: homeassistant Source: custom_components/myhome/config_flow.py:402 Integration: MyHome (documentation, issues) First occurred: 9:07:00 AM (2 occurrences) Last logged: 9:07:04 AM

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 230, in _async_init result = await self._async_handle_step(flow, flow.init_step, data, init_done) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/myhome/config_flow.py", line 402, in async_step_ssdp discovery_info["port"] = None TypeError: 'SsdpServiceInfo' object does not support item assignment

fab-70 avatar Jan 23 '22 11:01 fab-70

Also these logs should help to explain the problem:

Logger: custom_components.myhome Source: /usr/local/lib/python3.9/site-packages/OWNd/connection.py:584 Integration: MyHome (documentation, issues) First occurred: 9:06:27 AM (1 occurrences) Last logged: 9:06:27 AM Connection interrupted, reconnecting...

Logger: homeassistant.helpers.frame Source: helpers/frame.py:103 First occurred: 9:07:00 AM (1 occurrences) Last logged: 9:07:00 AM

Detected integration that accessed discovery_info.contains() instead of discovery_info.upnp.contains() or discovery_info.ssdp_headers.contains(); this will fail in version 2022.6. Please report issue to the custom component author for myhome using this method at custom_components/myhome/config_flow.py, line 401: if "port" not in discovery_info:

fab-70 avatar Jan 23 '22 11:01 fab-70

Screenshot_20220206_122746_io homeassistant companion android Same

1achy avatar Feb 06 '22 11:02 1achy

I managed adding a sensor calculating the seconds since last update of the energy sensor... I then restart HA if 'last_update_age' >300 Hope this helps

Fabio

sensor:

  • platform: myhome devices: sensor_energia_51: where: '51' name: Energia 51 class: power manufacturer: bticino model: F52X
  • platform: template #additional sensor to manage disconnection of MyHome intergration sensors: last_update_age: friendly_name: "Time since last update" value_template: "{{ (now() - states.sensor.energia_51_power.last_updated).total_seconds() | round(0) }}" unit_of_measurement: "Seconds"

fab-70 avatar Feb 06 '22 11:02 fab-70