diff --git a/homeassistant/components/trend/binary_sensor.py b/homeassistant/components/trend/binary_sensor.py index fe3d10ab72c..2b1ae0e083a 100644 --- a/homeassistant/components/trend/binary_sensor.py +++ b/homeassistant/components/trend/binary_sensor.py @@ -10,7 +10,7 @@ from homeassistant.components.binary_sensor import ( BinarySensorDevice) from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, CONF_DEVICE_CLASS, CONF_ENTITY_ID, - CONF_FRIENDLY_NAME, STATE_UNKNOWN, CONF_SENSORS) + CONF_FRIENDLY_NAME, STATE_UNKNOWN, STATE_UNAVAILABLE, CONF_SENSORS) from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import generate_entity_id @@ -140,7 +140,7 @@ class SensorTrend(BinarySensorDevice): state = new_state.attributes.get(self._attribute) else: state = new_state.state - if state != STATE_UNKNOWN: + if state not in (STATE_UNKNOWN, STATE_UNAVAILABLE): sample = (utcnow().timestamp(), float(state)) self.samples.append(sample) self.async_schedule_update_ha_state(True)