During an evening of Hobbying, we added Thermosmart as a setpoint device in the home assistant, so that we can directly operate the thermostat in the overview (or whatever you want). The firmware used is the new one from Plugwise. I don’t know if this works with older firmware or firmware of wichers.
This is only an alternative to the work of wichers, but our approach was more to be able to control the thermostat in a fairly simple way using the home assistant.
To start, we created virtual sensors in configuration.yaml to read the setpoint and current temperature:
sensor:
- platform: rest
name: Thermosmart_temp
resource: http://{ip_thermosmart}/thermostat.xml
value_template: '{{ value_json.thermostat.temperature }}'
scan_interval: 30
- platform: rest
name: Thermosmart_setpoint
resource: http://{ip_thermosmart}/thermostat.xml
value_template: '{{ value_json.thermostat.setpoint | float }}'
scan_interval: 30
Then there are a set of REST commands to write the data to the local thermosmart:
rest_command:
set_thermostat_setpoint:
url: "http://{ip_thermosmart}/thermostat.xml"
method: POST
payload: "svset={{ setpoint }}"
set_thermosmart_off:
url: "http://{ip_thermosmart}/thermostat.xml"
method: POST
payload: "pause={{ 1 }}"
set_thermosmart_on:
url: "http://{ip_thermosmart}/thermostat.xml"
method: POST
payload: "pause={{ 0 }}"
And climate device was made to control the whole thing:
climate:
- platform: generic_thermostat
name: Thermosmart
heater: switch.thermosmart
target_sensor: sensor.Thermosmart_temp
min_cycle_duration:
minutes: 15
precision: 0.5
Once the code has been entered in the configuration.yaml, check whether the code is correct and reboot Home Assistant. (of course {ip_thermosmart} must be replaced by the fixed IP of the themosmart thermostat)
We then created a Card for the themosmart:
type: thermostat
entity: climate.thermosmart
features:
- type: climate-hvac-modes
hvac_modes:
-heat
- 'off'
To get it all working, we have created a number of automations:
One to read the setpoint of the thermosmart and write it in HA (in case someone has manually set the temperature:
alias: thermosmart read setpoint
description: ""
trigger:
- platform: state
entity_id:
- sensor.thermosmart_setpoint
condition: []
action:
- service: climate.set_temperature
data_template:
entity_id: climate.thermosmart
temperature: "{{ states('sensor.thermosmart_setpoint') }}"
mode: single
One to send the adjusted setpoint to thermosmart:
alias: Thermosmart setpoint
description: ""
trigger:
- platform: state
entity_id:
- climate.thermosmart
attribute: temperature
action:
- service: rest_command.set_thermostat_setpoint
data_template:
setpoint: "{{ state_attr('climate.thermosmart', 'temperature') }}"
- service: system_log.write
data_template:
message: "Setpoint value: {{ state_attr('climate.thermosmart', 'temperature') }}"
enabled: false
One to turn on the thermosmart (take it out of pause):
alias: Thermosmart on
description: ""
trigger:
- platform: state
entity_id:
- climate.thermosmart
from: "off"
to: null
condition: []
action:
- service: rest_command.set_thermosmart_on
dates: {}
- service: system_log.write
data_template:
message: Thermostat off
enabled: false
mode: single
and one to put the Themosmart in pause:
alias: Thermosmart out
description: ""
trigger:
- platform: state
entity_id:
- climate.thermosmart
from: null
to: "off"
condition: []
action:
- service: rest_command.set_thermosmart_off
dates: {}
- service: system_log.write
data_template:
message: Thermostat off
enabled: false
mode: single
You can then set the thermosmart like any other climate device within the home assistant.
So also through automations or alike. make a schedule.
We are absolutely no pros so any improvement is more than welcome. Hopefully someone can do something with this.