1 """The component for STIEBEL ELTRON heat pumps with ISGWeb Modbus module."""
3 from datetime
import timedelta
6 from pystiebeleltron
import pystiebeleltron
7 import voluptuous
as vol
17 DEFAULT_HUB =
"modbus_hub"
18 MODBUS_DOMAIN =
"modbus"
19 DOMAIN =
"stiebel_eltron"
21 CONFIG_SCHEMA = vol.Schema(
25 vol.Optional(CONF_NAME, default=DEVICE_DEFAULT_NAME): cv.string,
26 vol.Optional(CONF_HUB, default=DEFAULT_HUB): cv.string,
30 extra=vol.ALLOW_EXTRA,
33 _LOGGER = logging.getLogger(__name__)
38 def setup(hass: HomeAssistant, config: ConfigType) -> bool:
39 """Set up the STIEBEL ELTRON unit.
41 Will automatically load climate platform.
43 name = config[DOMAIN][CONF_NAME]
44 modbus_client = hass.data[MODBUS_DOMAIN][config[DOMAIN][CONF_HUB]]
51 discovery.load_platform(hass, Platform.CLIMATE, DOMAIN, {}, config)
56 """Get the latest data and update the states."""
59 """Init the STIEBEL ELTRON data object."""
61 self.
apiapi = pystiebeleltron.StiebelEltronAPI(modbus_client, 1)
63 @Throttle(MIN_TIME_BETWEEN_UPDATES)
65 """Update unit data."""
67 _LOGGER.warning(
"Modbus read failed")
69 _LOGGER.debug(
"Data updated successfully")
def __init__(self, name, modbus_client)
bool setup(HomeAssistant hass, ConfigType config)