Hi,
Here is my existing setup: I have a mix of Insteon and Z-Wave devices, all attached to an ISY994i. Plus other devices such as a DSC alarm. I recently purchased two z-wave thermostats (CT101): one in my garage to control the heater and one in my basement to control my gas fireplace. The ISY detects the thermostats just fine but one of the problems with the thermostats is that they only report in Fahrenheit, and I need Celcius/Metric, being outside the United States.
HA does not yet have direct support for thermostats attached to ISY. So, for now, I decided to have HA control my thermostats through the ISY REST API. Thanks to DetroitEE and this post, I was able to figure it out. Note that I do not have a Cool option as they are only heaters. The configuration could be easily modified accordingly if needed. Also note that I could not use the GREP option with -P as it wouldnât work in HASS.io, so I decided to use AWK instead (not great, but it works). Figuring out the right options to use to correctly read the values passed on by the REST API was the biggest challenge. I use HASSio (latest build 0.59.2 as Iâm writing this).
Here is what it currently looks like in HA:
I promised I would share my configuration, so here it is. Iâm using a split configuration with import file to make it easier.
In configuration.yaml:
homeassistant: customize: !include customize.yaml sensor: !include sensors.yaml input_number: !include input_numbers.yaml input_select: !include input_selects.yaml rest_command: !include rest_commands.yaml group: !include groups.yaml automation: !include automations.yaml
In sensors.yaml:
# ============== Garage thermostat sensors ============== - platform: command_line name: "Garage Temp" command: /usr/bin/curl --user username:password "http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_1/ST" 2>&1 | awk -F"\"" '{print $8}' value_template: '{{ (((value_json/10-32)/1.8)/5) | round(1)*5 }}' unit_of_measurement: "°C" scan_interval: 5 - platform: command_line name: Garage Heat Setpoint command: /usr/bin/curl --user username:password "http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_1/CLISPH" 2>&1 | awk -F"\"" '{print $8}' value_template: '{{ (((value_json-32)/1.8)/5) | round(1)*5 }}' unit_of_measurement: "°C" scan_interval: 10 - platform: command_line name: Garage Thermostat Mode command: /usr/bin/curl --user username:password "http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_1/CLIMD" 2>&1 | awk -F"\"" '{print $10}' scan_interval: 10 - platform: command_line name: Garage Thermostat State command: /usr/bin/curl --user username:password "http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_1/CLIHCS" 2>&1 | awk -F"\"" '{print $10}' scan_interval: 5 # ============== Basement thermostat sensors ============== - platform: command_line name: "Basement Temp" command: /usr/bin/curl --user username:password "http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_2/ST" 2>&1 | awk -F"\"" '{print $8}' value_template: '{{ (((value_json/10-32)/1.8)/5) | round(1)*5 }}' unit_of_measurement: "°C" scan_interval: 5 - platform: command_line name: Basement Heat Setpoint command: /usr/bin/curl --user username:password "http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_2/CLISPH" 2>&1 | awk -F"\"" '{print $8}' value_template: '{{ (((value_json-32)/1.8)/5) | round(1)*5 }}' unit_of_measurement: "°C" scan_interval: 10 - platform: command_line name: Basement Thermostat Mode command: /usr/bin/curl --user username:password "http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_2/CLIMD" 2>&1 | awk -F"\"" '{print $10}' scan_interval: 10 - platform: command_line name: Basement Thermostat State command: /usr/bin/curl --user username:password "http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_2/CLIHCS" 2>&1 | awk -F"\"" '{print $10}' scan_interval: 5
In input_numbers.yaml:
garage_heat_setpoint: name: Garage Heat Setpoint min: 10 max: 24 step: 0.5 mode: slider icon: mdi:thermometer unit_of_measurement: °C basement_heat_setpoint: name: Basement Heat Setpoint min: 10 max: 24 step: 0.5 mode: slider icon: mdi:thermometer unit_of_measurement: °C
In input_selects.yaml:
garage_thermostat_mode: name: Thermostat Mode options: - Heat - "Off" icon: mdi:gauge basement_thermostat_mode: name: Thermostat Mode options: - Heat - "Off" icon: mdi:gauge
In rest_commands.yaml:
# =================== Garage Thermostat =================== garage_thermostat_mode_off: url: http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_1/cmd/CLIMD/0 username: !secret isy_username password: !secret http_password garage_thermostat_mode_heat: url: http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_1/cmd/CLIMD/1 username: !secret isy_username password: !secret http_password garage_thermostat_heat_setpoint: url: 'http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_1/cmd/CLISPH/{{ (states.input_number.garage_heat_setpoint.state | float * 1.8 + 32) | round(0) }}' username: !secret isy_username password: !secret http_password # =================== Basement Thermostat =================== basement_thermostat_mode_off: url: http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_2/cmd/CLIMD/0 username: !secret isy_username password: !secret http_password basement_thermostat_mode_heat: url: http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_2/cmd/CLIMD/1 username: !secret isy_username password: !secret http_password basement_thermostat_heat_setpoint: url: 'http://MyIPAddress/rest/nodes/ZW_NODEADDRESS_2/cmd/CLISPH/{{ (states.input_number.basement_heat_setpoint.state | float * 1.8 + 32) | round(0) }}' username: !secret isy_username password: !secret http_password
In groups.yaml:
garage_thermostat: name: 'Garage Heater' icon: mdi:thermometer entities: - sensor.garage_temp - input_select.garage_thermostat_mode - sensor.garage_thermostat_state - sensor.garage_heat_setpoint - input_number.garage_heat_setpoint - sensor.garage_humidity_sensor basement_thermostat: name: 'Basement Fireplace' icon: mdi:thermometer entities: - sensor.basement_temp - input_select.basement_thermostat_mode - sensor.basement_thermostat_state - sensor.basement_heat_setpoint - input_number.basement_heat_setpoint
In customize.yaml
sensor.garage_temp: friendly_name: 'Current Temperature' icon: mdi:thermometer sensor.garage_thermostat_mode: friendly_name: 'Mode' icon: mdi:thermometer-lines input_select.garage_thermostat_mode: friendly_name: 'Mode' icon: mdi:thermometer-lines sensor.garage_thermostat_state: friendly_name: 'State' icon: mdi:eye sensor.garage_heat_setpoint: friendly_name: 'Existing Heat Target' icon: mdi:bullseye input_number.garage_heat_setpoint: friendly_name: 'Heat Setpoint' icon: mdi:gesture-tap sensor.garage_humidity_sensor: friendly_name: 'Humidity Sensor' icon: mdi:water-percent sensor.house_humidity_sensor: friendly_name: 'House Humidity Sensor' icon: mdi:water-percent sensor.basement_temp: friendly_name: 'Current Temperature' icon: mdi:thermometer sensor.basement_thermostat_mode: friendly_name: 'Mode' icon: mdi:thermometer-lines input_select.basement_thermostat_mode: friendly_name: 'Mode' icon: mdi:thermometer-lines sensor.basement_thermostat_state: friendly_name: 'State' icon: mdi:eye sensor.basement_heat_setpoint: friendly_name: 'Existing Heat Target' icon: mdi:bullseye input_number.basement_heat_setpoint: friendly_name: 'Heat Setpoint' icon: mdi:gesture-tap
In automations.yaml (formatting is a little weird because of the HA Automation Editor):
- id: Set_Garage_Thermostat_Mode_to_Heat alias: Set Garage Thermostat Mode to Heat trigger: - entity_id: input_select.garage_thermostat_mode platform: state to: "Heat" action: service: rest_command.garage_thermostat_mode_heat - id: Set_Garage_Thermostat_Mode_to_Off alias: Set Garage Thermostat Mode to Off trigger: - entity_id: input_select.garage_thermostat_mode platform: state to: "Off" action: service: rest_command.garage_thermostat_mode_off - id: Garage_Heat_Setpoint alias: Garage Heat Setpoint Slider trigger: - entity_id: input_number.garage_heat_setpoint platform: state action: service: rest_command.garage_thermostat_heat_setpoint - id: Set_Basement_Thermostat_Mode_to_Heat alias: Set Basement Thermostat Mode to Heat trigger: - entity_id: input_select.basement_thermostat_mode platform: state to: "Heat" action: service: rest_command.basement_thermostat_mode_heat - id: Set_Basement_Thermostat_Mode_to_Off alias: Set Basement Thermostat Mode to Off trigger: - entity_id: input_select.basement_thermostat_mode platform: state to: "Off" action: service: rest_command.basement_thermostat_mode_off - id: Basement_Heat_Setpoint alias: Basement Heat Setpoint Slider trigger: - entity_id: input_number.basement_heat_setpoint platform: state action: service: rest_command.basement_thermostat_heat_setpoint
I hope this is useful to someone. Note that this would work exactly the same for Insteon thermostats, but you may have to play with the numbers (divide or multiply by 2, as reported elsewhere). For now the configuration above works well for what I need.
Please let me know if you have any questions.
Cheers,