From 9718a17351d005d55d71cfc9c71cdd981f453794 Mon Sep 17 00:00:00 2001 From: Daniel Perna Date: Mon, 15 Oct 2018 20:34:03 +0200 Subject: [PATCH] Fix HomeMatic availability detection (#17341) * Fix availability detection --- homeassistant/components/homematic/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/homematic/__init__.py b/homeassistant/components/homematic/__init__.py index c87e2926ae8..d723f1fab28 100644 --- a/homeassistant/components/homematic/__init__.py +++ b/homeassistant/components/homematic/__init__.py @@ -798,11 +798,8 @@ class HMDevice(Entity): has_changed = True # Availability has changed - if attribute == 'UNREACH': - self._available = not bool(value) - has_changed = True - elif not self.available: - self._available = False + if self.available != (not self._hmdevice.UNREACH): + self._available = not self._hmdevice.UNREACH has_changed = True # If it has changed data point, update HASS @@ -812,7 +809,6 @@ class HMDevice(Entity): def _subscribe_homematic_events(self): """Subscribe all required events to handle job.""" channels_to_sub = set() - channels_to_sub.add(0) # Add channel 0 for UNREACH # Push data to channels_to_sub from hmdevice metadata for metadata in (self._hmdevice.SENSORNODE, self._hmdevice.BINARYNODE,