home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.7k stars 30.82k forks source link

Yolink Sensors becoming "Unavailable" very often #100489

Closed KruseLuds closed 1 year ago

KruseLuds commented 1 year ago

The problem

I have pasted below an automation which does not resolve the issue but does help - and it also explains the problem.

As a related item, I have also found many times when I try to turn on a Yolink relay (connected to fluorescent light tube fixtures in my basement for example), very often I have to try two or three times to turn them on and calls to do so from the Home Assistant dashboard results in a few error messages - until they actually 'wake up' and do work. I have noticed also in the Yolink app, some of those same sensors appear "offline" and this also seems to resolve that issue.

In addition to the below automation, for instances where the sensor still stays "unavailable" I have noticed that reloading the integration in HA will also help sometimes (but I believe that is also a separate issue related to the integration itself).

So - here is the automation I am using for a workaround which runs anywhere from 2-3 tikmes per hour - which I would prefer to delete or disable as soon as possible. (The outlet is actually a kasa power outlet which is meant for lights only but in this case works fine, the 'toggle' does not cut the power long enough - so it is actually turned off, then wait 2 seconds, then turn back on)

What version of Home Assistant Core has the issue?

core-2023.9.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Yolink

Link to integration documentation on our website

https://www.home-assistant.io/integrations/yolink/

Diagnostics information

Let me know what else you might need - here is a grepped version of my syslog showing how often this was fired off since I wrote the automation last night. Also note, I am still getting the MQTT disconnected error, which complicates the issue as well (but does not solve the issue as this issue has been a problem for a long time) -

Sep 15 21:55:54 kruse-pi homeassistant[813]: #033[31m2023-09-15 21:55:54.325 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 21:56:49 kruse-pi homeassistant[813]: #033[31m2023-09-15 21:56:49.520 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 22:08:27 kruse-pi homeassistant[813]: #033[32m2023-09-15 22:08:27.809 INFO (MainThread) [homeassistant.components.yolink.coordinator] Fetching yolink data recovered#033[0m Sep 15 22:12:44 kruse-pi homeassistant[813]: #033[32m2023-09-15 22:12:44.005 INFO (MainThread) [homeassistant.components.yolink.coordinator] Fetching yolink data recovered#033[0m Sep 15 22:24:38 kruse-pi homeassistant[813]: #033[32m2023-09-15 22:24:38.319 INFO (MainThread) [homeassistant.components.yolink.coordinator] Fetching yolink data recovered#033[0m Sep 15 22:27:46 kruse-pi homeassistant[813]: #033[31m2023-09-15 22:27:46.647 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Timeout fetching yolink data#033[0m Sep 15 22:27:46 kruse-pi homeassistant[813]: #033[32m2023-09-15 22:27:46.662 INFO (MainThread) [homeassistant.components.automation.yolink_hub_if_a_sensor_becomes_unavailable_and_not_done_within_the_last_10_minutes_bounce_the_power_to_the_hub] Yolink Hub -> If ANY Sensor becomes unavailable AND not done within the last 10 minutes -> Bounce the Power to the Hub: Running automation actions#033[0m Sep 15 22:27:48 kruse-pi homeassistant[813]: #033[32m2023-09-15 22:27:48.682 INFO (MainThread) [homeassistant.components.automation.yolink_hub_if_a_sensor_becomes_unavailable_and_not_done_within_the_last_10_minutes_bounce_the_power_to_the_hub] Yolink Hub -> If ANY Sensor becomes unavailable AND not done within the last 10 minutes -> Bounce the Power to the Hub: Executing step call service#033[0m Sep 15 22:28:37 kruse-pi homeassistant[813]: #033[31m2023-09-15 22:28:37.028 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 22:30:22 kruse-pi homeassistant[813]: #033[31m2023-09-15 22:30:22.292 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 22:44:38 kruse-pi homeassistant[813]: #033[31m2023-09-15 22:44:38.894 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 22:45:34 kruse-pi homeassistant[813]: #033[31m2023-09-15 22:45:34.203 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 22:47:52 kruse-pi homeassistant[813]: #033[31m2023-09-15 22:47:52.647 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Timeout fetching yolink data#033[0m Sep 15 22:47:52 kruse-pi homeassistant[813]: #033[32m2023-09-15 22:47:52.693 INFO (MainThread) [homeassistant.components.automation.yolink_hub_if_a_sensor_becomes_unavailable_and_not_done_within_the_last_10_minutes_bounce_the_power_to_the_hub] Yolink Hub -> If ANY Sensor becomes unavailable AND not done within the last 10 minutes -> Bounce the Power to the Hub: Executing step delay 0:00:02#033[0m Sep 15 22:47:54 kruse-pi homeassistant[813]: #033[32m2023-09-15 22:47:54.695 INFO (MainThread) [homeassistant.components.automation.yolink_hub_if_a_sensor_becomes_unavailable_and_not_done_within_the_last_10_minutes_bounce_the_power_to_the_hub] Yolink Hub -> If ANY Sensor becomes unavailable AND not done within the last 10 minutes -> Bounce the Power to the Hub: Executing step call service#033[0m Sep 15 22:49:13 kruse-pi homeassistant[813]: #033[31m2023-09-15 22:49:13.647 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Timeout fetching yolink data#033[0m Sep 15 22:49:17 kruse-pi homeassistant[813]: #033[31m2023-09-15 22:49:17.625 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 22:50:12 kruse-pi homeassistant[813]: #033[31m2023-09-15 22:50:12.838 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 22:57:47 kruse-pi homeassistant[813]: #033[32m2023-09-15 22:57:47.137 INFO (MainThread) [homeassistant.components.yolink.coordinator] Fetching yolink data recovered#033[0m Sep 15 23:23:41 kruse-pi homeassistant[813]: #033[31m2023-09-15 23:23:41.060 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 23:26:16 kruse-pi homeassistant[813]: #033[31m2023-09-15 23:26:16.354 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 23:33:01 kruse-pi homeassistant[813]: #033[31m2023-09-15 23:33:01.933 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 23:34:47 kruse-pi homeassistant[813]: #033[31m2023-09-15 23:34:47.222 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 23:38:12 kruse-pi homeassistant[813]: #033[31m2023-09-15 23:38:12.625 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 15 23:39:21 kruse-pi homeassistant[813]: #033[31m2023-09-15 23:39:21.738 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Error fetching yolink data: #033[0m Sep 15 23:39:21 kruse-pi homeassistant[813]: #033[31m2023-09-15 23:39:21.754 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Error fetching yolink data: #033[0m Sep 15 23:39:21 kruse-pi homeassistant[813]: #033[32m2023-09-15 23:39:21.800 INFO (MainThread) [homeassistant.components.automation.yolink_hub_if_a_sensor_becomes_unavailable_and_not_done_within_the_last_10_minutes_bounce_the_power_to_the_hub] Yolink Hub -> If ANY Sensor becomes unavailable AND not done within the last 10 minutes -> Bounce the Power to the Hub: Executing step delay 0:00:02#033[0m Sep 15 23:39:58 kruse-pi homeassistant[813]: #033[31m2023-09-15 23:39:58.168 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m

I had to truncate this as the comment is too long to save -

Sep 16 10:30:09 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:30:09.055 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Error fetching yolink data: #033[0m Sep 16 10:30:51 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:30:51.195 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 16 10:31:46 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:31:46.433 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m

At 10:32:40 the trace shows this triggered the below:

platform: state entity_id:

Sep 16 10:32:40 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:32:40.647 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Timeout fetching yolink data#033[0m Sep 16 10:32:40 kruse-pi homeassistant[813]: #033[32m2023-09-16 10:32:40.670 INFO (MainThread) [homeassistant.components.automation.yolink_hub_if_a_sensor_becomes_unavailable_and_not_done_within_the_last_10_minutes_bounce_the_power_to_the_hub] Yolink Hub -> If ANY Sensor becomes unavailable AND not done within the last 10 minutes -> Bounce the Power to the Hub: Running automation actions#033[0m Sep 16 10:35:32 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:35:32.973 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Error fetching yolink data: #033[0m Sep 16 10:35:32 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:35:32.988 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Error fetching yolink data: #033[0m Sep 16 10:35:32 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:35:32.994 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Error fetching yolink data: #033[0m

At 10:35:33 the trace shows this triggered the below:

platform: state entity_id:

Sep 16 10:35:33 kruse-pi homeassistant[813]: #033[32m2023-09-16 10:35:33.026 INFO (MainThread) [homeassistant.components.automation.yolink_hub_if_a_sensor_becomes_unavailable_and_not_done_within_the_last_10_minutes_bounce_the_power_to_the_hub] Yolink Hub -> If ANY Sensor becomes unavailable AND not done within the last 10 minutes -> Bounce the Power to the Hub: Running automation actions#033[0m Sep 16 10:36:07 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:36:07.154 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 16 10:37:02 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:37:02.395 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m

Note at 10:38:22, the trace information shows:

"platform: state entity_id:

Sep 16 10:38:22 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:38:22.646 ERROR (MainThread) [homeassistant.components.yolink.coordinator] Timeout fetching yolink data#033[0m Sep 16 10:38:22 kruse-pi homeassistant[813]: #033[32m2023-09-16 10:38:22.669 INFO (MainThread) [homeassistant.components.automation.yolink_hub_if_a_sensor_becomes_unavailable_and_not_done_within_the_last_10_minutes_bounce_the_power_to_the_hub] Yolink Hub -> If ANY Sensor becomes unavailable AND not done within the last 10 minutes -> Bounce the Power to the Hub: Running automation actions#033[0m Sep 16 10:38:28 kruse-pi homeassistant[813]: #033[32m2023-09-16 10:38:28.045 INFO (MainThread) [homeassistant.components.yolink.coordinator] Fetching yolink data recovered#033[0m Sep 16 10:39:37 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:39:37.775 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 16 10:40:33 kruse-pi homeassistant[813]: #033[31m2023-09-16 10:40:33.585 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m pi@kruse-pi:~$

Example YAML snippet

Here is the code for the automation:

alias: >-
  Yolink Hub -> If ANY Sensor becomes unavailable AND if not done within the last
  10 minutes -> Bounce the Power to the Hub
description: >-
  If any Yolink Sensor becomes unavailable (or unknown), then shut off the power
  to the hub, wait 2 seconds, and restore power to the hub. Not always, but the
  majority of the time, this resolves the issue of various sensors becoming
  "unavailable" or "unkown". This should be only a temporary workaround, due to
  events from some sensors being missed if they are taking place at the same
  exact time the hub has to reboot. (As of 9/16/2023 with 65 sensors, this
  happens 2-3 times per hour.)
trigger:
  - platform: state
    entity_id:
      - binary_sensor.basement_door_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.basement_door_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.den_back_door_sensor_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.den_back_door_sensor_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.den_window_1_side_by_closet_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.den_window_1_side_by_closet_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.den_window_2_side_by_driveway_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.den_window_2_side_by_driveway_state
    to: uknown
  - platform: state
    entity_id:
      - binary_sensor.den_window_3_front_by_driveway_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.den_window_3_front_by_driveway_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.den_window_4_by_front_door_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.den_window_4_by_front_door_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.dining_room_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.dining_room_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.floor_behind_downstairs_toilet_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.floor_behind_downstairs_toilet_leak
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.floor_behind_upstairs_toilet_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.floor_behind_upstairs_toilet_leak
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.front_door_sensor_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.front_door_sensor_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.kitchen_window_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.kitchen_window_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.mailbox_bottom_door_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.mailbox_bottom_door_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.mailbox_top_door_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.mailbox_top_door_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.sump_drain_pipe_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.sump_drain_pipe_leak
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.under_kitchen_sink_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.under_kitchen_sink_leak
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.under_powder_room_sink_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.under_powder_room_sink_leak
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.under_tub_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.under_tub_leak
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.under_upstairs_sink_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.under_upstairs_sink_leak
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.washer_dryer_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.washer_dryer_leak
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.furnace_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.furnace_leak
    to: unkown
  - platform: state
    entity_id:
      - binary_sensor.water_heater_leak
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.water_heater_leak
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.living_room_sliding_glass_door
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.living_room_sliding_glass_door
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.basement_window_1_vibration
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.basement_window_1_vibration
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.master_bedroom_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.master_bedroom_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.den_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.den_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.basement_by_desk_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.basement_by_desk_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.basement_laundry_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.basement_laundry_motion_sensor_motion
    to: unkown
  - platform: state
    entity_id:
      - binary_sensor.living_room_motion_sensor_2_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.living_room_motion_sensor_2_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.living_room_motion_sensor_1_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.living_room_motion_sensor_1_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.basement_furnace_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.basement_furnace_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.basement_stairs_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.basement_stairs_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.kitchen_motion_sensor_motion_2
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.kitchen_motion_sensor_motion_2
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bedroom_2_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bedroom_2_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bedroom_3_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bedroom_3_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.hallway_upper_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.hallway_upper_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.dining_room_motion_sensor_2_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.dining_room_motion_sensor_2_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.kitchen_shelf_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.kitchen_shelf_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.powder_room_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.powder_room_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.powder_room_door_sensor_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.powder_room_door_sensor_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.master_bedroom_side_window_sensor_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.master_bedroom_side_window_sensor_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.living_room_side_window_sensor_back_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.living_room_side_window_sensor_back_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.living_room_side_window_sensor_front_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.living_room_side_window_sensor_front_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.garage_door_sensor_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.garage_door_sensor_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bathroom_door_sensor_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bathroom_door_sensor_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.dng_rm_window_by_door_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.dng_rm_window_by_door_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.dng_rm_wndw_front_corner_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.dng_rm_wndw_front_corner_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.lvng_rm_window_by_front_crnr_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.lvng_rm_window_by_front_crnr_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bathroom_motion_sensor_motion
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bathroom_motion_sensor_motion
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.lvng_rm_wndw_by_front_door_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.lvng_rm_wndw_by_front_door_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bedroom_2_front_window_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bedroom_2_front_window_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bedroom_2_side_window_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bedroom_2_side_window_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bedroom_3_side_window_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bedroom_3_side_window_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.master_bedroom_front_window_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.master_bedroom_front_window_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.mud_room_storm_door_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.mud_room_storm_door_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bedroom_3_back_window_state
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bedroom_3_back_window_state
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.1stflrstairs_smoke_co_alarm_co_detected
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.1stflrstairs_smoke_co_alarm_co_detected
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.1stflrstairs_smoke_co_alarm_smoke_detected
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.1stflrstairs_smoke_co_alarm_smoke_detected
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.2ndflrstairs_smoke_co_alarm_co_detected
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.2ndflrstairs_smoke_co_alarm_co_detected
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.2ndflrstairs_smoke_co_alarm_smoke_detected
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.2ndflrstairs_smoke_co_alarm_smoke_detected
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bsmt_lndry_smoke_co_alarm_co_detected
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bsmt_lndry_smoke_co_alarm_co_detected
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bsmt_lndry_smoke_co_alarm_smoke_detected
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bsmt_lndry_smoke_co_alarm_smoke_detected
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bsmt_steps_smoke_co_alarm_co_detected
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bsmt_steps_smoke_co_alarm_co_detected
    to: unknown
  - platform: state
    entity_id:
      - binary_sensor.bsmt_steps_smoke_co_alarm_smoke_detected
    to: unavailable
  - platform: state
    entity_id:
      - binary_sensor.bsmt_steps_smoke_co_alarm_smoke_detected
    to: unknown
condition:
  - condition: template
    value_template: >-
      {{ (float(as_timestamp(now())) -
      float(states('input_text.latest_yolink_hub_power_bounce'),0)) > 600 }}
action:
  - service: input_text.set_value
    data:
      value: |-
        service: input_text.set_value data:   value: >-     {{    
          as_timestamp(now())
        }} target:   entity_id: input_text.latest_yolink_hub_power_bounce
    target:
      entity_id: input_text.latest_yolink_hub_power_bounce
  - service: light.turn_off
    data: {}
    target:
      entity_id: light.basement_yolink_hub_power_supply
    enabled: true
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: light.turn_on
    data:
      brightness_pct: 100
    target:
      entity_id: light.basement_yolink_hub_power_supply
    enabled: true
mode: single

Anything in the logs that might be useful for us?

Already provided above

Additional information

I have written code in that automation to only be fired off once every 10 minutes at the most. Ihave a slight bug in that, with regards to the timestamp that compared the current time to the time put into an input_text the last time the automaiton was run - so it does run more than once evey 10 minutes.

Since the automation is set as "single" mode and as it does not currently run a bunch of times endlessly withi the same few moments, I have decided to not try to fix that timestamp bug as the only result from keeping that piece of logic working would be to leave sensors as "unavailable" or "uknown" longer.

Please fix this as soon as possible (along with the mqtt bug) as this was to be used as an alarm system and has to be 100% reliable - and due tothat I am considering throwin in the towel on this because it doesn't have the reliability needed.

home-assistant[bot] commented 1 year ago

Hey there @matrixd2, mind taking a look at this issue as it has been labeled with an integration (yolink) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `yolink` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign yolink` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


yolink documentation yolink source (message by IssueLinks)

matrixd2 commented 1 year ago

@KruseLuds Can i dm you on yolink discord, I need to confirm some information.

KruseLuds commented 1 year ago

Yes please do so!

KruseLuds commented 1 year ago

FYI, I simplified the code to:

(In configuration.yaml):

`template:

And now the yaml for the automation is only - (the entry_id (not entity_id) for the yolink integration is found in /usr/share/hassio/homeassistant/.storage/core.config.entries):

`alias: >- Yolink Hub -> If ANY Sensor becomes unavailable or unknown anbd this automation was not run within the last 10 minutes -> Turn off the Power to the Hub, Wait 2 seconds, Turn the Hub power back on, Wait 5 seconds, then reload the Yolink Integration description: >- If any Yolink Sensor becomes unavailable (or unknown), then shut off the power to the hub, wait 2 seconds, and restore power to the hub. Not always, but the majority of the time, this resolves the issue of various sensors becoming "unavailable" or "unkown". Then reloading the integration usually takes care of any other issues, hopefully, no automatio=ns need to be run at the exact time this script is running... trigger:

But the above still doesn't resolve the recurring MQTT disconnect issues... as the below is part of the output from issuing this command:

pi@kruse-pi:~$ sudo cat /.../syslog | grep "yolink"

Sep 19 16:06:59 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:06:59.154 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:07:54 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:07:54.747 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:09:40 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:09:40.200 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:09:50 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:09:50.210 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:10:00 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:10:00.218 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:10:55 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:10:55.530 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:35:12 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:35:12.967 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:38:38 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:38:38.376 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:42:54 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:42:54.005 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:50:30 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:50:30.279 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 16:52:16 kruse-pi homeassistant[750]: #033[31m2023-09-19 16:52:16.294 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m Sep 19 17:04:02 kruse-pi homeassistant[750]: #033[31m2023-09-19 17:04:02.668 ERROR (MainThread) [yolink.mqtt_client] yolink mqtt client disconnected!#033[0m pi@kruse-pi:~$

KruseLuds commented 1 year ago

This I believe is a duplicate of 99845.