Beta for Hysen thermostats powered by broadlink


#21

You are right with the component name there is a standard one which is not working as well.

It looks like the the BYC17.GH3 WIFI not work working with both solutions.
Of course I tried already the “standard” way with real MAC addres

  • platform: broadlinkHysen
    name: Main Thermostat
    host: 10.0.0.21
    mac: ‘B4:E6:2D:47:C3:7D’
    target_temp_default: 20
    target_temp_step: 0.5
    scan_interval: 15

or the other ways without a colon and small letters

  • platform: broadlinkHysen
    name: Main Thermostat2
    host: 10.0.0.21
    mac: ‘b4e62d47c37d’
    target_temp_default: 20
    target_temp_step: 0.5
    scan_interval: 15

all of them end up with:

018-10-02 09:48:27 WARNING (MainThread) [homeassistant.loader] You are using a custom component for climate.broadlinkHysen which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-10-02 09:48:29 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform broadlinkHysen
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/climate/broadlinkHysen.py”, line 61, in setup_platform
mac_addr = binascii.unhexlify(config.get(CONF_MAC).encode().replace(b’:’, b’’))
binascii.Error: Non-hexadecimal digit found

so I guess this model is not working so have to send it back in order to get a different one.

Anyone tried that one: Link to amazon.de

But why the MAC adress can not be converted that is strange:

binascii. unhexlify ( hexstr )

Return the binary data represented by the hexadecimal string hexstr . This function is the inverse of b2a_hex() . hexstr must contain an even number of hexadecimal digits (which can be upper or lower case), otherwise an Error exception is raised.


#22

I got it working with this one here https://www.amazon.de/dp/B075R74XQQ/ref=cm_sw_r_cp_apap_HAtLGiQNNs6I8


#23

Hi,
Ive got this working perfect using these ones from wish.com.
Floureon WIFI Thermostats.
https://www.wish.com/product/599ad5a31a98577ceeda52c0?&source=search

This is the entry I use in my config.
climate:
platform: broadlinkHysen
name: Main Thermostat
host: 10.134.149.227
mac: ‘34ea349fc295’
target_temp_default: 20
target_temp_step: 0.5
scan_interval: 15

I did some posts earlier in this thread, showing more of my setup. (and problems)
see: Beta for Hysen thermostats powered by broadlink

I can strongly recommend these Floureon Thermostats, they look good, give a good feel of quality and has a very good screen and touch functionality.
I got 12 of them working in my hass.io setup, they been running for mouth without any hiccups or problems.

Good luck to everyone,
Niklas


#24

Hi,

I finally recieved some Beok BT-313 thermostats. They are configures in the app, but I am unable to get them working in HA. PS! I am running HA in docker, not HASSio.

Would someone please have a look at the log and config below to and let me know if you have any suggestions for me to try? Many thanks in advance :slight_smile:

Excerpt from config file:
Climate:
- platform: broadlinkHysen
name: Bathroom thermostat
host: 192.168.20.50
mac: 34:EA:34:9F:C7:C5
target_temp_default: 20
target_temp_step: 0.5
scan_interval: 15

Excerpt from the HA log:
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/climate/broadlinkHysen.py”, line 74, in setup_platform
BroadlinkHysenClimate(hass, name, broadlink_device, target_temp_default, target_temp_step, operation_list)
File “/config/custom_components/climate/broadlinkHysen.py”, line 120, in init
self.update()
File “/config/custom_components/climate/broadlinkHysen.py”, line 356, in update
self.HysenData = self._broadlink_device.get_full_status()
File “/usr/local/lib/python3.6/site-packages/broadlink/init.py”, line 648, in get_full_status
payload = self.send_request(bytearray([0x01,0x03,0x00,0x00,0x00,0x16]))
File “/usr/local/lib/python3.6/site-packages/broadlink/init.py”, line 628, in send_request
raise ValueError(‘hysen_response_error’,‘first byte of response is not length’)
ValueError: (‘hysen_response_error’, ‘first byte of response is not length’)

I notice there is no folder in my container host named:
/usr/local/lib/python3.6/site-packages/broadlink/

Might this be an issue related to missing file/folder for init.py?


#25

@Svellem, only thing I can see put your mac, in quotes mac: ‘34:EA:34:9F:C7:C5’


#26

Thanks, I will try later :slight_smile:


#27

work with Beok TDS23 WI-FI-WP

But i dont understand why it show me 5 °C when it is off
Off 5 °C
Now: 22.5 °C

and i dont see this sensors

  • sensor.thermostat_heating_state
  • sensor.thermostat_auto_override

is it from attributes of climate.thermostat ?

my climate.thermostat has such attributes

current_temperature: 22.5
min_temp: 5
max_temp: 35
temperature: 26
target_temp_step: 0
operation_mode: auto
operation_list: heat,auto
remote_lock: 0
power_state: 1
heating_active: 1
auto_override: 1
sensor_mode: 0
external_sensor_temprange: 0
deadzone_sensor_temprange: 1
loop_mode: 0
roomtemp_offset: 0
anti_freeze_function: 0
poweron_mem: 0
external_temp: 0
clock_hour: 4
clock_min: 49
clock_sec: 53
day_of_week: 2
week_day: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
week_end: [object Object],[object Object]
friendly_name: thermostat
supported_features: 4225


#28

Hi! I took Mark’s code and began working on the module to add some new features and to hopefully get it in a shape that a PR could be made to get it to home-assistant. So far I’ve just done a bit of cleanups and added support for external temperature sensors.

The repo is here: https://github.com/mairas/hysen

At the moment I’m debugging why the module barfs if there are multiple sensors configured. Other improvements I’d like to make are supporting automatic device discovery (although I’m not sure how feasible that is) and device configuration using services.

@mark.carter, would you mind verifying that your code is licensed under Apache License 2.0 (the same license Home Assistant itself uses)?


#29

@mairas, yep feel free to do what you want with the code I put together, I had intended to get it into Home Assistant but other things have got in the way :slight_smile:)

On the auto discovery, if you look in the base broadlink there is a method to do autodiscovery (broadlink.discover), however I found it to be a little bit hit and miss, so opted for the declared version.


#30

Yes, I found the discovery method and that’s what I thought of using. However, HA’s standard discovery uses an external netdisco module and is based on UPnP and mDNS. I’m not yet sure how to incorporate custom discovery methods there.

I guess the best of both worlds would be that you find the devices with autodiscovery and then save them. Then the previously discovered thermostats could work as reliably as the statically declared ones.


#31

In case anyone is using the device with an external temperature sensor: have you noticed that the device would randomly revert back to the internal sensor? That has happened to me a couple of times and I don’t really see how the component code (either Mark’s or my own) could do that.

It’s really annoying because my bathroom thermostat is not even in the bathroom, so the floor had heated up to a balmy 31°C for a couple of days.


#32

Bummer. If I tweak the temperature back and forth via HA, the device eventually reverts back to the internal sensor. Apparently the low level message format is not quite right. :frowning:


#33

Great component. Is there a way to add the internal and external temp sensor readings as HA sensors? I want to view them on a graph in Grafana.


#35

Rassu2 on these type you can you the two sensors one as temp and one as limiting temp, to display as a sensor something like this should work

  • platform: template
    sensors:
    house_thermostat_ExternalSenorTemp:
    icon_template: mdi:fire
    friendly_name: “External Senor Temp”
    value_template: “{{house_thermostat_MainSenorTemp.attributes.external_temp}}”
    unit_of_measurement: “°C”

#36

@mairas, I’ve started using the external sensor, but only fully not as a limiting sensor and have not seen it switch back, I will try take a look


#37

@mairas, sorry only just seen you have started a github for this, I’ve made a couple of changes I will see if I ca n work on that


#38

This didn’t work unfortunately.

Doesn’t the thermostat send the temp measurement with MQTT?


#39

@Raasu2, nope it does not send over MQTT

sorry my example was rubbish, try this this is what I use for some of the states and I’ve added external temp.
I’m just testing it !!!

- platform: template
sensors:
house_thermostat_heating_state:
icon_template: mdi:fire
friendly_name: “Heating Demand”
value_template: “{% if states.climate.house_thermostat.attributes.heating_active == 1 %}On{% else %}Off{% endif %}”
house_thermostat_auto_override:
icon_template: mdi:flash-outline
friendly_name: “Auto Override”
value_template: “{% if states.climate.house_thermostat.attributes.auto_override == 1 %}On{% else %}Off{% endif %}”
house_thermostat_externalsensortemp:
icon_template: mdi:fire
friendly_name: “External Sensor Temp”
value_template: “{{states.climate.house_thermostat.attributes.external_temp}}”
unit_of_measurement: “°C”


#40

Working on mine :slight_smile:


#41

Hi Mark,

Thanks, made you a collaborator in the repo.

Re the thermostat switching back to internal sensor - the issue is a bit difficult to debug because it doesn’t happen consistently. I do get the following error often on HA startup, and I think it might be related to that:

  File "/home/homeassistant/.homeassistant/custom_components/climate/hysen.py", line 410, in update
    self.HysenData = self._broadlink_device.get_full_status()
  File "/srv/homeassistant/venv/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/venv/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'