home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.7k stars 30.82k forks source link

IntesisHome Integration 108 stopped working #33870

Closed sahne2000 closed 4 years ago

sahne2000 commented 4 years ago

The problem

IntesisHome Integration Stopped Working

Environment

arch x86_64
dev false
docker true
hassio true
os_name Linux
os_version 4.19.107
python_version 3.7.7
timezone Pacific/Auckland
version 0.108.1
virtualenv false

Problem-relevant configuration.yaml

climate:
  - platform: intesishome
    username: !secret intesishome_user
    password: !secret intesishome_password

Traceback/Error logs

Error while setting up intesishome platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/intesishome/climate.py", line 119, in async_setup_platform
    for ih_device_id, device in ih_devices.items()
  File "/usr/src/homeassistant/homeassistant/components/intesishome/climate.py", line 119, in <listcomp>
    for ih_device_id, device in ih_devices.items()
  File "/usr/src/homeassistant/homeassistant/components/intesishome/climate.py", line 188, in __init__
    modes = controller.get_mode_list(ih_device_id)
  File "/usr/local/lib/python3.7/site-packages/pyintesishome/pyintesishome.py", line 647, in get_mode_list
    return list(config_mode_map.values())
AttributeError: 'int' object has no attribute 'values'

Additional information

frenck commented 4 years ago

Thanks for opening up an issue @sahne2000!

However, please use the issue template provided when creating an issue. Without it, there is a lot of information missing and we are not able to help you. Please update your issue.

Thanks 👍

sahne2000 commented 4 years ago

The problem

IntesisHome Integration Stopped Working

Environment

arch x86_64
dev false
docker true
hassio true
os_name Linux
os_version 4.19.107
python_version 3.7.7
timezone Pacific/Auckland
version 0.108.1
virtualenv false

Problem-relevant configuration.yaml

climate:
  - platform: intesishome
    username: !secret intesishome_user
    password: !secret intesishome_password

Traceback/Error logs

Error while setting up intesishome platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/intesishome/climate.py", line 119, in async_setup_platform
    for ih_device_id, device in ih_devices.items()
  File "/usr/src/homeassistant/homeassistant/components/intesishome/climate.py", line 119, in <listcomp>
    for ih_device_id, device in ih_devices.items()
  File "/usr/src/homeassistant/homeassistant/components/intesishome/climate.py", line 188, in __init__
    modes = controller.get_mode_list(ih_device_id)
  File "/usr/local/lib/python3.7/site-packages/pyintesishome/pyintesishome.py", line 647, in get_mode_list
    return list(config_mode_map.values())
AttributeError: 'int' object has no attribute 'values'

Additional information

probot-home-assistant[bot] commented 4 years ago

Hey there @jnimmo, mind taking a look at this issue as its been labeled with a integration (intesishome) you are listed as a codeowner for? Thanks!

jnimmo commented 4 years ago

Thanks for reporting the issue, the library is getting an unexpected config_mode_map. Can you please advise what modes your device supports, then I'll patch the library

If you're able to increase logging by adding the following to your configuration file, then provide the output of 'grep config_mode_map ~/.homeassistant/home-assistant.log' and provide the output would be helpful too. I expect to see a 'config_mode_map': followed by a number.

logger:
  logs:
    homeassistant.components.intesishome: debug
sahne2000 commented 4 years ago

Should I provide this in 0.108 or 0.107.7?

sahne2000 commented 4 years ago

Thats out of 0.107.7

2020-04-13 11:33:56 DEBUG (MainThread) [homeassistant.components.intesishome.climate] Added climate device with state: {'name': 'Lounge', 'widgets': [15, 3, 5, 7, 9, 11, 13, 52, 53], 'model': 5, 'power': 'off', 'mode': 'heat', 'unknown_uid_3': 0, 'fan_speed': 0, 'vvane': 'auto/stop', 'hvane': 'auto/stop', 'setpoint': 230, 'temperature': 230, 'remote_controller_lock': 0, 'working_hours': 625, 'alarm_status': 0, 'error_code': 0, 'quiet_mode': 'off', 'setpoint_min': 160, 'setpoint_max': 300, 'config_mode_map': 23, 'runtime_mode_restrictions': 0, 'config_horizontal_vanes': 63, 'config_vertical_vanes': 63, 'config_quiet': 0, 'config_confirm_off': 0, 'config_fan_map': {0: 'auto', 1: 'quiet', 2: 'low', 3: 'medium', 4: 'high', 5: 'max'}, 'mainenance_w_reset': 0, 'mainenance_wo_reset': 0, 'filter_clean': 0, 'filter_due_hours': 0, 'unknown_uid_185': 0, 'unknown_uid_186': 0, 'unknown_uid_187': 0, 'unknown_uid_188': 0, 'unknown_uid_189': 0, 'unknown_uid_190': 0, 'external_led': 'on', 'internal_led': 'off', 'internal_temperature_offset': 0, 'temp_limitation': 'off', 'cool_temperature_min': 240, 'cool_temperature_max': 280, 'heat_temperature_min': 230, 'unknown_uid_50008': 1, 'unknown_uid_50010': 4, 'rssi': 214}

Anything else?

jnimmo commented 4 years ago

Thanks, looks like your device supports Auto, Heat, Dry, Cool (but no fan-only mode) - does that sound right? I've pushed a patch, could you please update the requirements in home-assistant/components/intesishome/manifest.json to "pyintesishome==1.7.2" and test or alternatively run 'pip3 install pyintesishome==1.7.2" then start Home Assistant with the --skip-pip option

sahne2000 commented 4 years ago

yes correct. sorry not to sure how to manually upgrade to 1.7.2. please send some guidance

jnimmo commented 4 years ago

If you locate the manifest.json and update the version, Home Assistant will take care of it on restart

sahne2000 commented 4 years ago

hi jnimmo its working i downloaded the component and put it into custom component under 0.108.3 and i can confirm its working. Great work. Cheers mate

joostkoppers commented 4 years ago

Hi, I'm having the same problem (and error). I see that it's fixed. But do I have to wait to an update of Supervisor, or do I have to do something manually? For now it isn't working anymore for me.

sahne2000 commented 4 years ago

you can wait for home assistant update or download the updated component itself manually and temp place it under custom components.

joostkoppers commented 4 years ago

you can wait for home assistant update or download the updated component itself manually and temp place it under custom components.

Thanks! Then I’ll wait to the HA update ;-)

jnimmo commented 4 years ago

@joostkoppers @sahne2000 0.108.4 is available now which includes the patch

joostkoppers commented 4 years ago

@joostkoppers @sahne2000 0.108.4 is available now which includes the patch

Nice :-). 0.108.4 is not showing in Home Assistant yet, but I'll be patient ;-)

joostkoppers commented 4 years ago

@joostkoppers @sahne2000 0.108.4 is available now which includes the patch

I just manually updated to 0.108.4. The entity is back now, but the hvac_modes have disappeared. I only have an option: ' off' . So that is not al lot of functionality ;-).

It use to say:

Probably another bug? Should I open an issue for this?

RuudKoolmees commented 4 years ago

I had the same problem as jooskoppers. my intesisbox reported value 63 as config_mode_map. I added this to my pyintesishome.py. And now have the other options back again.

jnimmo commented 4 years ago

@RuudKoolmees what nodes does your Intesishome device support? I haven’t come across any with 63 yet

jnimmo commented 4 years ago

I knew I should’ve started using a bitmap to check for functionality instead of a dictionary, so if a device had unusual values for config_mode_map. @joostkoppers can you advise what your config_fan_map value is- or what additional mode your device has?

RuudKoolmees commented 4 years ago

@jnimmo Hi James. It is the same as config_mode_map 31. I copied the line with value 31 and add it with 63. I have a Mitsubisi Heavy industries SRK63ZS-W with a Intensishome MHI domestic

It worked ok in Home assistant 107

jnimmo commented 4 years ago

Can you drop in a screenshot of what it looks like on the intesishome app or website?

RuudKoolmees commented 4 years ago

Screenshot_20200415-211943

joostkoppers commented 4 years ago

Mine is the same as RuudKoolmees. The integration worked fine until 0.108. The airco is a Mitsubishi SRK/SRC 80ZR-S, connected via Airconwithme. The interface looks like:

82DE0B69-18B4-447B-A933-712A74651A83

sahne2000 commented 4 years ago

It has been working for me again since the 0.108.4 update. Thanks @jnimmo

DoffenIsCool commented 4 years ago

No problem for me with versjon 0.108.4 My IntesisHome is controling Panasonic AC Thanx for update @jnimmo

jnimmo commented 4 years ago

@joostkoppers @RuudKoolmees I've just cleaned up the code in a new version of the library v1.7.4 https://github.com/jnimmo/pyIntesisHome/commit/439283d368cf11198f64f5f25215e4b6d1f1040c which now just determines the modes based on the feature bits instead of relying on having an entry in the config_mode_map for every possible combination of modes. I've submitted a PR so hopefully next HA release will reference 1.7.4.

If anyone figures out what the additional mode in the devices returning 63 is, let me know!

RuudKoolmees commented 4 years ago

Hi James, Thanks!!!!

Cheers,

Ruud

joostkoppers commented 4 years ago

Sounds good 😀

Thanks for the effort, James!

christianzappa commented 4 years ago

@jnimmo same issue here with my Mitsubishi Heavy Industry not showing any modes other than off. How can I implement your updated code without having to wait for the next HA update? Thanks!

jnimmo commented 4 years ago

@jnimmo same issue here with my Mitsubishi Heavy Industry not showing any modes other than off. How can I implement your updated code without having to wait for the next HA update? Thanks!

You can update the intesishome/manifest.json requirement to reference pyintesishome 1.7.4 instead of 1.7.3

joostkoppers commented 4 years ago

@joostkoppers @RuudKoolmees I've just cleaned up the code in a new version of the library v1.7.4 jnimmo/pyIntesisHome@439283d which now just determines the modes based on the feature bits instead of relying on having an entry in the config_mode_map for every possible combination of modes. I've submitted a PR so hopefully next HA release will reference 1.7.4.

If anyone figures out what the additional mode in the devices returning 63 is, let me know!

Fix still didn’t make the release branch? Is there someway I can help bump it up?

sahne2000 commented 4 years ago

Just download the code and add it into the custom component folder. Reboot home assistant. Remove component after update fix come out.