Coder Social home page Coder Social logo

hysen's People

Contributors

albertomartinezballesteros avatar eifinger avatar irsl avatar mairas avatar mamrai1 avatar mcc05 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hysen's Issues

ClimateEntityFeature error

Hello,

I am getting the below error
Platform error climate.hysen - cannot import name 'ClimateEntityFeature' from 'homeassistant.components.climate.const' (/usr/src/homeassistant/homeassistant/components/climate/const.py)".

Any idea please? Thank you

--

Versions

  • Home Assistant 2022.4.7
  • Hysen addon latest version

Configuration

climate:

  • platform: hysen
    devices:
    lr_extension_uf:
    name: LR Extension UF
    host: 192.168.XX.XXX
    mac: "34:EA:34:XX:XX:XX"
    living_room_uf:
    name: Living Room UF
    host: 192.168.XX.XX
    mac: "34:EA:34:XX:XX:XX"

broadlink_response_error 65529

Hello,

I have 7 broadlink wifi thermostats at home with Home Assistant.

I am getting the following error and the thermostat is unavailable. Can someone please help? I am on Home Assistant 0.100.2. Thank you.

2019-12-13 04:51:02 ERROR (SyncWorker_14) [custom_components.hysen.climate] Failed to get Data from Broadlink Hysen Device:climate.bathroom_uf,:('broadlink_response_error', 65529)

climate:

  • platform: hysen
    devices:
    bathroom_uf:
    name: Bathroom UF
    mac: "XX:XX:XX:XX:XX:XX"
    host: 192.168.1.XX

auto_mode reset to 1

Hi, every time I try to set loop_mode to a value (0, 1 or 2) it resets the value of auto_mode to 1.
I tried with the "Beok" app and it works fine, but if I change loop_mode via Home Assistant, auto_mode resets to 1.
From my tests I understand that "auto_mode = (loop_mode + 1)" but I can't go beyond that.

So if i set loop_mode via Beok app to:

  • 0 - [12345,67] auto_mode change to 1
  • 1 - [123456,7] auto_mode change to 2
  • 2 - [1234567] auto_mode change to 3

Instead via Home Assistant Services [hysen_set_advanced] the auto_mode always remaing to 1.

service: climate.hysen_set_advanced
data:
  entity_id: climate.termostato
  loop_mode: 2

In the Climate.py file on line 1199 I can find ((loop_mode + 1) << 4) + auto_mode and it seems to follow my thoughts...

Also, I didn't find the service to forcibly change the value of auto_mode.

sfw_version: 2.3.1

Thanks in advance

Starting HA error

Dear, each time I restart home assistant I obtain some errors, but after that all works.
Can you fix it?
Thanks

home-assistant | EXCEPTION(calculate): list index out of range
home-assistant | EXCEPTION(calculate): list index out of rangeEXCEPTION(calculate): list index out of range
home-assistant |
home-assistant | 2019-02-20 10:06:20 WARNING (SyncWorker_3) [custom_components.climate.hysen] Broadlink Hysen Device Clock Sync Success....
home-assistant | 2019-02-20 10:06:20 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.cameretta fails
home-assistant | Traceback (most recent call last):
home-assistant | File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
home-assistant | await self.async_device_update()
home-assistant | File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
home-assistant | await self.hass.async_add_executor_job(self.update)
home-assistant | File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
home-assistant | result = self.fn(*self.args, **self.kwargs)
home-assistant | File "/config/custom_components/climate/hysen.py", line 452, in update
home-assistant | self._HysenData = self._broadlink_device.get_full_status()
home-assistant | File "/usr/local/lib/python3.6/site-packages/broadlink/init.py", line 648, in get_full_status
home-assistant | payload = self.send_request(bytearray([0x01,0x03,0x00,0x00,0x00,0x16]))
home-assistant | File "/usr/local/lib/python3.6/site-packages/broadlink/init.py", line 612, in send_request
home-assistant | request_payload.append(crc & 0xFF)
home-assistant | TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'
home-assistant | 2019-02-20 10:06:21 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.bagno fails

Upstream broadlink package barfs when multiple devices are defined

Should be solved in broadlink instead of the HA component.

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/hysen/climate.py", line 858, in update
    self._current_operation = STATE_UNAVAILABLE
  File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 648, in get_full_status
    payload = self.send_request(bytearray([0x01,0x03,0x00,0x00,0x00,0x16]))
  File "/srv/homeassistant/lib/python3.5/site-packages/broadlink/__init__.py", line 612, in send_request
    request_payload.append(crc & 0xFF)
TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'

Make week_day & week_end attributes JSON compliant

Hi,

This is more broadlink-library issue, but it's easily fixable in the hysen-climate device ;)

For more flexibility, the week_day & week_end attribute that is returned should be JSON compliant. This is not the case in the broadlink-library since they use single quotes instead of double quotes.

You can fix this by changing line 657 & 658 in climate.py from

        attr['week_day'] = str(self._week_day)
        attr['week_end'] = str(self._week_end)

to

        attr['week_day'] = str(self._week_day).replace("'",'"')
        attr['week_end'] = str(self._week_end).replace("'",'"')

After doing so, you get alot more flexibility for getting/setting the schedule in HA.

Failed to connect to Broadlink Hysen device

Hello!

Sometimes I get this error:
2020-02-06 18:42:40 ERROR (MainThread) [custom_components.hysen.climate] Failed to connect to Broadlink Hysen device MAC:34:EA:xx:xx:xx:xx, IP:192.168.0.xx, Error:timed out

I am on version 0.105.1.

The app is working perfectly.

Configuration:
climate:

  • platform: hysen
    devices:
    main_thermostat:
    name: Main Thermostat
    host: 192.168.0.xx
    mac: "34:EA:xx:xx:xx:xx"

I hope you can help, and thank you for this component.

Add HVAC_ACTION

Hi, I just got my thermostat in the mail today (BEOK BOT306RF-WIFI) and it is working great (from a seperate VLAN with no outside access!).

Just wanted to point out that with the changes to climate 1.0 in HA 0.96 they also added the attribute HVAC_ACTION. This is used by some other components/lovelace cards (the simple thermostat for example).

As a warning, I'm not a programmer and just installed HA today, so I could have done something wrong, but I implemented it like this:
In climate.py, I first imported the needed climate.consts:

--line42 from homeassistant.components.climate.const import (DOMAIN, SUPPORT_TARGET_TEMPERATURE,SUPPORT_PRESET_MODE, HVAC_MODE_OFF, HVAC_MODE_HEAT, HVAC_MODE_AUTO, PRESET_AWAY,
PRESET_NONE)
++line42 from homeassistant.components.climate.const import (DOMAIN, SUPPORT_TARGET_TEMPERATURE,SUPPORT_PRESET_MODE, HVAC_MODE_OFF, HVAC_MODE_HEAT, HVAC_MODE_AUTO, PRESET_AWAY,
PRESET_NONE, CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE)

Then I set the property:

    @property
    def hvac_action(self):
        """Return current HVAC action."""
        if self._is_heating_active == 1:
            return CURRENT_HVAC_HEAT
        else:
            return CURRENT_HVAC_IDLE

It might even be better to replace the is_heating_active attribute, but not my call.

Feature request - Time sync

So, I am using your plugin for quite a while now and it is working perfect.
But I have an issue with the time on the thermostat. The time is running slightly off in a couple of days.
In the Room Heat app there is an option to sync the time from your phone to the thermostat.
Now I was wondering if it is possible to build a time sync in the addon. So that you can create an automation to sync the time once in a while.

Then I can automate this and the time issue is fixed.

Not working properly with latest HA

I got errors on my HA log, and the thermostat is not available. A power cycle of the thermostat followed by a restart of HA seem to work for a couple of minutes after start to fail again.

Errors:

Logger: custom_components.hysen.climate
Source: custom_components/hysen/climate.py:948
Integration: hysen
First occurred: 17:15:17 (31 occurrences)
Last logged: 18:15:23
Failed to get Data from Broadlink Hysen Climate device more than 3 times :climate.termostat_menjador,:('broadlink_response_error: ', 'The device is offline') 



Logger: homeassistant.helpers.entity
Source: helpers/entity.py:477
First occurred: 17:16:01 (92 occurrences)
Last logged: 18:16:41
Update of climate.termostat_menjador is taking over 10 seconds 

HA information:

System Health

version 2020.12.0
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.8.6
os_name Linux
os_version 5.4.83
arch x86_64
timezone Europe/Madrid
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Hass.io
host_os Home Assistant OS 5.8
update_channel stable
supervisor_version 2020.12.6
docker_version 19.03.13
disk_total 38.7 GB
disk_used 2.0 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (8.10.0)
Lovelace
dashboards 3
mode auto-gen
resources 0

Error with latest HA core 2021.4

I get this error in the logs but it seems that it works OK...I don't have any other broadlink devices

ERROR (MainThread) [homeassistant.components.broadlink.config_flow] Unsupported device: 0x4ead. If it worked before, please open an issue at https://github.com/home-assistant/core/issues
2021-04-08 19:16:57 ERROR (MainThread) [homeassistant.components.broadlink.config_flow] Unsupported device: 0x4ead. If it worked before, please open an issue at https://github.com/home-assistant/core/issues

Can't find the entity

Hi, I have a Beok tol47 wifi (I set it with Tuya app) with a static IP address.
I add this code in configuration.yaml (with the true mac found in Tuya app) and I have no errors.

climate:

  • platform: hysen
    devices:
    main_thermostat:
    name: thermostatbeok
    host: 192.168.1.50
    mac: "xx"

I have a friend with the same device who uses this integration (both downloaded from HACS).
But I can't find the entity in the list... Any ideas?
(and the Broadlink integration doesn't work...)

Thank you

No module named 'PyCRC'

I get error: ERROR (SyncWorker_5) [custom_components.hysen.climate] Failed to get Data from Broadlink Hysen Device:climate.main_thermostat,:No module named 'PyCRC'.

No module named PyCRC

Running Home Assistant 0.107.7
Supervisor 213
Log Details (ERROR)
Logger: custom_components.hysen.climate
Source: custom_components/hysen/climate.py:891
First occurred: 8:53:42 PM (3 occurrences)
Last logged: 8:54:04 PM

Failed to get Data from Broadlink Hysen Device:climate.main_thermostat,:No module named 'PyCRC'

error with home assistant 2022.5

Hysen stopped working after latest update:

Logger: homeassistant.components.climate
Source: components/climate/init.py:220
Integration: Climate (documentation, issues)
First occurred: 11:48:37 PM (2 occurrences)
Last logged: 11:48:37 PM

Error adding entities for domain climate with platform hysen
Error while setting up hysen platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 810, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 220, in state
return HVACMode(self.hvac_mode).value
File "/usr/local/lib/python3.9/enum.py", line 384, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.9/enum.py", line 702, in new
raise ve_exc
ValueError: 'unavailable' is not a valid HVACMode

Clock not automaticly updating (with sync_clock_time_per_day: True)

Hi,

So, as the title says, clock is no longer syncing. At first I thought it was a Daylight Saving Time issue since I noticed it yesterday, but now I'm not sure anymore... It's possible it hasn't been updating for a while now.

Judging by the block of code that does the daily update, it shouldn't be affected by DST since it uses the datetime library:

"""Sync the clock once per day if required."""
try:
if self._sync_clock_time_per_day == True:
now_day_of_the_week = (datetime.datetime.today().weekday()) + 1
if self._current_day_of_week < now_day_of_the_week:
currentDT = datetime.datetime.now()
updateDT = datetime.time(hour=3)
if currentDT.time() > updateDT: #Set am 3am
self.set_time(currentDT.hour, currentDT.minute, currentDT.second, now_day_of_the_week)
self._current_day_of_week = now_day_of_the_week
_LOGGER.info("Broadlink Hysen Climate device:%s Clock Sync Success...",self.entity_id)
except Exception as error:
_LOGGER.error("Failed to Clock Sync Hysen Device:%s,:%s",self.entity_id,error)

Running the following commands in the HA docker container does return the correct values:

bash-5.0# python -c "import datetime; import time; print(datetime.time(hour=3))"
03:00:00
bash-5.0# python -c "import datetime; import time; print(datetime.datetime.now().time())"
11:11:53.524855

So line 963 should be ok.

I'll dive a bit deeper today/tonight and update here. Just posting the issue in case anyone noticed the same and might already have a solution 😉

Unable to connect to Thermostat

Hello,

Thank you for this component!

I have just installed the latest version from the master branch and I can't connect to 3 of my thermostats.

I have 4 Beok/Floureon thermostats on my config file as follow, only climate.parents_uf is available in Home Assistant. What am I doing wrong?

climate:

  • platform: hysen
    devices:
    lr_extension_uf:
    name: LR Extension UF
    host: 192.168.30.167
    mac: "34:EA:XX:XX:XX:XX"
    parents_uf:
    name: Parents UF
    host: 192.168.30.44
    mac: "34:EA:XX:XX:XX:XX"
    living_room_uf:
    name: Parents UF
    host: 192.168.30.73
    mac: "34:EA:XX:XX:XX:XX"
    bathroom_uf:
    name: Bathroom UF
    host: 192.168.30.38
    mac: "34:EA:XX:XX:XX:XX"

2020-06-21 21:20:12 ERROR (MainThread) [custom_components.hysen.climate] Failed to connect to Broadlink Hysen device MAC:34:EA:XX:XX:XX:XX, IP:192.168.30.167, Error:[Errno 9] Bad file descriptor
2020-06-21 21:20:13 ERROR (MainThread) [custom_components.hysen.climate] Failed to connect to Broadlink Hysen device MAC:34:EA:XX:XX:XX:XX, IP:192.168.30.73, Error:[Errno 9] Bad file descriptor
2020-06-21 21:20:14 ERROR (MainThread) [custom_components.hysen.climate] Failed to connect to Broadlink Hysen device MAC:34:EA:XX:XX:XX:XX, IP:192.168.30.38, Error:[Errno 9] Bad file descriptor

Thank you

Unavailable

After setting up the integration using HACS with only MAC and IP modification according my settings, sensors appear unavailable.

Long home assistant startup time

After adding this plugin and 5 thermostats, config check/restart takes around 2 minutes and cpu load 100% during this time, is there any way to make it faster?

image

Broken in hass 0.96.0

Hi

Just upgraded to home-assistant 0.96.0 and get this message on config test:

Failed config
  General Errors: 
    - Platform not found: climate.hysen

Successful config (partial)
1

Config which has worked and not changed for a long time:

  - platform: hysen
    scan_interval: 15
    devices:
      kjellerbad:
        name: Kjellerbad
        host: 192.168.1.25
        mac: '34:ea:34:7a:e7:fe'
        target_temp_default: 25
        target_temp_step: 1
        sync_clock_time_per_day: True
        #current_temp_from_sensor_override: 0 # if this is set to 1 always use the internal sensor to report current temp, if 1 always use external sensor to report current temp.
        update_timeout: 5

Did a git pull to latest version. No change.

device_state_attributes deprecated

After updating to Home Assistant 2021.12 this warning appears in logs:

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:549 First occurred: 20:25:57 (1 occurrences)
Last logged: 20:25:57

Entity climate.termostato (<class 'custom_components.hysen.climate.HASS_Hysen_Climate_Device'>) implements device_state_attributes. Please report it to the custom component author.

As I read, it's necessary to change 'device_state_attributes' with 'extra_state_attributes'

Failed to Authenticate with Broadlink Hysen Climate

Logger: custom_components.hysen.climate
Source: custom_components/hysen/climate.py:547
Integration: hysen (documentation, issues)
First occurred: 11:16:37 PM (2 occurrences)
Last logged: 11:16:37 PM

Failed to Authenticate with Broadlink Hysen Climate device:climate.beok_salon , ('broadlink_response_error: ', 'The device is offline')
Failed to add Broadlink Hysen Climate device:beok_salon @192.168.1.130, C8:F7:42:FA:: , to HA

Version: 028ad34
Configuration YAML
climate:

  • platform: hysen
    devices:
    beok_salon:
    name: beok_salon
    host: 192.168.1.130
    mac: "C8:F7:42:FA::"

Crash on socket.timeout: timed out

Hi

I'm on latest version. I sometimes get these errors:

Mar 01 09:11:22 home-assistant hass[6262]: 2019-03-01 09:11:22 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Mar 01 09:11:22 home-assistant hass[6262]: Traceback (most recent call last):
Mar 01 09:11:22 home-assistant hass[6262]: File "/root/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 289, in _handle_service_pl
atform_call
Mar 01 09:11:22 home-assistant hass[6262]: await getattr(entity, func)(**data)
Mar 01 09:11:22 home-assistant hass[6262]: File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
Mar 01 09:11:22 home-assistant hass[6262]: result = self.fn(*self.args, **self.kwargs)
Mar 01 09:11:22 home-assistant hass[6262]: File "/root/.homeassistant/custom_components/hysen/climate.py", line 673, in turn_off
Mar 01 09:11:22 home-assistant hass[6262]: self._broadlink_device.set_power(HYSEN_POWEROFF)
Mar 01 09:11:22 home-assistant hass[6262]: File "/root/homeassistant/lib/python3.6/site-packages/broadlink/init.py", line 725, in set_power
Mar 01 09:11:22 home-assistant hass[6262]: self.send_request(bytearray([0x01,0x06,0x00,0x00,remote_lock,power]) )
Mar 01 09:11:22 home-assistant hass[6262]: File "/root/homeassistant/lib/python3.6/site-packages/broadlink/init.py", line 616, in send_request
Mar 01 09:11:22 home-assistant hass[6262]: response = self.send_packet(0x6a, request_payload)
Mar 01 09:11:22 home-assistant hass[6262]: File "/root/homeassistant/lib/python3.6/site-packages/broadlink/init.py", line 305, in send_packet
Mar 01 09:11:22 home-assistant hass[6262]: response = self.cs.recvfrom(2048)
Mar 01 09:11:22 home-assistant hass[6262]: socket.timeout: timed out
Mar 01 09:12:23 home-assistant hass[6262]: 2019-03-01 09:12:23 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Mar 01 09:12:23 home-assistant hass[6262]: Traceback (most recent call last):
Mar 01 09:12:23 home-assistant hass[6262]: File "/root/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 289, in _handle_service_pl
atform_call

Since it says timeout, I'm guessing the hysen doesn't reply. Should this be handled better instead of a crash?

name ‘calculate_crc16’ is not defined

After update Home Assistant (Hassio) from 0.108.5 to 0.108.6 in log happens the next error:
Logger: custom_components.hysen.climate
Source: custom_components/hysen/climate.py:891
Failed to get Data from Broadlink Hysen Device:climate.main_thermostat,:name ‘calculate_crc16’ is not defined

hysen_set_time schedule

Hello, how can I set a schedule in the thermostat via hysen_set_time schedule if loop_mode mode is set: 2 (1234567) without weekend_period?

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.