Hello! I was having trouble getting Google Assistant to change the setpoint on my new Centralite Pearl thermostat, connected via zigbee2mqtt. I watched the events, setting a single setpoint, but the device has two setpoints, and it would not update either. I’m not sure if this is an oversight in Home Assistant to not apply a request from Google Assistant based on the current mode setting, or something else. Either way, I needed a fix! I tried a generic thermostat coupled with the climate_group HACS integration, but no luck. Finally I realized I could ‘intercept’ the google_assistant_command
event and call climate.set_temperature
based on this. Sadly it won’t fix the assistant not telling you the setpoint, but it’s something.
Find it below or at ha-config/zigbee2mqtt_thermostat_fix.yaml at main · Ceralor/ha-config (github.com)
blueprint:
name: Zigbee2mqtt Thermostat Fix for Google Home
description: Handles the setpoint for any dual-setpoint thermostats in Zigbee2MQTT, such as the Centralite Pearl
domain: automation
source_url: https://github.com/Ceralor/ha-config/blob/0c135d689ecb7a7b04e5e1fa792523df1a2ad86e/blueprints/automation/zigbee2mqtt_thermostat_fix.yaml
input:
thermostat_entity:
name: Thermostat
selector:
entity:
domain: climate
integration: mqtt
fahrenheit:
name: Convert to Fahrenheit
description: Needed if your thermostat is set to Fahrenheit
selector:
boolean:
mode: single
trigger:
- platform: event
event_type: google_assistant_command
event_data:
entity_id:
- !input thermostat_entity
execution:
- command: action.devices.commands.ThermostatTemperatureSetpoint
action:
- alias: Set Thermostat
variables:
thermostat_entity: !input thermostat_entity
fahrenheit: !input fahrenheit
- alias: Set Variables
variables:
target_temp_in_f: >-
{%- set target_in_c =
trigger.event.data.execution[0].params.thermostatTemperatureSetpoint -%}
{%- if fahrenheit -%}
{{ (target_in_c * (9.0/5.0)) + 32 | round(0) }}
{%- else -%}
{{ target_in_c }}
{%- endif -%}
mode: >-
{{- states(thermostat_entity) -}}
- if:
- condition: template
value_template: "{{ mode != 'off' }}"
then:
- service: climate.set_temperature
data:
target_temp_high: >-
{{ target_temp_in_f if 'cool' in mode else
state_attr(thermostat_entity,'target_temp_high') }}
target_temp_low: >-
{{ target_temp_in_f if 'heat' in mode else
state_attr(thermostat_entity,'target_temp_low') }}
target:
entity_id: !input thermostat_entity