GithubHelp home page GithubHelp logo

nicole-ashley / homeassistant-goldair-climate Goto Github PK

View Code? Open in Web Editor NEW
19.0 4.0 11.0 170 KB

Home Assistant integration for Goldair WiFi heaters, dehumidifiers and fans

License: MIT License

Python 99.79% Shell 0.21%
goldair heater dehumidifier fan wifi homeassistant hacs

homeassistant-goldair-climate's Introduction

Home Assistant Goldair WiFi Climate component

hacs_badge Reliability Rating Security Rating Maintainability Rating Lines of Code Coverage

The goldair_climate component integrates Goldair WiFi-enabled heaters, WiFi-enabled dehumidifiers, and WiFi-enabled fans into Home Assistant, enabling control of setting the following parameters via the UI and the following services:

GPPH Heaters

  • power (on/off)
  • mode (Comfort, Eco, Anti-freeze)
  • target temperature (5-35 in Comfort mode, 5-21 in Eco mode, in °C)
  • power level (via the swing mode setting because no appropriate HA option exists: Auto, 1-5, Stop)

Current temperature is also displayed.

GPCV Heaters

  • power (on/off)
  • mode (Low, High)
  • target temperature (15-35 in °C)

Current temperature is also displayed.

GECO Heaters

  • power (on/off)
  • target temperature (15-35 in °C)

Current temperature is also displayed.

Dehumudifiers

  • power (on/off)
  • mode (Normal, Low, High, Dry clothes, Air clean)
  • target humidity (30-80%)

Current temperature is displayed, and current humidity is available as a property. The "tank full" state is available via the error attribute, and if you want to you can easily surface this to a top-level entity using a template sensor.

Fans

  • power (on/off)
  • mode (Normal, Eco, Sleep)
  • fan mode (1-12)
  • swing (on/off)

Light

  • LED display (on/off)

Lock (heaters and dehumidifiers)

  • Child lock (on/off)

There was previously a sensor option, however this is easily achieved using a template sensor and therefore is no longer supported.


Device support

Please note, this component is actively tested with the Goldair GPPH (inverter), GPDH420 (dehumidifier), and GCPF315 fan, and community-tested with GECO,and GPCV heater devices. It may work with the GPDH440 dehumidifier, GEPH heater, and other heaters, dehumidifiers or fans based on the Tuya platform.

GPCV support is based on feedback from etamtlosz on Issue #27. GECO support is based on work in KiLLeRRaT/homeassistant-goldair-climate and the feature set from the online manual for these heaters. GEPH heaters appear to be the same as the GECO270, so may also work with this setting. This heater is almost compatible with the GPCV but without the Low/High mode.


Installation

Installation is via the Home Assistant Community Store (HACS), which is the best place to get third-party integrations for Home Assistant. Once you have HACS set up, simply search the Integrations section for Goldair.

Configuration

You can easily configure your devices using the Integrations UI at Home Assistant > Configuration > Integrations > +. This is the preferred method as things will be unlikely to break as this integration is upgraded. You will need to provide your device's IP address, device ID and local key; the last two can be found using the instructions below.

If you would rather configure using yaml, add the following lines to your configuration.yaml file (but bear in mind that if the configuration options change your configuration may break until you update it to match the changes):

# Example configuration.yaml entry
goldair_climate:
  - name: My heater
    host: 1.2.3.4
    device_id: <your device id>
    local_key: <your local key>

Configuration variables

name

    (string) (Required) Any unique name for the device; required because the Tuya API doesn't provide the one you set in the app.

host

    (string) (Required) IP or hostname of the device.

device_id

    (string) (Required) Device ID retrieved as per the instructions below.

local_key

    (string) (Required) Local key retrieved as per the instructions below.

type

    (string) (Optional) The type of Goldair device. auto to automatically detect the device type, or if that doesn't work, select from the available options heater, gpcv_heater, geco_heater, dehumidifier or fan.

    Default value: auto

climate

    (boolean) (Optional) Whether to surface this appliance as a climate device.

    Default value: true

display_light

    (boolean) (Optional) Whether to surface this appliance's LED display control as a light (not supported for GPCV or GECO heaters).

    Default value: false

child_lock

    (boolean) (Optional) Whether to surface this appliances's child lock as a lock device (not supported for fans).

    Default value: false

Heater gotchas

Goldair GPPH heaters have individual target temperatures for their Comfort and Eco modes, whereas Home Assistant only supports a single target temperature. Therefore, when you're in Comfort mode you will set the Comfort temperature (5-35), and when you're in Eco mode you will set the Eco temperature (5-21), just like you were using the heater's own control panel. Bear this in mind when writing automations that change the operation mode and set a temperature at the same time: you must change the operation mode before setting the new target temperature, otherwise you will set the current thermostat rather than the new one.

When switching to Anti-freeze mode, the heater will set the current power level to 1 as if you had manually chosen it. When you switch back to other modes, you will no longer be in Auto and will have to set it again if this is what you wanted. This could be worked around in code however it would require storing state that may be cleared if HA is restarted and due to this unreliability it's probably best that you just factor it into your automations.

When child lock is enabled, the heater's display will flash with the child lock symbol ([]) whenever you change something in HA. This can be confusing because it's the same behaviour as when you try to change something via the heater's own control panel and the change is rejected due to being locked, however rest assured that the changes are taking effect.

Fan gotchas

In my experience, fans can be a bit flaky. If they become unresponsive, give them about 60 seconds to wake up again.

Finding your device ID and local key

You can find these keys the same way as you would for any Tuya local integration. You'll need the Goldair app or the Tuya Tuya Smart app (the Goldair app is just a rebranded Tuya app), then follow these instructions.

You're looking for uuid (this is the device ID) and the localKey values.

Next steps

This component is mostly unit-tested, but there are a few more to complete. Feel free to use existing specs as inspiration and the Sonar Cloud analysis to see where the gaps are.

Once unit tests are complete, the next task is to complete the Home Assistant quality checklist before considering submission to the HA team for inclusion in standard installations.

Please report any issues and feel free to raise pull requests.

Acknowledgements

None of this would have been possible without some foundational discovery work to get me started:

homeassistant-goldair-climate's People

Contributors

make-all avatar nicole-ashley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

homeassistant-goldair-climate's Issues

Device frequently unavailable

Hi there,
I've managed to get this running on my GPCV330.
I've noticed the logs full of the device becoming unavailable.
I'm on my phone so I'll attach some screenshots of what I can see.
The signal strength seems to be around -56dbm so should be good there.
My automation for turning off my son's heater fired this morning but didn't seem to stick as it conveniently became unavailable at the time...
Is this just a bad unit or something in the polling?
Some errors I've managed to sift out of the logs:

020-06-28 04:00:31 ERROR (Thread-10) [custom_components.goldair_climate.device] Failed to update device state.
020-06-28 07:22:28 ERROR (SyncWorker_1) [custom_components.goldair_climate.device] Failed to refresh device state for Ashton's Heater
2020-06-28 07:22:37 ERROR (SyncWorker_17)
[pytuya] Unexpected status() payload=b'3.3\x00\x00\x00\x00\x00\x00\x01D\x00\x00\x00\x01\x10\nf\xde\x8fm\xdb\x04\xed\n\xd2\xca\xc9Y\x9b\xe7\xcavH\xe3\xae\x90\xa3\xa9_0\x85]L\xd3\x0cm<\rFD\xff?)O\xe0\x0b#\x88\xd6\x9f\x9c|\x81T\xd4_\x94\xf9N\xd2.-\xf0\x82U\xf9\x13\xbe'

Log seems to be full of: update of the lock property is taking longer than 10 seconds as in last screenshot below.

Screenshot_20200628-082657
Screenshot_20200628-084502

Difficulties installing on Hass.io

First of all this looks great and I'm excited about getting my Goldair heaters linked into Home Assistant.

I run Home Assistant via Hass.io and have followed your instructions to get setup, however get the below error which from googling looks like it will be because hass.io doesn't support custom components with dependencies :-(

We support only official components.

Error loading custom_components.climate.goldair_heater. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/loader.py", line 86, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/climate/goldair_heater.py", line 213, in <module>
    import pytuya
ModuleNotFoundError: No module named 'pytuya'

Looks like the relevant code from goldair_heater.py is REQUIREMENTS = ['pytuya==7.0']

Trying to think through my options:

  1. I move away from hass.io to a manual install, which seems a bit of a pain.
  2. I wait and in time @nikrolls submits and gets things included in the official HA release which then filters down into Hass.io in the next release cycle.
  3. I work out how to install pytuya on my hass.io setup manually.
  4. Somehow pytuya gets included in Hass.io

Any thoughts or other ideas?

GPPF200 - LED display off

Hi,

I was hoping to buy a GPPF200 and was wondering if its possible to turn off the LED display with home assistant as you can in the manual of the fan?

Thanks in advance!

Unable to use is_preset_mode in Automation

I'm not sure if this is the right place to raise this issue, but I'll try here first.

I'm not able to use the 'is_preset_mode' condition on a heater to check the mode. In the UI for creating automations, if I have:

condition: device
device_id: XXX
domain: climate
entity_id: climate.adam_s_heater
type: is_preset_mode
preset_modes: Comfort

Then when I attempt to save the automation I'm told: Message malformed: not a valid value for dictionary value @ data['type']
I have tried the three options I have: Comfort, Eco & Anti-Freeze

I can happily change the mode using 'preset_mode'.

I am currently using, but it'd be nice to only try and change the state if it isn't already in the other mode.

condition: device
device_id: XXX
domain: climate
entity_id: climate.adam_s_heater
type: is_hvac_mode
hvac_mode: heat

Temperature is not a number: standby

Hi, I'm trying to use this with a Goldair GCV440 and there seems to be some sort of issue with the climate/temperature value.

I can see the entity that's been added however it's stats just say unavailable, something that is odd is that i can click on the Heat or On/Off buttons on the entity and it does actually turn on the device so it's partially working.

Viewing the entity on the Devices and Intergrations page shows the following error
"This entity is no longer being provided by the goldair_climate integration. If the entity is no longer in use, delete it in settings."

[547838666656] Temperature is not a number: standby
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1849, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 815, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 651, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 295, in state_attributes
    ATTR_CURRENT_TEMPERATURE: show_temp(
  File "/usr/src/homeassistant/homeassistant/helpers/temperature.py", line 24, in display_temp
    raise TypeError(f"Temperature is not a number: {temperature}")
TypeError: Temperature is not a number: standby

"Unavailable" heater despite working well most of the time

I've got two GPPH610 heaters and have them both connected to wifi and home assistant. As per the other issue thread, they are now working well...most of the time.

At seemingly random times, I get Unavailable in home assistant:

screen shot 2018-08-21 at 11 33 46 am

The details show when it drops off, in this example both before 11pm and after 11am:

screen shot 2018-08-21 at 11 34 04 am

They are still connected to wifi.

I have a perhaps related issue whereby the heaters also sometimes "randomly" turn off. I will go back into a room and the heater display will either be blank, or E1 will display which suggests some kind of error. This may or may not be related, but is an annoyance and I mention in case potential to be linked. I have removed one of the heaters from home assistant and I still got the random turn off issue.

A couple of other potentially pertinent bits of info.

  • my Unifi wireless logs show each heater sending >15MB / day of data UP, which seems a lot? By comparison the DOWN is ~1MB / day.
  • physically powering off the heater and then turning it on causes the heater to reconnect and become available within home assistant as expected

Errors in home assistant logs:

screen shot 2018-08-21 at 11 44 53 am

I have access to another machine, could I troubleshoot this by trying to send manual commands or similar?

Have your heaters been rock solid?

Dehumidifier fault code is not surfaced

I can see the tank full status is detected in the code, and made available as the "fault" attribute.

However, as this is not part of the standard climate API, the fault attribute is not showing up in the Home Assistant interface.

Maybe this could be made available as a sensor as well? I'd like to be able to use this as a condition in my automations, also to trigger notifications.

Workaround for HACS symlink issue

In reference to hacs/integration Issue #1115

If you make translations/en.json the "master" copy, and make strings.json the symlink, then installing from HACS seems to work on 0.109.x

If you choose to do this, then probably updating hacs.json to make 0.109.0 the minimum version is advisable, as installation will be broken under earlier versions for the same reason installation in 0.109.x currently is.

Failed to call service

Finally I managed to get my uuid and local key, using HttpCanary (Packet Capture is not working anymore), added my heater (GPCV330) to my HA config.
The heater shows up, but I have issues toggling on/off. At first I need to switch between Operation/Preset modes, until it turns ON.
After that, no matter what temp I set, the Currently value stays at 30C although the Comfort temp is set lower.
When I try to set the temp, I'm getting the error: Failed to call service climate/set_temperature. 25 is not in list
2020-04-28 19_41_00-Window

According to my Goldair app, there's no firmware upgrade available. I'm running WiFi Module: 2.2.6 and MCU Module 1.0.0

tuya-cli with protocol-version 3.2 returns:

  devId: '16750538cc50e3xxxx',
  dps: {
    '1': true,
    '2': true,
    '3': 30,
    '4': 25,
    '5': 0,
    '6': 0,
    '7': 'Low'
  }
}

Water full

Any chance that a water full sensor could be added for dehumidifiers? I see the icon already changes so I wouldn't think a sensor should be too difficult. I'd love an automation to notify me to empty the tank

Also, it seems that the integration didn't get updates from the dehumidifier unless I change a setting on it from HA. Is this the integration of just that the dehumidifier isn't sending regular updates?

Thanks heaps

Goldair component errros

Home Assistant 0.109.6 in Docker + Network_mode: host
Setup heater via integration (not configuration.yaml)
Integration version? = "Latest commit 02a9cb4" 16 hrs ago.

Log Details (ERROR)
Logger: homeassistant.util.json
Source: util/json.py:32
First occurred: 2:50:35 PM (5 occurrences)
Last logged: 2:51:49 PM

Could not parse JSON content: /config/custom_components/goldair_climate/translations/en.json
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 32, in load_json
    return json.loads(fdesc.read())  # type: ignore
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Log Details (ERROR)
Logger: pytuya
Source: custom_components/goldair_climate/device.py:145
First occurred: 2:57:38 PM (1 occurrences)
Last logged: 2:57:38 PM

Unexpected status() payload=b'3.3\x00\x00\x00\x00\x00\x00\x02\x80\x00\x00\x00\x01\xb1\x1aB\xf4\x80}T$y#\xfc#\xb2\xbcU\xc2\xcb\xa9\x05T8\xeb\xd3\xa1X\x824\xec\x92\xbcu\x0cxQ\xdcTO$^#`\xdc\xad\x84P\xa1V[\xd6\xd2\x9aHy\x9a\xc9W\xf2\xf9\\\x93\x10\xe2\x8e\xee'
Failed to call service climate/set_swing_mode. None is not in list

Log Details (ERROR)
Logger: homeassistant.core
Source: custom_components/goldair_climate/device.py:246
First occurred: 2:56:23 PM (30 occurrences)
Last logged: 3:31:37 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 550, in _update_entity_states
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 257, in state_attributes
    data[ATTR_SWING_MODE] = self.swing_mode
  File "/config/custom_components/goldair_climate/heater/climate.py", line 215, in swing_mode
    return GoldairTuyaDevice.get_key_for_value(POWER_LEVEL_TO_DPS_LEVEL, dps_mode)
  File "/config/custom_components/goldair_climate/device.py", line 246, in get_key_for_value
    return keys[values.index(value)] or fallback
ValueError: None is not in list
Log Details (ERROR)
Logger: homeassistant.components.websocket_api.http.connection.140312346464208
Source: util/json.py:38
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 2:50:35 PM (4 occurrences)
Last logged: 2:51:49 PM

Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 32, in load_json
    return json.loads(fdesc.read())  # type: ignore
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 20, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/frontend/__init__.py", line 550, in websocket_get_translations
    msg.get("config_flow"),
  File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 325, in async_get_translations
    results = await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 221, in async_get_component_strings
    loaded_translations = await load_translations_job
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 90, in load_translations_files
    loaded_json = load_json(translation_file)
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 38, in load_json
    raise HomeAssistantError(error)
homeassistant.exceptions.HomeAssistantError: Expecting value: line 1 column 1 (char 0)
Log Details (ERROR)
Logger: homeassistant.components.websocket_api.http.connection.140312346464208
Source: custom_components/goldair_climate/device.py:246
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 2:56:04 PM (1 occurrences)
Last logged: 2:56:04 PM

None is not in list
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1247, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1282, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 470, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 257, in state_attributes
    data[ATTR_SWING_MODE] = self.swing_mode
  File "/config/custom_components/goldair_climate/heater/climate.py", line 215, in swing_mode
    return GoldairTuyaDevice.get_key_for_value(POWER_LEVEL_TO_DPS_LEVEL, dps_mode)
  File "/config/custom_components/goldair_climate/device.py", line 246, in get_key_for_value
    return keys[values.index(value)] or fallback
ValueError: None is not in list

Problem initialising the dehumidifieir - ValueError: None is not in list

Problem initialising the dehumidifieir.
I am getting the following in the HA Core log at initial startup of the component;

ERROR (MainThread) [homeassistant.components.climate] Error while setting up goldair_climate platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 239, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 478, in _async_add_entity
    original_icon=entity.icon,
  File "/config/custom_components/goldair_climate/dehumidifier/climate.py", line 88, in icon
    if self.tank_full_or_missing:
  File "/config/custom_components/goldair_climate/dehumidifier/climate.py", line 279, in tank_full_or_missing
    GoldairTuyaDevice.get_key_for_value(ERROR_CODE_TO_DPS_CODE, error)
  File "/config/custom_components/goldair_climate/device.py", line 252, in get_key_for_value
    return keys[values.index(value)] or fallback
ValueError: None is not in list

After this has appeared a few times, subsequent refereshes seem to be failing with;
[custom_components.goldair_climate.device] Failed to refresh device state for <deviceName>.

Any advice or pointers would be greatly appreaciated.
Thanks

Slow response using Home Assistant with Goldair Heater

I have recently purchase a Goldair Heater and started using this component (thanks for the great work). The heater has been blocked on my firewall from the internet to remove cloud connectivity and went through the process to get local key etc. I have noticed that the wifi on the heater disconnects fairly regularly (wifi light flashes) as well as the heater is not very responsive when controlling from Home Assistant.

I have gone so far as creating a "while" script in Home Assistant to ensure that the heater actually changes state (heat / off) as I found that it doesn't always work the first time. https://www.home-assistant.io/docs/scripts/#while-loop

Wifi network for other devices is rock solid and -db to the heater is fine.

Log also shows that it can not refresh device state:
First occurred: April 25, 2021, 1:57:35 PM (28 occurrences)
Last logged: April 27, 2021, 7:27:22 PM

Failed to refresh device state for Goldair Heater.
Failed to update device state.

Is anyone else experiencing this issue?

Difficulties installing goldair_climate in home assistant running in docker

Ubuntu 18.04.2 LTS
Docker image: homeassistant/home-assistant
Home Assistant version 0.97.2

Error loading custom_components.goldair_climate. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/loader.py", line 355, in _load_file
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/goldair_climate/__init__.py", line 16, in <module>
    from homeassistant.components.climate import ATTR_OPERATION_MODE
ImportError: cannot import name 'ATTR_OPERATION_MODE' from 'homeassistant.components.climate' (/usr/src/app/homeassistant/components/climate/__init__.py)

I have tried the following "fix"

I download pytuya-7.0.2.zip
I extracted the file called pytuya-7.0.2.zip\pytuya-7.0.2\pytuya__init__.py
then copied it to \custom_components\pytuya\__init__.py
then i edited \custom_components\goldair_climate\__init__.py
and changed line 139 from import pytuya to import custom_components.pytuya as pytuya

This did not work.

Not available in HACS Integrations list

Issue: When searing for 'goldair' when adding a new HACS integrations repository, this repo doesn't appear.

HACS Unable to find Goldair

Home Assistant Version: 2022.3.5 (via docker - homeassistant/home-assistant:latest)
HACS version: 1.19.3 (via wget -O - https://get.hacs.xyz | bash -)

My guess is because the repository has moved? I see that on the HACS website it is listed as nikrolls/homeassistant-goldair-climate, but this repo is nicole-ashley/homeassistant-goldair-climate. Maybe something needs to be updated there?

Goldair heater unavailable if not unreachable during hass startup

Hello,

Looks like the integration can only initialize devices during hass startup.
If the heater is powered off when hass is starting up, it will stay unavailable.

I even tried to reload the integration after powering on the heater, but it did not become available.

Easier access to device id & key

Hi
As a newbie I wasnt so sure about your instructions to get the device links by re-adding the device etc as I operate a mesh router and it was very difficult to get them connected in the first place.
I did a bit of digging and found this link which helped me find the information quite easily on the IoT Tuya platform, so thought it might be good to put it on here for others.

https://linkdhome.com/articles/local-tuya-device-control-in-homekit

I did find that the data has been changed about a bit and after going into the API explorer I had to go to Smart Home Device System, then Device Management and get Device details to get the Local key for the devices.
But once I had them I loaded it into this integration and it found them right away

Update of climate/lock is taking over 10 seconds is flooding log

The updates of the device are flooding the logs with warnings Update of xxx is taking over 10 seconds. For some reason the ‘climate’ update is every 5 minutes but the ‘lock’ update is every 2 minutes (sometimes every minute).

2023-05-01 10:20:10.251 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.spare_bedroom_wall_heater is taking over 10 seconds
2023-05-01 10:21:10.713 WARNING (MainThread) [homeassistant.helpers.entity] Update of lock.spare_bedroom_wall_heater is taking over 10 seconds

Enabling the debug log shows it is having an issue with ‘protocol 3.1’ but then tries again with 3.3 and succeeds every time.

2023-05-01 10:38:00.735 DEBUG (SyncWorker_3) [custom_components.goldair_climate.device] Refreshing device state for Spare Bedroom Wall Heater.
2023-05-01 10:38:00.781 DEBUG (SyncWorker_3) [custom_components.goldair_climate.device] Retrying after exception [Errno 104] Connection reset by peer
2023-05-01 10:38:00.781 INFO (SyncWorker_3) [custom_components.goldair_climate.device] Setting protocol version for Spare Bedroom Wall Heater to 3.1.
2023-05-01 10:38:10.735 WARNING (MainThread) [homeassistant.helpers.entity] Update of lock.spare_bedroom_wall_heater is taking over 10 seconds
2023-05-01 10:38:10.800 DEBUG (SyncWorker_3) [custom_components.goldair_climate.device] Retrying after exception timed out
2023-05-01 10:38:10.800 INFO (SyncWorker_3) [custom_components.goldair_climate.device] Setting protocol version for Spare Bedroom Wall Heater to 3.3.
2023-05-01 10:38:10.860 INFO (SyncWorker_3) [custom_components.goldair_climate.device] refreshed device state: {"devId": "84403378c45bbeee506b", "dps": {"1": false, "2": false, "3": 23, "4": 22, "5": 0, "6": 0, "updated_at": 1682894290.860798}}
2023-05-01 10:38:10.860 DEBUG (SyncWorker_3) [custom_components.goldair_climate.device] new cache state (including pending properties): {"1": false, "2": false, "3": 23, "4": 22, "5": 0, "6": 0, "updated_at": 1682894290.860798}
2023-05-01 10:39:00.736 DEBUG (SyncWorker_3) [custom_components.goldair_climate.device] Refreshing device state for Spare Bedroom Wall Heater.
2023-05-01 10:39:00.868 INFO (SyncWorker_3) [custom_components.goldair_climate.device] refreshed device state: {"devId": "84403378c45bbeee506b", "dps": {"1": false, "2": false, "3": 23, "4": 22, "5": 0, "6": 0, "updated_at": 1682894340.8680916}}
2023-05-01 10:39:00.868 DEBUG (SyncWorker_3) [custom_components.goldair_climate.device] new cache state (including pending properties): {"1": false, "2": false, "3": 23, "4": 22, "5": 0, "6": 0, "updated_at": 1682894340.8680916}

Updating line 18 of ‘const.py’ to remove protocol 3.1 and restarting HA seems to resolve the issue.
Changed from:
API_PROTOCOL_VERSIONS = [3.3, 3.1]
to:
API_PROTOCOL_VERSIONS = [3.3]

Running current version 0.1.3 of this integration.

Note this is for a GECO heater. Limiting the protocol to 3.3 may cause issues with other devices

GoldAir Wifi Fan not being detected as a fan

This is what I have in my logs....

2021-02-13 11:13:52 INFO (SyncWorker_0) [custom_components.goldair_climate.device] refreshed device state: {"devId": "03016700e0980606e6f6", "dps": {"1": true, "2": "1", "3": "1", "4": "off", "6": "0", "19": 24, "updated_at": 1613168032.1845233}}
2021-02-13 11:13:52 DEBUG (SyncWorker_0) [custom_components.goldair_climate.device] new cache state (including pending properties): {"1": true, "2": "1", "3": "1", "4": "off", "6": "0", "19": 24, "updated_at": 1613168032.1845233}
2021-02-13 11:13:52 DEBUG (MainThread) [custom_components.goldair_climate.device] Inferring device type from cached state: {'1': True, '2': '1', '3': '1', '4': 'off', '6': '0', '19': 24, 'updated_at': 1613168032.1845233}
2021-02-13 11:13:52 ERROR (MainThread) [homeassistant.components.climate] Error adding entities for domain climate with platform goldair_climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 315, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 506, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 322, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 219, in state_attributes
ATTR_CURRENT_TEMPERATURE: show_temp(
File "/usr/src/homeassistant/homeassistant/helpers/temperature.py", line 23, in display_temp
raise TypeError(f"Temperature is not a number: {temperature}")
TypeError: Temperature is not a number: off

I will try to set the detection by hand and see what I get.

HomeAssistant warning about component on startup

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:601
First occurred: 11:45:34 AM (1 occurrences)
Last logged: 11:45:34 AM

Entity climate.gpdh420_dehumidifier (<class 'custom_components.goldair_climate.dehumidifier.climate.GoldairDehumidifier'>) implements device_state_attributes. Please report it to the custom component author.

Missing Crypto requirement in manifest

This integration is missing a requirement in its manifest, hence the Home Assistant Custom Integration wheels failed to build the requirements.

Process package: pytuya>=7.0.5
Looking in links: https://wheels.home-assistant.io/alpine-3.10/amd64/
Collecting pytuya>=7.0.5
  Downloading pytuya-7.0.5.zip (13 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-flebjpuj/pytuya/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-flebjpuj/pytuya/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-wheel-flebjpuj/pytuya/pip-egg-info
         cwd: /tmp/pip-wheel-flebjpuj/pytuya/
    Complete output (14 lines):
    Traceback (most recent call last):
      File "/tmp/pip-wheel-flebjpuj/pytuya/pytuya/__init__.py", line 24, in <module>
        import Crypto
    ModuleNotFoundError: No module named 'Crypto'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-wheel-flebjpuj/pytuya/setup.py", line 9, in <module>
        import pytuya
      File "/tmp/pip-wheel-flebjpuj/pytuya/pytuya/__init__.py", line 28, in <module>
        import pyaes  # https://github.com/ricmoo/pyaes
    ModuleNotFoundError: No module named 'pyaes'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

See: https://github.com/clach04/python-tuya#encryption-notes

I'm removing the inclusion of this integration from our wheels project for now.
Feel free to re-add it when this has been resolved.

Add support for the ElectriQ CD20PRO-LE-V2 Dehumidifier

Hi,

First of all thanks for a great project. I have an ElectriQ CD20PRO-LE-V2 Dehumidifier which is Tuya based and is similar in operation to the Goldair models, although the DP IDs aren't exactly the same.

Would it be possible to add support? I can provide DP IDs etc as required

Thanks again

HA 0.96+ Compatibility - Change to Climate 1.0

Hi Nik

With HA 0.96 onwards, the Climate component has been changed (Climate 1.0 - see here: home-assistant/core#23899 and changes to /tuya/climate.py file ). Since the Goldair Climate uses the Climate Component, upgrading to HA 0.96 will likely break your component.

Could you please update it. Thanks very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.