hristo-atanasov / Tasmota-IRHVAC

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

Home Assistant 2022.6.1 - MQTT no attribute 'MQTT_BASE_PLATFORM_SCHEMA' #74

Closed Kryoh-hash closed 2 years ago

Kryoh-hash commented 2 years ago

Hi,

Since the latest update and the mqtt mess around with the new scheme, im getting this errors, and it doesnt load on my dashboard, i guess that some changes has to be made with the mqtt part in the component.

Logger: homeassistant.config
Source: loader.py:627
First occurred: 09:31:14 (3 occurrences)
Last logged: 09:31:14

Platform error: 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'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 877, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 627, in get_platform
    raise ImportError(
ImportError: Exception importing custom_components.tasmota_irhvac.climate
Logger: homeassistant.loader
Source: custom_components/tasmota_irhvac/climate.py:271
Integration: tasmota_irhvac (documentation, issues)
First occurred: 09:31:14 (3 occurrences)
Last logged: 09:31:14

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'

And this is what do i have on my configuration.yaml

# Daikin AC Tasmota IR_TransRec1 Control
climate:
  - platform: tasmota_irhvac
    name: Daikin Escritorio
    command_topic: cmnd/IR_TransRec1/irhvac
    state_topic: tele/IR_TransRec1/RESULT
    temperature_sensor: sensor.ble_temperature_termo_escritorio #optional this sensor is used to display current temp on the AC card
    protocol: DAIKIN
    min_temp: 16 #optional - default 16 int value
    max_temp: 30 #optional - default 32 int value
    target_temp: 26 #optional - default 26 int value
    initial_operation_mode: "off" # optional - default "off" string value
    away_temp: 24 #optional - default 24 int value
    precision: 1.0 #optional - default 1.0 float value
    supported_modes:
      - heat 
      - cool
      - dry
      - fan_only
      - auto
      - "off" #Turns the AC off - Should be quoted and should be always included here
    supported_fan_speeds:
      - low
      - max
      - medium
      - high
      - middle
      - focus
      - diffuse
      - min
      - auto
    supported_swing_list:
      - "off"
      - vertical #up to down
    hvac_model: "1" # string value
    celsius_mode: "On" #optional - default "On" string value - you can remove it if you use celsius

# Daikin AC Tasmota IR_TransRec2 Control
  - platform: tasmota_irhvac
    name: Daikin Quarto M.
    command_topic: cmnd/IR_TransRec2/irhvac
    state_topic: tele/IR_TransRec2/RESULT
    temperature_sensor: sensor.ble_temperature_termo_qmaria #optional this sensor is used to display current temp on the AC card
    protocol: DAIKIN
    min_temp: 16 #optional - default 16 int value
    max_temp: 30 #optional - default 32 int value
    target_temp: 26 #optional - default 26 int value
    initial_operation_mode: "off" # optional - default "off" string value
    away_temp: 24 #optional - default 24 int value
    precision: 1.0 #optional - default 1.0 float value
    supported_modes:
      - heat 
      - cool
      - dry
      - fan_only
      - auto
      - "off" #Turns the AC off - Should be quoted and should be always included here
    supported_fan_speeds:
      - low
      - max
      - medium
      - high
      - middle
      - focus
      - diffuse
      - min
      - auto
    supported_swing_list:
      - "off"
      - vertical #up to down
    hvac_model: "1" # string value
    celsius_mode: "On" #optional - default "On" string value - you can remove it if you use celsius

# Daikin AC Tasmota IR_TransRec3 Control
  - platform: tasmota_irhvac
    name: Daikin Sala
    command_topic: cmnd/IR_TransRec3/irhvac
    state_topic: tele/IR_TransRec3/RESULT
    temperature_sensor: sensor.shellyht_955a68_temperature #optional this sensor is used to display current temp on the AC card
    protocol: DAIKIN
    min_temp: 16 #optional - default 16 int value
    max_temp: 30 #optional - default 32 int value
    target_temp: 26 #optional - default 26 int value
    initial_operation_mode: "off" # optional - default "off" string value
    away_temp: 24 #optional - default 24 int value
    precision: 1.0 #optional - default 1.0 float value
    supported_modes:
      - heat 
      - cool
      - dry
      - fan_only
      - auto
      - "off" #Turns the AC off - Should be quoted and should be always included here
    supported_fan_speeds:
      - low
      - max
      - medium
      - high
      - middle
      - focus
      - diffuse
      - min
      - auto
    supported_swing_list:
      - "off"
      - vertical #up to down
    hvac_model: "1" # string value
    celsius_mode: "On" #optional - default "On" string value - you can remove it if you use celsius
arevaclier commented 2 years ago

I pushed a small fix as I was encountering the same issue (#75)

Kryoh-hash commented 2 years ago

I pushed a small fix as I was encountering the same issue (#75)

Fixed !

Thanks !