How to push sensor value from HA to MQTT?

Hi there!

I’m sure it must be very simple, but I could not figure out by myself:

I have a sensor value (for example: Victron smart shunt current - sensor.house_shunt_current), which is received in Home Assistant via BLE. I would like to forward the value of this sensor to MQTT, like every second, or every time it changes.

How should I do this? Maybe I’ve missed something, but could not find a straightforward example in the docs.

Thanks!

You could try this solution: Link
Or you could just design your automation via the GUI based on the triggers you want, e.g. state, every second, and use “mqtt.publish” as the command to be executed.

Edit: Link corrected!

Hi!

Tanks for the fast reply!

I’ve checked the link, but it just opens the profile summary of a forum user, not a specific article.

I also tried the GUI automation, but in the trigger options there is not possible to send a value like every second. There is only option “When the numeric value crosses a given threshold”, which is of course not what I want. Or I have to select other ways for automation?

That link is to a persons profile, so not helpful. Wrong link perhaps?

Sorry, I copied the wrong link! :grimacing:
I edited my post above, but here is the correct one, too: Link

You can select the interval one bullet below in “Time and location”.

1 Like

Thanks, it is working!