To read send a message to zigbee2mqtt/FRIENDLY_NAME/get with payload {"occupied_heating_setpoint": ""}

Hi

I’m trying to set up things and items in files for a Bosch Radiator thermostat II on Zigbee2MQTT. I can read the room temperature and battery level just fine like so:

Type number : temperature "Room Temperature"   [ stateTopic="zigbee2mqtt/Bosch Thermostat Torkils Office/local_temperature" ]
Type number : battery     "Battery Charge"     [ stateTopic="zigbee2mqtt/Bosch Thermostat Torkils Office/battery" ]

But I don’t understand how to handle the setpoint. The documentation[1] says:

`occupied_heating_setpoint`: Temperature setpoint. To control publish a message to topic `zigbee2mqtt/FRIENDLY_NAME/set` with payload `{"occupied_heating_setpoint": VALUE}` where `VALUE` is the °C between `5` and `30`. To read send a message to `zigbee2mqtt/FRIENDLY_NAME/get` with payload `{"occupied_heating_setpoint": ""}`.

Anyone have an example as how to configure topics to do something like that?

Thanks,

Torkil

[1] Bosch BTH-RA control via MQTT | Zigbee2MQTT

This seems to work:

Thing mqtt:topic:thermostat_torkils_office "Bosch Thermostat Torkils Office" (mqtt:broker:mosquitto)
{
  Channels:
    Type number : temperature "Room Temperature"   [ stateTopic="zigbee2mqtt/Bosch Thermostat Torkils Office/local_temperature" ]
    Type number : setpoint    "Target Temperature" [ commandTopic="zigbee2mqtt/Bosch Thermostat Torkils Office/set", formatBeforePublish="{ \"occupied_heating_setpoint\":\"%s\" }", transformationPattern="JSONPATH:$.occupied_heating_setpoint" ]
    Type number : battery     "Battery Charge"     [ stateTopic="zigbee2mqtt/Bosch Thermostat Torkils Office/battery" ]
}

And an item example with alexa bits, just in case anyone else struggles with this device:

Group gTorkilThermostat "Thermostat" (gOffice) ["HVAC"] {alexa="Thermostat"}
Number:Temperature   Torkil_temperature "Temperature [%.1f °C]" <temperature> (Temperature, gTorkilThermostat) ["Measurement", "Temperature"] { influxdb="openhab_temperature" [label="Torkils Office (Bosch)"], channel="mqtt:topic:thermostat_torkils_office:temperature", alexa="TemperatureSensor.temperature" [scale="Celsius"] }
Number               Torkil_setpoint "Setpoint [%.1f °C]" <temperature> (gTorkilThermostat) ["Measurement", "TargetTemperature"] { channel="mqtt:topic:thermostat_torkils_office:setpoint", alexa="ThermostatController.targetSetpoint" [scale="Celsius"]}
Number:Dimensionless Torkil_battery "Battery level [%d %%]" <battery> (Battery, gTorkilThermostat) ["Battery"] { influxdb="openhab_battery", channel="mqtt:topic:thermostat_torkils_office:battery" }

Mvh.

Torkil