Hello,
I’m trying to add Shelly TRV’s with MQTT. With Shelly plugin bulk actions are not safe (some devices do not change temperature) I switched to MQTT. Thats working well so far, but I’ve a problem with device state/mode. Im using this config:
- name: "Thermostat NAME"
unique_id: trv-TRVID
modes:
- "off"
- "heat"
min_temp: 4
max_temp: 31
temp_step: 1
precision: 1.0
temperature_unit: "C"
icon: mdi:thermostat
mode_state_topic: shellies/trv-TRVID/info
mode_state_template: >
{% if value_json.thermostats[0].target_t.value > 4 %}
heat
{% else %}
off
{% endif %}
current_temperature_topic: shellies/trv-TRVID/info
current_temperature_template: "{{ value_json.thermostats[0].tmp.value }}"
temperature_state_topic: shellies/trv-TRVID/info
temperature_state_template: "{{ value_json.thermostats[0].target_t.value }}"
temperature_command_topic: shellies/trv-TRVID/thermostat/0/command/target_t
- name: "Thermostat NAME Ventil"
state_topic: 'shellies/trv-TRVID/info'
value_template: '{{ value_json.thermostats[0].pos }}'
unique_id: trv-TRVID_valve
icon: mdi:pipe-valve
unit_of_measurement: '%'
- name: "Thermostat NAME Batterie"
state_topic: 'shellies/trv-TRVID/info'
value_template: '{{ value_json.bat.value }}'
unique_id: trv-TRVID_batterie
icon: mdi:battery
unit_of_measurement: '%'
My problem is that the mode is not set correctly (heat is only when changing the temperature, I think this is the optimistic mode feature) and I’ missing the settings for off and Low. Can someone give me more information how to implement the missing part ?