HA to a MQTT value

Hi,

I have a heat pump, and I reding and writing values to it true MQTT. I do not have a physical indoor temperature sensor connected to it, but through a H66 communicating device I can emulate one.

How can I write a temp value from a shelly device in HA to a MQTT value in HA, let’s say every 2-4 minutes?

THX

alias: publish your sensor temp  to mqtt
description: ""
triggers:
  - minutes: /4
    trigger: time_pattern
conditions: []
actions:
  - action: mqtt.publish
    metadata: {}
    data:
      qos: 0
      retain: true
      payload: "{{states('sensor.yoursensor_temp') | float (0) }}"
      topic: whatever/yourtopic
mode: single

You could do it with an automation.

  - trigger: state
    entity_id:
      - sensor.yoursensor_temp

This is the trigger to publish only when yoursensor changes

Thank you!
How can I find out the topic: ?

Use Mqttexplorer to see what the topics relating to your heat pump are.