Beta for Hysen thermostats powered by broadlink

All works fine :slight_smile:Got some of my Thermostats loaded in hass.io as a test. Just need to add that the MAC-Address needs to be in hex, small letters only.

Cant figure out how to make the Thermostats appear in Hass in the order I want them. But part from that all good :slight_smile: Thanks again for a super coding :slight_smile:


1|371x499

Excellent glad to see you got it working :slight_smile:

This works extremly well for me, thank you! Any way I can help (I’m currently figuring out Python) or buy you a coffee?

On a side note: this works with my Google Home Mini. So far I figured out that the command “okay google, set the temperature to 35 degrees Celcius” works like a charm. However I haven’t figured out how to control other things by voice so if anybody knows:
-is there a way (besides creating a routine) to tell Google Home e.g. “Set the temperature to 35 degress tomorrow at 8 A.M.?”. Google isn’t very helpful and I want my home to be automated…
-is there a way to switch from Auto to Manual via voice command?

Sorry can’t help you there, the core is based on the home assistant climate component, if that doesn’t support the Google home expressions, I know myself it’s limited with Alexa, then I think the only choice is to create your own.

Hi! Which thermostats are you using for this? I have tried one seemingly identical thermostat branded Moeshouse, but the custom component wasn’t able to connect to it.

HY02B05-WIFI 16A version for underfloor heating?

Edit: After some considerations on alternatives I deceided on the Beok TOL313 16A thermostat for underfloor heating. This way I am pretty sure I either the custom component made by @mark.carter or @clemental will work. Clemental’s component can be found here:

Thank you for this component. Works flawlessly.

Do you plan to open a PR for it?

HI,

I bought that one a BYC17.GH3 from Floureon with WIFI, so far all ok, the app “weback” works and it is connected to my WIFI network. I assigned for that device a fix IP adress but with this solution given in the OP it is not working with HASSIO, watever I use as MAC adress is given me the same result.

  • platform: broadlink --> I remained the file hence just broadlink
    name: Groundfloor
    host: 10.0.0.21
    mac: ‘b4e62d47c37d’ --> MAC is B4:E6:2D:47:C3:7D
    target_temp_default: 22
    target_temp_step: 0.5
    scan_interval: 15

018-10-01 19:45:50 WARNING (MainThread) [homeassistant.loader] You are using a custom component for climate.broadlink 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-01 19:45:58 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform broadlink
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/broadlink.py”, line 61, in setup_platform
mac_addr = binascii.unhexlify(config.get(CONF_MAC).encode().replace(b’:’, b’’))
binascii.Error: Non-hexadecimal digit found

to cut of the MAC conversion from

mac_addr = binascii.unhexlify(config.get(CONF_MAC).encode().replace(b’:’, b’’))

mac_addr = config.get(CONF_MAC)

let be bypass that but leads to subseq. errors later

ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform broadlink
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/broadlink.py”, line 72, in setup_platform
broadlink_device.auth()
File “/usr/local/lib/python3.6/site-packages/broadlink/init.py”, line 228, in auth
response = self.send_packet(0x65, payload)
File “/usr/local/lib/python3.6/site-packages/broadlink/init.py”, line 263, in send_packet
packet[0x2a] = self.mac[0]
TypeError: an integer is required

Anyone got that BYC17.GH3 active in HASSIO?

Hi, the BEOK TOL-313 works fine for me. I bought it on Aliexpress at a good price. The only downside of this thermostat is that you cannot set a different schedule for each day. The week schedule is for all days from Monday to Friday. So I’m going to control the thermostat using the manual mode and the time platform of HA to trigger the changes of temperature on each day. I will also combine the thermostat management with some door/window sensors to turn off heating when the window or door is opened. I’ll try to make a web page to fully explain my settings. Let me know if you’re interesting in some feedback…

You need to use my custom code in this thread and setup you thermostat like this
climate:

  • platform: broadlinkHysen
    name: Main Thermostat
    host: 192.168.10.101
    mac: ‘34:EA:33:87:5B:7B’
    target_temp_default: 20
    target_temp_step: 0.5
    scan_interval: 15

you could have problems as there is another platform: broadlink I believe in the Hassio core. Not on the MAC is a full one not redacted

@eifinger, Hi thanks for the feedback, I was hoping for the testing to go well and if it does then I will hand it over to the community to put into the build if thay see fit.

It would be great to share some ideas on the automations, schedueles and GUI controls in HA :slight_smile: I was also thinking of making use of HA for a dynamic thermostat based on presence, zone detection, weather forecast ++ that influence indoor temp.

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.

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

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

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?

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

Thanks, I will try later :slight_smile:

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

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)?