zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

SONOFF TRVZB: `temperature_sensor_select` publishes `external_3`, which is not in the discovery options since 2.14.2-1 (HA MQTT select errors)

Open Petarkir2000 opened this issue 2 months ago • 6 comments

What happened?

After updating the Zigbee2MQTT Home Assistant add-on from 2.14.1-1 to 2.14.2-1, Home Assistant logs this error repeatedly for each of my SONOFF TRVZB valves (195 occurrences in about an hour):

Logger: homeassistant.components.mqtt.select
Source: components/mqtt/select.py:129
Invalid option for select.0xc4d8c8fffe4a6d8b_temperature_sensor_select: 'external_3' (valid options: ['local_temperature', 'remote_temperature', 'remote_source_offline'])

The same error appears for 4 TRVZB devices. In 2.14.2-1 the discovery options for temperature_sensor_select are local_temperature, remote_temperature and remote_source_offline, but the device state still publishes "temperature_sensor_select": "external_3", which HA rejects.

The valves use an external temperature sensor (external_temperature_input is being set), and they report the value 0x03. Rolling back to 2.14.1-1 stops the errors.

What did you expect to happen?

The published state of temperature_sensor_select should match the options announced in the HA discovery (for example remote_temperature for value 0x03), so no invalid-option errors are logged.

How to reproduce it (minimal and precise)

  1. Have a SONOFF TRVZB using an external temperature sensor (reported value 3).
  2. Update Zigbee2MQTT from 2.14.1-1 to 2.14.2-1 with the Home Assistant MQTT integration enabled.
  3. Check the Home Assistant logs for the errors above.

Device

  • Model: SONOFF TRVZB, firmware 1.4.4 (build 20251229, version 5124)
  • 4 affected devices

MQTT state of one affected device (2.14.1-1, trimmed)

{
  "external_temperature_input": 21.7,
  "local_temperature": 21.7,
  "system_mode": "off",
  "temperature_sensor_select": "external_3",
  "smart_temperature_control": null,
  "temperature_accuracy": -1
}

Zigbee2MQTT version

2.14.2-1 (add-on), previously 2.14.1-1 (no errors)

Adapter firmware version

EmberZNet 0x04e3e5fffe799308 Revision: 7.4.4 [GA]

Adapter

SONOFF Zigbee 3.0 USB Dongle Plus | ZBDongle-E

Setup

Add-on on Home Assistant OS on VMware Workstation on Windows 11

Device database.db entry

No response

Debug log

No response

Notes

No response

Petarkir2000 avatar Oct 02 '26 09:10 Petarkir2000

Are you sure you are not updating this via an automation?

Invalid option for select.0xc4d8c8fffe4a6d8b_temperature_sensor_select: 'external_3'

The old values are gone, see https://github.com/Koenkk/zigbee2mqtt/discussions/33243#discussioncomment-18708933

In HA I see exposed the same values as in Z2M:

Image

I have updated my automations from the old to the new values and they work.

GigiPompieru avatar Oct 02 '26 11:10 GigiPompieru

Same here with 9 TRVZB valves (firmware 1.4.4, 5124) after updating the add-on from 2.14.1-1 to 2.14.2-1, except the rejected value is 'internal':

Invalid option for select.office_trv_temperature_sensor_select: 'internal' (valid options: ['local_temperature', 'remote_temperature', 'remote_source_offline'])

Cause: the device isn't sending the old value. It's Z2M's state cache.

  • 2.14.2 bundles zigbee-herdsman-converters 26.115.1, up from 26.105.0. That version changes the TRVZB temperature_sensor_select lookup from {internal: 0, external: 1, external_2: 2, external_3: 3} to {local_temperature: 0, remote_temperature: 1 or 3, remote_source_offline: 2}.
  • The valve doesn't report temperatureSensorSelect (0x600e) on its own. Mine sent none in the three hours after the update. So the old label stays in the cache (state.json) and goes out with every TRV publish, and HA rejects it against the new discovery options.

Workaround: read the attribute once per valve. The read response goes through the new converter and replaces the cached label:

  • topic: zigbee2mqtt/<FRIENDLY_NAME>/get
  • payload: {"temperature_sensor_select": ""}

The refresh button on the device's Exposes tab does the same. All 9 of mine answered within seconds with local_temperature, the HA errors stopped straight away, and the new value was in state.json after the next save. In your case, external_3 is raw value 3, so it should come back as remote_temperature. Nothing is written to the device, and rolling back isn't needed.

Possible fix in the converter: map the old cached labels to the new ones (internal → local_temperature, external/external_2/external_3 → remote_temperature). Or read the attribute once at startup or configure for TRVZB, so existing installs don't keep publishing a label the discovery no longer advertises.

bnlqn avatar Oct 02 '26 11:10 bnlqn

Are you sure you are not updating this via an automation?

Invalid option for select.0xc4d8c8fffe4a6d8b_temperature_sensor_select: 'external_3'

The old values are gone, see https://github.com/Koenkk/zigbee2mqtt/discussions/33243#discussioncomment-18708933

In HA I see exposed the same values as in Z2M:

Image

I have updated my automations from the old to the new values and they work.

Same here with 4 TRVZB (fw 1.4.4). Confirming the stale cached label as the cause. Reading the attribute once per valve clear it, and a migration of old cached labels in the converter would help existing installs.

Petarkir2000 avatar Oct 02 '26 12:10 Petarkir2000

CC @cubez2mdeveloper

Koenkk avatar Oct 02 '26 19:10 Koenkk

What I don't understand is why mine just worked and others are experiencing this issue.

GigiPompieru avatar Oct 03 '26 04:10 GigiPompieru

Hi @Petarkir2000 @bnlqn ,

Thanks for the detailed investigation and for sharing the workaround.

We agree that reading the temperature_sensor_select attribute is a good workaround for existing installations.

We will add a version to the device definition. Once the definition version changes, Zigbee2MQTT will run the configure function again, where we will re-read the temperature_sensor_select attribute. This will refresh the cached value and ensure that the correct, newly mapped value is published.

Sorry for the inconvenience, and thank you again for helping identify the cause and providing a practical workaround.

CubeZ2mDeveloper avatar Oct 09 '26 01:10 CubeZ2mDeveloper