Is this a problem in my setup, or is this a HA bug?
Everything done with a freshly paired Danfoss Ally TRV. The Z2M log at the end of the question.
I have paired my TRV with Z2M and named it trv.uf_office
. In the Z2M map it shows properly connected with a high LQI:
In the developer tools it represents like this:
In the dashboard I have got a Entities Card with the climate.trv_uf_office
(values here allready after update, details below):
Assume the TRV was set to 18 degrees. When I change the occupied_heating_setpoint of the TRV in the Lovelace dashboard to e.g. 23 now, then shows 23 for some seconds and then the occupied_heating_setpoint in the dashboard jumps back to 18.
But the TRV is set to 23 degrees and starts to heat after some seconds. When I check the Z2M logs, I clearly see the correct MQTT messages sent.
When I go to the Z2M Devices page, open up the view of the TRV → Exposes it shows all the values N/A or Null.
When I press the load value buttons (circulating arrows) for occupied_heating_setpoint and local_temperature then it sends the get MQTT messages and updates the vallues in the Z2M expose page and also the Lovelace dashboard.
But I would expect this to happen automatically when I change the temperature in the dashboard, and also when an autmation changes them.
To me it sounds like HA should send out the Received MQTT message on 'zigbee2mqtt/trv.uf_office/get' with data '{"occupied_heating_setpoint":""}'
message whenever a change in the dashboard entitiy happens. This shouldn’t have to be done manually.
Is this a bug? Or just a PITA?
Z2M log:
warn 2022-10-23 16:31:35: Device 'trv.uf_office' left the network
info 2022-10-23 16:31:36: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"trv.uf_office","ieee_address":"0xccccccfffe1da77a"},"type":"device_leave"}'
info 2022-10-23 16:32:03: Device 'trv.uf_office' joined
info 2022-10-23 16:32:03: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"trv.uf_office","ieee_address":"0xccccccfffe1da77a"},"type":"device_joined"}'
info 2022-10-23 16:32:03: Starting interview of 'trv.uf_office'
info 2022-10-23 16:32:03: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"trv.uf_office","ieee_address":"0xccccccfffe1da77a","status":"started"},"type":"device_interview"}'
debug 2022-10-23 16:32:21: Device 'trv.uf_office' announced itself
info 2022-10-23 16:32:21: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"trv.uf_office","ieee_address":"0xccccccfffe1da77a"},"type":"device_announce"}'
debug 2022-10-23 16:32:23: Received Zigbee message from 'trv.uf_office', type 'readResponse', cluster 'genPollCtrl', data '{"checkinInterval":1200}' from endpoint 1 with groupID 0
info 2022-10-23 16:32:23: Successfully interviewed 'trv.uf_office', device has successfully been paired
info 2022-10-23 16:32:23: Device 'trv.uf_office' is supported, identified as: Danfoss Ally thermostat (014G2461)
info 2022-10-23 16:32:23: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Ally thermostat","exposes":[{"access":1,"description":"Remaining battery in %","name":"battery","property":"battery","type":"numeric","unit":"%","value_max":100,"value_min":0},{"access":7,"description":"Enables/disables physical input on the device","name":"keypad_lockout","property":"keypad_lockout","type":"enum","values":["unlock","lock1","lock2"]},{"access":7,"description":"Controls how programming affects the thermostat. Possible values: setpoint (only use specified setpoint), schedule (follow programmed setpoint schedule). Changing this value does not clear programmed schedules.","name":"programming_operation_mode","property":"programming_operation_mode","type":"enum","values":["setpoint","schedule","eco"]},{"access":5,"description":"Is the unit in mounting mode. This is set to `false` for mounted (already on the radiator) or `true` for not mounted (after factory reset)","name":"mounted_mode_active","property":"mounted_mode_active","type":"binary","value_off":false,"value_on":true},{"access":7,"description":"Set the unit mounting mode. `false` Go to Mounted Mode or `true` Go to Mounting Mode","name":"mounted_mode_control","property":"mounted_mode_control","type":"binary","value_off":false,"value_on":true},{"access":7,"description":"Thermostat Orientation. This is important for the PID in how it assesses temperature. `false` Horizontal or `true` Vertical","name":"thermostat_vertical_orientation","property":"thermostat_vertical_orientation","type":"binary","value_off":false,"value_on":true},{"access":7,"description":"Viewing/display direction, `false` normal or `true` upside-down","name":"viewing_direction","property":"viewing_direction","type":"binary","value_off":false,"value_on":true},{"access":7,"description":"Not clear how this affects operation. However, it would appear that the device does not execute any motor functions if this is set to false. This may be a means to conserve battery during periods that the heating system is not energized (e.g. during summer). `false` No Heat Available or `true` Heat Available","name":"heat_available","property":"heat_available","type":"binary","value_off":false,"value_on":true},{"access":5,"description":"Whether or not the unit needs warm water. `false` No Heat Request or `true` Heat Request","name":"heat_required","property":"heat_required","type":"binary","value_off":false,"value_on":true},{"access":1,"description":"Values observed are `0` (manual), `1` (schedule) or `2` (externally)","name":"setpoint_change_source","property":"setpoint_change_source","type":"enum","values":["manual","schedule","externally"]},{"features":[{"access":7,"description":"Temperature setpoint","name":"occupied_heating_setpoint","property":"occupied_heating_setpoint","type":"numeric","unit":"°C","value_max":35,"value_min":5,"value_step":0.5},{"access":5,"description":"Current temperature measured on the device","name":"local_temperature","property":"local_temperature","type":"numeric","unit":"°C"},{"access":1,"description":"Position of the valve (= demanded heat) where 0% is fully closed and 100% is fully open","name":"pi_heating_demand","property":"pi_heating_demand","type":"numeric","unit":"%","value_max":100,"value_min":0},{"access":7,"description":"Mode of this device","name":"system_mode","property":"system_mode","type":"enum","values":["heat"]},{"access":1,"description":"The current running state","name":"running_state","property":"running_state","type":"enum","values":["idle","heat"]}],"type":"climate"},{"access":7,"description":"If `radiator_covered` is `true`: Set at maximum 30 minutes interval but not more often than every 5 minutes and 0.1 degrees difference. Resets every 35 minutes to standard. If `radiator_covered` is `false`: Set at maximum 3 hours interval but not more often than every 30 minutes and 0.1 degrees difference. Resets every 3 hours to standard. Value 21C = 2100 (-8000=undefined).","name":"external_measured_room_sensor","property":"external_measured_room_sensor","type":"numeric","value_max":3500,"value_min":-8000},{"access":7,"description":"Set if the TRV should solely rely on external_measured_room_sensor or operate in offset mode. `false` = Auto Offset Mode or `true` = Room Sensor Mode","name":"radiator_covered","property":"radiator_covered","type":"binary","value_off":false,"value_on":true},{"access":7,"description":"Whether or not the window open feature is enabled","name":"window_open_feature","property":"window_open_feature","type":"binary","value_off":false,"value_on":true},{"access":5,"description":"0=Quarantine, 1=Windows are closed, 2=Hold - Windows are maybe about to open, 3=Open window detected, 4=In window open state from external but detected closed locally","name":"window_open_internal","property":"window_open_internal","type":"numeric","value_max":4,"value_min":0},{"access":7,"description":"Set if the window is open or close. This setting will trigger a change in the internal window and heating demand. `false` (windows are closed) or `true` (windows are open)","name":"window_open_external","property":"window_open_external","type":"binary","value_off":false,"value_on":true},{"access":7,"description":"Exercise day of week: 0=Sun...6=Sat, 7=undefined","name":"day_of_week","property":"day_of_week","type":"enum","values":["sunday","monday","tuesday","wednesday","thursday","friday","saturday","away_or_vacation"]},{"access":7,"description":"Exercise trigger time. Minutes since midnight (65535=undefined). Range 0 to 1439","name":"trigger_time","property":"trigger_time","type":"numeric","value_max":65535,"value_min":0},{"access":7,"description":"Scale factor of setpoint filter timeconstant (\"aggressiveness\" of control algorithm) 1= Quick ... 5=Moderate ... 10=Slow","name":"algorithm_scale_factor","property":"algorithm_scale_factor","type":"numeric","value_max":10,"value_min":1},{"access":7,"description":"Whether or not the thermostat acts as standalone thermostat or shares load with other thermostats in the room. The gateway must update load_room_mean if enabled.","name":"load_balancing_enable","property":"load_balancing_enable","type":"binary","value_off":false,"value_on":true},{"access":7,"description":"Mean radiator load for room calculated by gateway for load balancing purposes (-8000=undefined)","name":"load_room_mean","property":"load_room_mean","type":"numeric","value_max":2000,"value_min":-8000},{"access":5,"description":"Load estimate on this radiator","name":"load_estimate","property":"load_estimate","type":"numeric","value_max":3600,"value_min":-8000},{"access":5,"description":"Specific for pre-heat running in Zigbee Weekly Schedule mode","name":"preheat_status","property":"preheat_status","type":"binary","value_off":false,"value_on":true},{"access":5,"description":"Status of adaptation run: None (before first run), In Progress, Valve Characteristic Found, Valve Characteristic Lost","name":"adaptation_run_status","property":"adaptation_run_status","type":"enum","values":["none","in_progress","found","lost"]},{"access":7,"description":"Automatic adaptation run enabled (the one during the night)","name":"adaptation_run_settings","property":"adaptation_run_settings","type":"binary","value_off":false,"value_on":true},{"access":7,"description":"Adaptation run control: Initiate Adaptation Run or Cancel Adaptation Run","name":"adaptation_run_control","property":"adaptation_run_control","type":"enum","values":["none","initiate_adaptation","cancel_adaptation"]},{"access":7,"description":"Regulation SetPoint Offset in range -2.5°C to 2.5°C in steps of 0.1°C. Value 2.5°C = 25.","name":"regulation_setpoint_offset","property":"regulation_setpoint_offset","type":"numeric","value_max":25,"value_min":-25},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"014G2461","options":[],"supports_ota":true,"vendor":"Danfoss"},"friendly_name":"trv.uf_office","ieee_address":"0xccccccfffe1da77a","status":"successful","supported":true},"type":"device_interview"}'
debug 2022-10-23 16:32:23: Retrieving state of 'trv.uf_office' after reconnect
debug 2022-10-23 16:33:08: Received Zigbee message from 'trv.uf_office', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":274,"imageType":256,"manufacturerCode":4678}' from endpoint 1 with groupID 0
debug 2022-10-23 16:33:08: Device 'trv.uf_office' requested OTA
debug 2022-10-23 16:33:11: Received Zigbee message from 'trv.uf_office', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":274,"imageType":256,"manufacturerCode":4678}' from endpoint 1 with groupID 0
debug 2022-10-23 16:33:11: Device 'trv.uf_office' requested OTA
debug 2022-10-23 16:33:14: Received Zigbee message from 'trv.uf_office', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":274,"imageType":256,"manufacturerCode":4678}' from endpoint 1 with groupID 0
debug 2022-10-23 16:33:14: Device 'trv.uf_office' requested OTA
debug 2022-10-23 16:33:17: Received Zigbee message from 'trv.uf_office', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":274,"imageType":256,"manufacturerCode":4678}' from endpoint 1 with groupID 0
debug 2022-10-23 16:33:17: Device 'trv.uf_office' requested OTA
debug 2022-10-23 16:33:20: Received Zigbee message from 'trv.uf_office', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":274,"imageType":256,"manufacturerCode":4678}' from endpoint 1 with groupID 0
debug 2022-10-23 16:33:20: Device 'trv.uf_office' requested OTA
debug 2022-10-23 16:36:39: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 16:41:40: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 16:46:42: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 16:51:45: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 16:56:47: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 17:01:49: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 17:06:52: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 17:11:54: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 17:15:22: Received MQTT message on 'zigbee2mqtt/trv.uf_office/set/occupied_heating_setpoint' with data '23.5'
debug 2022-10-23 17:15:22: Publishing 'set' 'occupied_heating_setpoint' to 'trv.uf_office'
debug 2022-10-23 17:16:04: Received MQTT message on 'zigbee2mqtt/trv.uf_office/set/occupied_heating_setpoint' with data '23.0'
debug 2022-10-23 17:16:04: Publishing 'set' 'occupied_heating_setpoint' to 'trv.uf_office'
debug 2022-10-23 17:16:56: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 17:21:58: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 17:27:01: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 17:32:03: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
debug 2022-10-23 17:32:26: Received MQTT message on 'zigbee2mqtt/trv.uf_office/get' with data '{"occupied_heating_setpoint":""}'
debug 2022-10-23 17:32:26: Publishing get 'get' 'occupied_heating_setpoint' to 'trv.uf_office'
debug 2022-10-23 17:32:33: Received Zigbee message from 'trv.uf_office', type 'readResponse', cluster 'hvacThermostat', data '{"occupiedHeatingSetpoint":2300}' from endpoint 1 with groupID 0
info 2022-10-23 17:32:33: MQTT publish: topic 'zigbee2mqtt/trv.uf_office', payload '{"adaptation_run_control":null,"adaptation_run_settings":null,"adaptation_run_status":null,"algorithm_scale_factor":null,"battery":null,"day_of_week":null,"external_measured_room_sensor":null,"heat_available":null,"heat_required":null,"keypad_lockout":null,"linkquality":163,"load_balancing_enable":null,"load_estimate":null,"load_room_mean":null,"mounted_mode_active":null,"mounted_mode_control":null,"occupied_heating_setpoint":23,"pi_heating_demand":null,"preheat_status":null,"programming_operation_mode":null,"radiator_covered":null,"regulation_setpoint_offset":null,"running_state":null,"setpoint_change_source":null,"thermostat_vertical_orientation":null,"trigger_time":null,"update":{"state":null},"update_available":null,"viewing_direction":null,"window_open_external":null,"window_open_feature":null,"window_open_internal":null}'
debug 2022-10-23 17:32:52: Received MQTT message on 'zigbee2mqtt/trv.uf_office/get' with data '{"local_temperature":""}'
debug 2022-10-23 17:32:52: Publishing get 'get' 'local_temperature' to 'trv.uf_office'
debug 2022-10-23 17:32:55: Received Zigbee message from 'trv.uf_office', type 'readResponse', cluster 'hvacThermostat', data '{"localTemp":2422}' from endpoint 1 with groupID 0
info 2022-10-23 17:32:55: MQTT publish: topic 'zigbee2mqtt/trv.uf_office', payload '{"adaptation_run_control":null,"adaptation_run_settings":null,"adaptation_run_status":null,"algorithm_scale_factor":null,"battery":null,"day_of_week":null,"external_measured_room_sensor":null,"heat_available":null,"heat_required":null,"keypad_lockout":null,"linkquality":167,"load_balancing_enable":null,"load_estimate":null,"load_room_mean":null,"local_temperature":24.22,"mounted_mode_active":null,"mounted_mode_control":null,"occupied_heating_setpoint":23,"pi_heating_demand":null,"preheat_status":null,"programming_operation_mode":null,"radiator_covered":null,"regulation_setpoint_offset":null,"running_state":null,"setpoint_change_source":null,"thermostat_vertical_orientation":null,"trigger_time":null,"update":{"state":null},"update_available":null,"viewing_direction":null,"window_open_external":null,"window_open_feature":null,"window_open_internal":null}'
debug 2022-10-23 17:37:05: Received Zigbee message from 'trv.uf_office', type 'commandCheckIn', cluster 'genPollCtrl', data '{}' from endpoint 1 with groupID 0
Also found this error in my HA logs, which might be related:
2022-10-24 10:43:32.574 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'system_mode' when rendering '{{ value_json.system_mode }}'
2022-10-24 10:43:32.575 ERROR (MainThread) [homeassistant.components.mqtt.climate] Invalid modes mode:
Edit: included a short screencast of the issue: Home Assistant - MQTT entity update problem - YouTube