- Platform information:
- Hardware: i5/8G/2 TB
- OS: Ubuntu 22.04LTS
- Java Runtime Environment: openjdk 11.0.16.1 2022-07-19 LTS
- openHAB version: 3.4.0.M3
- Issue of the topic: mqtt:number cannot set a value but mqtt:switch does
- Please post configurations (if applicable):
UID: mqtt:topic:c4c2baaffc
label: T
thingTypeUID: mqtt:topic
configuration:
payloadNotAvailable: '{"state":"offline"}'
availabilityTopic: zigbee2mqtt/Thermostat/availability
payloadAvailable: '{"state":"online"}'
bridgeUID: mqtt:broker:81edc1d2b7
channels:
- id: temperature_setpoint_hold
channelTypeUID: mqtt:switch
label: Temperature Setpoint Hold
description: Prevent changes. `false` = run normally. `true` = no changes.
configuration:
commandTopic: zigbee2mqtt/Thermostat/set/temperature_setpoint_hold
stateTopic: zigbee2mqtt/Thermostat/temperature_setpoint_hold
off: "false"
on: "true"
- id: occupied_cooling_setpoint
channelTypeUID: mqtt:number
label: Cooling Temperature
description: Temperature setpoint
configuration:
commandTopic: zigbee2mqtt/Thermostat/set/occupied_cooling_setpoint
stateTopic: zigbee2mqtt/Thermostat/occupied_cooling_setpoint
- If logs where generated please post these here using code fences:
Logs do not generate errors beyond the standard item update events for either manually setting the value or mqtt state resetting the value. No error messages appear.
I created the Thing, then created default items from the channels; the items will follow the topic settings correctly from the device. State topic values work perfectly.
When I update the switch’s item, OpenHab sends a message to the command topic with the correct value. This sending is true if I use the PaperUI or the API to set the switch’s item value. Both work correctly.
The only method to command the number channel is to use the API. When I update the number’s item via the API, OpenHab will not send the command topic or value. There are no messages in the log nor mosquito’s log (MQTT). OpenHab never sends the published message in MQTT.
The Item is set to default, not follow.
A reboot and a complete reboot do not make a difference.
If I manually send the topic and value using mosquito’s commands, the command channel is correct and updates the device. The only missing difference is that mqtt:number does not send a command, but mqtt:switch does.
According to Help MQTT Things and Channels - Bindings | openHAB the number channel should update the mqtt topic in the command.
This issue seems to be the same as the unanswered Sending a Number-item with MQTT