Beta for Hysen thermostats powered by broadlink


#1

All,
Attached is a beta of a climate control for the Hysen thermostats powered by broadlink, feel free to test and enhance take as needed.

I’ve included the config I have set up to get it working in hassio.

The heating state are off/heat/auto, due to the manual state not working with Alexa, also Alexa reports the device is not responding but it does (bug is hassio I think).

Capture1

RENAME broadlinkHysen.py
broadlinkHysen.yaml (16.3 KB)

PUT broadlinkHysen.py in your costom_components/climate folder in Hassio as per

IN CONFIGURATION.YAML
climate:

  • platform: broadlinkHysen
    name: Main Thermostat
    host: 192.168.10.101
    mac: ‘XX:XX:XX:XX:XX:XX’
    target_temp_default: 20
    target_temp_step: 0.5
    scan_interval: 15

IN GROUPS.YAML
Heating:
view: no
icon: mdi:home
entities:
- climate.main_thermostat
- sensor.main_thermostat_heating_state
- sensor.main_thermostat_auto_override


Floor heat Thermostat
#2

Hi! I try it with my thermostat BEOK BOT-313WIFI and work great!
Thank you!


#3

Hello mark.carter. Help me please!!!

I have configured your configuration in the configuraction.yaml file and group but it does not appear in HA, I have previously performed the steps of the installation Floor heat Thermostat and when I launch the last command it detects me the 3 broadlink devices (rmpro, rmmini and beok) giving me repeatedly the temperature information of the beok that detects it to me as Hysen heating controller, what I have been able to verify is that in HA it does not detect the entities that are added in the group.yaml

  • climate.main_thermostat
  • sensor.main_thermostat_heating_state
  • sensor.main_thermostat_auto_override

What can my error or failure be? Thank you.


#4

Sorry I’m at a loss, mine is working perfectly…


#5

Hi, Trying your code on Hass.IO, I get an error message in the “broadlinkHysen.yaml” saying: end of the stream or a document separator is expected at line 1, column 3:
“”"
^

What can that be? I cant see any easy errors (Im not a good programmer), Why do I get this error and you not ? Please advice what to do next.
I got 11 of these Thermostats in the house and Im now running the “Broadlink finder MQTT” script on another server, I like the idea of having it directly working under Hass.IO.

Rgds.
Niklas

/Edit:

I found a second file in the “climate” folder named “_broadlinkHysen.yaml”
In that file this message was written.

‘utf-8’ codec can’t decode byte 0xb0 in position 37: invalid start byte


#6

Hi Niklas i am away until Friday I will get back to you then. It just looks like the config download you have is corrupt somehow I will post elsewhere on Friday and let you get it from there
Mark


#7

Im so sorry, I missed the “RENAME” from yaml to py … (Took some coffee to get that …)

But I still get a message saying : while setting up platform broadlinkHysen
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/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

Nothing odd with my mac adress… Something else I dont see?


#8

:slight_smile: Well… Sometime its not easy being Swedish :slight_smile:

Got it working, Had to add the MAC Address like this

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

No : in between. So the example you gave here didnt work for me.
Adding the MAC Address in one single row without any : made it work.

Thanks for a superb coding :slight_smile: Got this working like a charm…


#9

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


#10


#11

Excellent glad to see you got it working :slight_smile:


#12

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?


#13

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.


#14

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:


#15

Thank you for this component. Works flawlessly.

Do you plan to open a PR for it?


#16

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?


#17

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…


#18

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


#19

@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.


#20

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.