Note: This is only for folks who have the Universal Devices ISY-994i controller. This also works for z-wave thermostats connected to the ISY, with the small modification that you do not multiply the desired temperature by 2 when using the ISY REST API to set the desired temperature.
The problem: No native HA support for the Insteon thermostat.
The solution: Use command line sensors and scripts to extract thermostat data to interact with the ISY-994i REST API. Thanks to this thread I was able to figure out how to use grep commands to pull out the thermostat data from the XML result from the ISY REST API.
The first thing you need to do is find out the node ID for your thermostat; to do that, go to http://ISYipaddress/rest/nodes and search this list for “thermostat”. You should find a 7 digit node address that corresponds to the thermostat. You will need to use that node address for all of these rest commands (include spaces exactly as written in the node address!!). When you enter the address into the URL field, the browser will reformat the node address into a variation where it replaces the spaces with %20; this format is it how I entered the URL into my config files. I haven’t tried using spaces in the URL in the config files, so I can’t say for sure if that would work.
Snip from the REST response to the URL above:
Here’s the sensor configuration:
- platform: command_line
name: House Temp
command: '/usr/bin/curl --user ISYusername:ISYpassword "http://ISYipaddress/rest/nodes/ThermostatNodeAddress/ST" 2>&1 | grep -oPm1 "(?<=formatted=\")[0-9.]+"'
value_template: '{{ value | round(1) }}'
unit_of_measurement: °F
scan_interval: 5
- platform: command_line
name: House Humidity
command: '/usr/bin/curl --user ISYusername:ISYpassword "http://ISYipaddress/rest/nodes/ThermostatNodeAddress/CLIHUM" 2>&1 | grep -oPm1 "(?<=formatted=\")[0-9]+"'
unit_of_measurement: 'percent'
scan_interval: 5
- platform: command_line
name: Heat Setpoint
command: '/usr/bin/curl --user ISYusername:ISYpassword "http://ISYipaddress/rest/nodes/ThermostatNodeAddress/CLISPH" 2>&1 | grep -oPm1 "(?<=formatted=\")[0-9]+"'
unit_of_measurement: °F
scan_interval: 5
- platform: command_line
name: Cool Setpoint
command: '/usr/bin/curl --user ISYusername:ISYpassword "http://ISYipaddress/rest/nodes/ThermostatNodeAddress/CLISPC" 2>&1 | grep -oPm1 "(?<=formatted=\")[0-9]+"'
unit_of_measurement: °F
scan_interval: 5
- platform: command_line
name: Thermostat Mode
command: '/usr/bin/curl --user ISYusername:ISYpassword "http://ISYipaddress/rest/nodes/ThermostatNodeAddress/CLIMD" 2>&1 | grep -oPm1 "(?<=formatted=\")[A-Za-z]+"'
scan_interval: 5
- platform: command_line
name: Fan Mode
command: '/usr/bin/curl --user ISYusername:ISYpassword "http://ISYipaddress/rest/nodes/ThermostatNodeAddress/CLIFS" 2>&1 | grep -oPm1 "(?<=formatted=\")[A-Za-z]+"'
scan_interval: 5
REST command configuration (uses rest_command component):
heat_setpoint:
url: http://ISYipaddress/rest/nodes/ThermostatNodeAddress/set/CLISPH/{{ states.input_number.heat_setpoint.state | int * 2 }}
username: ISYusername
password: ISYpassword
cool_setpoint:
url: http://ISYipaddress/rest/nodes/ThermostatNodeAddress/set/CLISPC/{{ states.input_number.cool_setpoint.state | int * 2 }}
username: ISYusername
password: ISYpassword
thermostat_mode_off:
url: http://ISYipaddress/rest/nodes/ThermostatNodeAddress/cmd/CLIMD/0
username: ISYusername
password: ISYpassword
thermostat_mode_heat:
url: http://ISYipaddress/rest/nodes/ThermostatNodeAddress/cmd/CLIMD/1
username: ISYusername
password: ISYpassword
thermostat_mode_cool:
url: http://ISYipaddress/rest/nodes/ThermostatNodeAddress/cmd/CLIMD/2
username: ISYusername
password: ISYpassword
thermostat_mode_auto:
url: http://ISYipaddress/rest/nodes/ThermostatNodeAddress/cmd/CLIMD/3
username: ISYusername
password: ISYpassword
fan_mode_on:
url: http://ISYipaddress/rest/nodes/ThermostatNodeAddress/cmd/CLIFS/7
username: ISYusername
password: ISYpassword
fan_mode_auto:
url: http://ISYipaddress/rest/nodes/ThermostatNodeAddress/cmd/CLIFS/8
username: ISYusername
password: ISYpassword
Input numbers (sliders) used to control the heat and cool setpoints:
input_number:
heat_setpoint:
name: Heat Setpoint
min: 58
max: 72
mode: box
icon: mdi:thermometer
unit_of_measurement: °F
cool_setpoint:
name: Cool Setpoint
min: 72
max: 80
mode: box
icon: mdi:thermometer
unit_of_measurement: °F
Input select for thermostat mode and fan mode:
input_select:
thermostat_mode:
name: Thermostat Mode
options:
- Auto
- Heat
- Cool
- "Off"
icon: mdi:gauge
fan_mode:
name: Fan Mode
options:
- Auto
- "On"
icon: mdi:fan
Automations to use input selects and input numbers to control the thermostat:
- action:
service: rest_command.thermostat_mode_heat
alias: Set Thermostat Mode to Heat
id: '4'
trigger:
platform: state
entity_id: input_select.thermostat_mode
to: "Heat"
- action:
service: rest_command.thermostat_mode_cool
alias: Set Thermostat Mode to Cool
id: '5'
trigger:
platform: state
entity_id: input_select.thermostat_mode
to: "Cool"
- action:
service: rest_command.thermostat_mode_auto
alias: Set Thermostat Mode to Auto
id: '9'
trigger:
platform: state
entity_id: input_select.thermostat_mode
to: "Auto"
- action:
service: rest_command.thermostat_mode_off
alias: Set Thermostat Mode to Off
id: '6'
trigger:
platform: state
entity_id: input_select.thermostat_mode
to: "Off"
- action:
service: rest_command.fan_mode_auto
alias: Set Fan Mode to Auto
id: '7'
trigger:
platform: state
entity_id: input_select.fan_mode
to: "Auto"
- action:
service: rest_command.fan_mode_on
alias: Set Fan Mode to On
id: '8'
trigger:
platform: state
entity_id: input_select.fan_mode
to: "On"
- id: Heat Setpoint
alias: Heat Setpoint Slider
trigger:
platform: state
entity_id: input_number.heat_setpoint
action:
service: rest_command.heat_setpoint
- id: Cool Setpoint
alias: Cool Setpoint Slider
trigger:
platform: state
entity_id: input_number.cool_setpoint
action:
service: rest_command.cool_setpoint
Automations to update the setpoints, thermostat mode, and fan modes so that the communication is bi-directional (if the thermostat is manually changed, it will update in Home Assistant) Thanks to @xstrex for helping with this.
- id: Thermostat Mode Update
alias: Thermostat Mode Update
trigger:
platform: state
entity_id: sensor.thermostat_mode
action:
- service: input_select.select_option
data_template:
entity_id: input_select.thermostat_mode
option: >
{{ states.sensor.thermostat_mode.state }}
- id: Fan Mode Update
alias: Fan Mode Update
trigger:
platform: state
entity_id: sensor.fan_mode
action:
- service: input_select.select_option
data_template:
entity_id: input_select.fan_mode
option: >
{{ states.sensor.fan_mode.state }}
- id: Heat Setpoint Update
alias: Heat Setpoint Update
trigger:
platform: state
entity_id: sensor.heat_setpoint
action:
- service: input_number.set_value
data_template:
entity_id: input_number.heat_setpoint
value: >
{{ states.sensor.heat_setpoint.state }}
- id: Cool Setpoint Update
alias: Cool Setpoint Update
trigger:
platform: state
entity_id: sensor.cool_setpoint
action:
- service: input_number.set_value
data_template:
entity_id: input_number.cool_setpoint
value: >
{{ states.sensor.cool_setpoint.state }}
Add your sensors, input numbers, and input select buttons to your user interface, and you’re all set. The photo below is my HVAC group. The heat and AC switches on the bottom are “lights” that are automatically brought over from ISY, and they correspond to whether the heat or AC is on or off.
This is not an elegant way to get thermostat monitoring and control in HA, but it’s all I could figure out until there is native support for Insteon thermostats.
See xstrex’s post #11 for how to implement home/away setpoints with presence detection.