How send data from home assistant to MQTT?

Hi.

  1. How can I send collected sensors data to MQTT broker (for example Xiaomi sensors)?
  2. How to resend data collected from local MQTT broker to global internet broker (for example narodmon.ru)
    Thanks in advance for help!

take a look here

The documentation for the MQTT publish service is here

The documentation for the MQTT publish service is here

How to configure it to use two mqtt brokers?

I don’t think connecting to two brokers is possible. You can however, bridge brokers together - see

Hope this topic is still active…
I wand to send a value from a device read by HA to MQTT.
I successfully created a topic and a config payload using the MQTT integration.
MQTT explorer shows these entries.
Now I want to use an automation to write values to this topic.
An automation runs @10sec and writes to the topic.
But: How can I correctly write dynamic values? What should the payload look like?
Thanks
p.s. maybe you have a better way?

SOLVED!
service: mqtt.publish
metadata: {}
data:
topic: homeassistant/sensor/export/PV_Battery_SoC/state
payload: “{{ float(states(‘sensor.plenticore_battery_soc’), 0) }}”