I’m testing version 0.94.2, specifically its ability to use a custom_component and failing to succeed.
For this experiment, I’m just using a copy of the existing MQTT HVAC climate.py
file. In other words, I’m using the stock 0.94.2 version of climate.py
, not a customized version of it, and just putting a copy of it in custom_component/whatever
directory.
In the directory custom_component/whatever/
there are two files:
climate.py
manifest.json
The contents of manifest.json
:
{
"domain": "whatever",
"name": "Whatever",
"documentation": "https://www.home-assistant.io/components/climate.mqtt/",
"dependencies": [],
"codeowners": [],
"requirements": []
}
Theoretically, all this does is define a new platform called whatever
containing one climate component (that is a verbatim copy from the MQTT platform).
In the config file I’ve defined a climate entity and configured it as you normally would if it were using the MQTT platform.
climate:
- platform: whatever
name: "Dummy"
qos: 0
payload_on: 1
payload_off: 0
modes:
- auto
- heat
- cool
- 'off'
... etc etc ...
In theory, 0.94.2 should load the custom_component whatever
and then create an entity called climate.dummy
based on the whatever
platform.
It reports it loads the custom component:
You are using a custom integration for whatever which has not been tested by Home Assistant.
However, it fails to actually use it to create the climate entity. Either I’ve misunderstood how this is supposed to work or I’ve overlooked a critical detail.
When I restart Home Assistant, it logs an error message indicating:
Platform not found: climate.whatever
Running Config Check reports the same error:
Just for fun, I added a blank __init__.py
file to the whatever
directory but that didn’t help.
What am I doing wrong?
NOTE
The interesting thing is if I put my customized MQTT HVAC climate.py
file, which is based on code from version 0.89, into the whatever
directory, it works perfectly.
The reason I’m not using the 0.89 code with 0.94 is because it contains some deprecated MQTT code. I get warning messages in the log reminding me the code is deprecated (some of the functions use a new signature). So I need to update it. However, so far I can’t even get the stock 0.94 climate.py
to be handled as a custom component.