hristo-atanasov / Tasmota-IRHVAC

Home Assistant platform for controlling IR Air Conditioners via Tasmota IRHVAC command and compatible hardware
200 stars 67 forks source link

Platform error climate.tasmota_irhvac - Exception importing custom_components.tasmota_irhvac.climate #76

Closed bogd closed 2 years ago

bogd commented 2 years ago

I am attempting to add the custom component to my Home Assistant installation, but when doing a config check I get the error: Platform error climate.tasmota_irhvac - Exception importing custom_components.tasmota_irhvac.climate

Steps I have performed:

However, when I do a YAML/Configuration Check from Home Assistant, I get the error above.

The full error in the logs is:

Logger: homeassistant.loader
Source: custom_components/tasmota_irhvac/climate.py:271
Integration: tasmota_irhvac ([documentation](https://github.com/hristo-atanasov/Tasmota-IRHVAC), [issues](https://github.com/hristo-atanasov/Tasmota-IRHVAC/issues))
First occurred: 3:53:05 PM (5 occurrences)
Last logged: 4:01:24 PM

Unexpected exception importing platform custom_components.tasmota_irhvac.climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 618, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 635, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/tasmota_irhvac/climate.py", line 271, in <module>
    PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(mqtt.MQTT_BASE_PLATFORM_SCHEMA.schema)
AttributeError: module 'homeassistant.components.mqtt' has no attribute 'MQTT_BASE_PLATFORM_SCHEMA'

I am running the most recent version of the HAss OVA:

Home Assistant Core 2022.6.1
Home Assistant Supervisor 2022.05.3
Home Assistant OS 8.1
Path to configuration.yaml: /config

What can I do to fix the issue and get the custom component working?

Thank you!

What can I do to troubleshoot this, and get the integration to work?

bogd commented 2 years ago

Since I see a reference to MQTT in the error, I have to clarify that I am running a separate MQTT server (separate machine, different from the HAss instance)

Kryoh-hash commented 2 years ago

Duplicate of #74

Ive changed the line 271 in climate.py according to the fix proposed and it worked.

bogd commented 2 years ago

Thank you! I did search for the error in the issues before posting, but somehow that particular issue didn't pop up.

I made the same change (manually, until the fix is merged), and I can confirm it works.

Thank you for the quick reply!!