Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to set up: Import error #873

Open
rudgej opened this issue Feb 12, 2025 · 2 comments
Open

Failed to set up: Import error #873

rudgej opened this issue Feb 12, 2025 · 2 comments

Comments

@rudgej
Copy link

rudgej commented Feb 12, 2025

I have just updated to 2025 2.2. As far as I know it was working before this update but I did not check

I now have failed to set up - import error showing and the logs are as below.

Log details (ERROR)

Logger: homeassistant.config_entries
Source: config_entries.py:606
First occurred: 11:03:03 (1 occurrences)
Last logged: 11:03:03

Error importing platform config_flow from integration heatmiserneo to set up heatmiserneo configuration entry: cannot import name 'HVAC_MODE_COOL' from 'homeassistant.components.climate.const' (/usr/src/homeassistant/homeassistant/components/climate/const.py)

If anyone could let me know the fix I would appreciate it.

The system is heat miser under floor heating.

Thanks

@ericfitz
Copy link

FYI looks similar in root cause to #134636

@ericfitz
Copy link

ericfitz commented Feb 16, 2025

I got it working using a slight variation of the changes to fix the other issue. Here's what I did, using the terminal add-on.

  1. Change directory to ./homeassistant/custom_components/smartthinq_sensors/
  2. Make a copy of binary_sensor.py
  3. Open binary_sensor.py with your favorite editor
  4. Navigate to the section that starts with the line "from homeassistant.components.binary_sensor import"
  5. Inside the parentheses, add the following text
DOMAIN,
BinarySensorDeviceClass,
BinarySensorEntity,
  1. Save the file.

  2. Now make a copy of sensor.py

  3. Open sensor.py with your favorite editor

  4. Navigate to area that has several lines like "from homeassistant.const import"

  5. Inside the parenthesis, add the line:

UnitOfTemperature,
  1. Save the file.

  2. As with the other two files, make a backup of the file climate.py and open it in your editor

  3. Add the following lines to the section "from homeassistant.components.climate.const import"

DOMAIN,
HVACMode,
SUPPORT_TARGET_TEMPERATURE,
  1. Save the file.

  2. Back up const.py and open it in your editor. Add the following lines at the beginning of the file.

from datetime import timedelta

from homeassistant.components.climate.const import HVACMode

CLIMATE_SUPPORTED_MODES = [HVACMode.HEAT, HVACMode.OFF]
UPDATE_INTERVAL = timedelta(seconds=30)
  1. Save the file and restart Home Assistant
    This worked for me. Hope it helps.

ericfitz added a commit to ericfitz/ha-smartthinq-sensors that referenced this issue Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants