Beta for Hysen thermostats powered by broadlink

@nek1970 the command you are sending for remotelock is correct, however you do have to specify your entityid “climate.my_thermostat” was just an example, if you look on the entities page it should show you want it is something like what you have named your thermostat. No to be honest never though about dns lookup for specifying thermostat ip as your use case is pretty unique, why can’t you specify the public ip of you NY router (I assume its fixed)

my entity id is: climate.cucina
now my set is :

but i received an error: failed call.

Entering the public IP of the router means changing it every time the power goes off.

I think that with the new technology, it is very common to keep remote IOT devices under control. It might be an idea to enter the DNS protocol, as well as the ( availabily topic ) function, so that if the other side is missing current, in our HA screen, it will appear: not available

@nek1970
So in the Service Data, you should be putting {“entity_id”:“climate.cucina”,“remotelock”:1}

And if you want buttons to switch this on/off you can use an entity card

@nek1970, get the latest from here https://github.com/mcc05/hysen I’ve added the ability fro you to do a dns lookup.
remove your host entry host: 192.168.0.xx
add:
host_dns: yourdns.name.com
host_port: 80
Give it a try and let me know if it works

Great! It works!!! You gave me a nice present. I’m willing to pay your time.
Do you think it is possible to insert the - availabily topic - function to make sure that (on the other side) when there is no current on my HA display, it is unavailable?

Sorry but I’m new to HA, could you better explain how to call a call service and how to create an entity card?

So what do you mean by availability topic, this is not MQTT, it uses polling to discover if the thermostat is there or not on a scan interval.

ah already, it’s true.

@nek1970, something like below will give you a switch to turn remote lock on/off

switch:

  • platform: template
    switches:
    cucinaremotelock:
    value_template: “{{ is_state(‘climate.cucina.attributes.remotelock’, 1) }}”
    turn_on:
    service: climate.hysen_set_remotelock
    data:
    entity_id: climate.cucina
    remotelock: 1
    turn_off:
    service: climate.hysen_set_remotelock
    data:
    entity_id: climate.cucina
    remotelock: 0

I have insert the code

…but now the switch is not available

This is mine that works change it to your entity id clmate.cucina where you need to :slight_smile:Capture
`switch:

  • platform: template
    switches:
    thermostat_remote_lock:
    friendly_name: Thermostat Remote Lock
    value_template: “{{ is_state_attr(‘climate.house_thermostat’, ‘remote_lock’, 1) }}”
    turn_on:
    service: climate.hysen_set_remotelock
    data:
    entity_id: climate.house_thermostat
    remotelock: 1
    turn_off:
    service: climate.hysen_set_remotelock
    data:
    entity_id: climate.house_thermostat
    remotelock:
    `

I took inspiration from the example of the Home assistant site and I replaced the value template.
Now it works in half.

        value_template: "{{ is_state('switch.source', 'on') }}"

now my code is:
switch:

  • platform: template
    switches:
    cucinaremotelock:
    value_template: “{{ is_state(‘switch.source’, ‘on’) }}”
    turn_on:
    service: climate.hysen_set_remotelock
    data:
    entity_id: climate.cucina
    remotelock: 1
    turn_off:
    service: climate.hysen_set_remotelock
    data:
    entity_id: climate.cucina
    remotelock: 0

The button is enabled, the remotelock lights up and immediately returns to the off position.
is a switch in automation stile.
After it is not possible to remove the remote lock from HA.

Every time I push, it does not respond

See above looks like the your value template need changing, beware of the quotes at the start and end of the line if you copy it from here they mess it up, put normal ones on it

Ohhh wonderful!!! now working

Could you also write me the code for the antifreeze protection?
Is it also possible to insert the card for weekly programming? so leave the app and do everything as a home assistant?

@nek1970 so replace remote_lock with
anti_freeze_function
and the servce with climate.hysen_set_advanced on a copy of the remote_lock template and that should give you the frost protection on/off. As for the schedule setting there is no template for that that i know off yet, and at present i dont have the time to write one. As i said you can all ways use the call service function in HA to do it in the meantime

where is the error?

antifreezefuntion:
friendly_name: Anti freeze
value_template: “{{is_state_attr (‘climate.cucina’, ‘anti_freeze_function’, 1)}}”
turn_on:
service: climate.hysen_set_advanced
data:
entity_id: climate.cucina
antifreezefunciotn: 1
turn_off:
service: climate.hysen_set_advanced
data:
entity_id: climate.cucina
antifreezefunction: 0

well for starters it should be anti_freeze_function :1 and anti_freeze_function: 0

Everything works wonderfully well now. Let me offer you a drink. Kindly send me your paypal address

Just updated HA to 0.88 and got this error in the log.
Integrations need to be in their own folder. Change climate/hysen.py to hysen/climate.py. This will stop working soon.