I’m building an Lennox 30 integration. I have the PyPI api developed and working and am now creating an integration. This is my first integration with HA and I’m working up the learning curve. I tried starting with the wizard, but it created too much stuff to get my head around…so i’ve started from a blank project…in order to understand each piece in detail.
I’m pretty sure I’m missing something here.
Right now I am getting this error.
The lennoxs30 platform for the climate integration does not support platform setup. Please remove it from your config
I copied this pattern from example-custom-config/custom_components/example_load_platform at master · home-assistant/example-custom-config (github.com)
2021-06-03 13:54:43 INFO (MainThread) [homeassistant.components.lennoxs30.s30api_async] Request Data - Enter
2021-06-03 13:54:43 INFO (MainThread) [homeassistant.components.lennoxs30.s30api_async] Updating lennox_zone id [0] name [Zone 1]
2021-06-03 13:54:43 DEBUG (MainThread) [homeassistant.components.lennoxs30.s30api_async] lennox_zone id [0] name [Zone 1] temperature [67] humidity [50]
2021-06-03 13:54:43 INFO (MainThread) [homeassistant.components.lennoxs30.s30api_async] Creating lennox_zone id [0] name [Zone 1]
2021-06-03 13:54:43 INFO (MainThread) [homeassistant.components.lennoxs30.s30api_async] Updating lennox_zone id [1] name [Zone 2]
2021-06-03 13:54:43 DEBUG (MainThread) [homeassistant.components.lennoxs30.s30api_async] lennox_zone id [1] name [Zone 2] temperature [None] humidity [None]
2021-06-03 13:54:43 INFO (MainThread) [homeassistant.components.lennoxs30.s30api_async] Creating lennox_zone id [1] name [Zone 2]
2021-06-03 13:54:43 INFO (MainThread) [homeassistant.components.lennoxs30.s30api_async] Updating lennox_zone id [2] name [Zone 3]
2021-06-03 13:54:43 DEBUG (MainThread) [homeassistant.components.lennoxs30.s30api_async] lennox_zone id [2] name [Zone 3] temperature [None] humidity [None]
2021-06-03 13:54:43 INFO (MainThread) [homeassistant.components.lennoxs30.s30api_async] Creating lennox_zone id [2] name [Zone 3]
2021-06-03 13:54:43 INFO (MainThread) [homeassistant.components.lennoxs30.s30api_async] Updating lennox_zone id [3] name [Zone 4]
2021-06-03 13:54:43 DEBUG (MainThread) [homeassistant.components.lennoxs30.s30api_async] lennox_zone id [3] name [Zone 4] temperature [None] humidity [None]
2021-06-03 13:54:43 INFO (MainThread) [homeassistant.components.lennoxs30.s30api_async] Creating lennox_zone id [3] name [Zone 4]
2021-06-03 13:54:44 INFO (MainThread) [homeassistant.setup] Setup of domain lennoxs30 took 3.3 seconds
2021-06-03 13:54:44 INFO (SyncWorker_3) [homeassistant.loader] Loaded climate from homeassistant.components.climate
2021-06-03 13:54:44 INFO (MainThread) [homeassistant.setup] Setting up climate
2021-06-03 13:54:44 INFO (MainThread) [homeassistant.setup] Setup of domain climate took 0.0 seconds
2021-06-03 13:54:44 ERROR (MainThread) [homeassistant.components.climate] The lennoxs30 platform for the climate integration does not support platform setup. Please remove it from your config.
2021-06-03 13:54:44 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 3.78s
2021-06-03 13:54:44 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2021-06-03 13:54:44 INFO (MainThread) [homeassistant.core] Timer:starting
In my init.py file; I have the following code which works. This connects to the Lennox API and gets the list of Zones (e.g. climate) entities.
DOMAIN = "lennoxs30"
#
_LOGGER = logging.getLogger(__name__)
async def async_setup(hass, config):
hass.states.async_set("lennox30.state", "Running")
print("async_setup config [" + str(config) + "]")
email = config.get(DOMAIN).get(CONF_EMAIL)
password = config.get(DOMAIN).get(CONF_PASSWORD)
print("email [" +str(email) + "] password [" + str(password) + "]")
s30api = s30api_async.s30api_async(email, password, 0, 0, 0,9)
if await s30api.serverConnect() == False:
print("Connection Failed")
return False
for lsystem in s30api.getSystems():
if await s30api.subscribe(lsystem) == False:
print("Data Subscription Failed lsystem [" + str(lsystem) + "]")
return False
count = 0
while (count == 0):
await s30api.retrieve()
for lsystem in s30api.getSystems():
for zone in lsystem.getZoneList():
count += 1
await asyncio.sleep(1)
hass.helpers.discovery.load_platform('climate', DOMAIN, {}, config)
return True
The climate.py file
import logging
DOMAIN = "lennoxs30"
_LOGGER = logging.getLogger(__name__)
#def setup(hass, config):
# print("setup")
# return True
from homeassistant.const import (CONF_EMAIL, CONF_PASSWORD)
def setup_plaform(hass, config, add_entities, discovery_info=None):
print("setup climate.py")
return True
async def async_setup_plaform(hass, config, add_entities, discovery_info=None):
print("setup climate.py")
return True