yes I did rename the components and restart HA
I’m thinking it has something to do with the imports in my custom_component, but no clue
(cfr 0.92: HEOS, Somfy MyLink, Genius Hub)
import asyncio
import logging
import datetime as dt
import homeassistant.components.mqtt as mqtt
import homeassistant.helpers.config_validation as cv
from homeassistant.core import callback
from homeassistant.exceptions import TemplateError
from homeassistant.components.cover import (
CoverDevice,
SUPPORT_OPEN, SUPPORT_CLOSE, SUPPORT_STOP,
SUPPORT_SET_POSITION, ATTR_POSITION)
from homeassistant.const import (
CONF_NAME, CONF_VALUE_TEMPLATE, CONF_OPTIMISTIC, STATE_OPEN,
STATE_CLOSED, STATE_UNKNOWN)
from homeassistant.components.mqtt import (
CONF_STATE_TOPIC, CONF_COMMAND_TOPIC, CONF_QOS, CONF_RETAIN,
valid_publish_topic, valid_subscribe_topic)
from homeassistant.components.cover import (ATTR_CURRENT_POSITION, STATE_CLOSED, STATE_OPEN, STATE_UNKNOWN, STATE_OPENING)
#INFO: We want to do some logging. This means that we import the Python logging module and create an alias.
_LOGGER = logging.getLogger(name)
#INFO: keys for the variabels in configuration.yaml
CFG_MQTT_TOPIC = ‘domotica/qbus/shutter’
CFG_YML_HA_NAME = ‘name’
CFG_YML_QBUS_NAME = ‘name_qbus’
#SUPPORT_SET_POSITION
OPEN_CLOSE_FEATURES = (SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP | SUPPORT_SET_POSITION)
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
“”“Set up the Qbus Cover/shutter.”""
_LOGGER.info(“COVER .::. The ‘qbus_cover’ ASYNC platform is starting!”)
async_add_devices([QbusCover(CoverDevice, hass, config)])
_LOGGER.info("COVER .::. The ‘qbus_sensor’ ASYNC platform has finished! ")
return True
class QbusCover(CoverDevice):
“”“Representation of a qbus cover/shutter”""
def init(self, Cover, hass, config):
“”“Initialize QBUS cover/shutter light.”""
_LOGGER.info(“COVER .::. init - begin”)
self._name = config.get(CFG_YML_HA_NAME)
_LOGGER.info("COVER .::. init - name: " + self._name)
self._entity_id = ‘cover.’ + self._name
self._name_qbus = (config.get(CFG_YML_QBUS_NAME) + "").replace(" ", "_")
self._mqtt_topic_event = CFG_MQTT_TOPIC_COVER + "/event/" + self._name_qbus + "/status"
self._mqtt_topic_sync = CFG_MQTT_TOPIC_COVER + "/sync/" + self._name_qbus + "/status"
self._mqtt_topic_command = CFG_MQTT_TOPIC_COVER + "/command/" + self._name_qbus
#self._optimistic = True
self._feature_position = True
self._busy = False #deel 1 - zonder positie, bijhouden dat open/close is ingezet dan bij STOP definitief maken
self._qos = 0
self._retain = False
#een beetje autoconfig tijdens ontwikkeling
if (dt.datetime.today().hour > 21) or (dt.datetime.today().hour < 8):
#init at night
self._state = True
self._position = 0
else:
#init during the day
self._state = False
self._position = 100 #tss 0 en 100 --- 100 = rolluik beneden #standaard dus open
_LOGGER.info("COVER .::. __init__ - start position : " + str(self._position) + " @ " + str(dt.datetime.today().hour))
_LOGGER.info("COVER .::. __init__ - end")