Zigbee2mqtt publish with a variable

Hi I’m hoping someone can help me. I’m trying to pass a variable from an entity (more specifically a target temperature)

I’ve got hive added via zigbee2mqtt, and have a ‘hive target temperature’ that can be set via a HA card.

I currently have the following set to publish via an automation: {"system_mode":"heat","temperature_setpoint_hold":"1","occupied_heating_setpoint":"21.5"}

Is there a way of passing a variable from target temperature or another sensor?