Forwarding my weather service temperature to mqtt

I have temperature coming in from the weather binding. I would like to also send the temperature readings out via the mqtt binding…

Number Temperature_Maui “Temperature [%.2f °C]” {weather=“locationId=maui, type=temperature, property=current”}

Is there an easy way that whenever Temperature_Maui is updated via weather binding, that new value is published to something like this topic: ‘sensors/outside/temperature’?

thanks,
craig

1 Like

Make sure the MQTT binding is installed and configured in openhab.cfg, then

Number Temperature_Maui "Temperature [%.2f °C]" {mqtt=">[yourbroker:sensors/outside/temperature:state:*:default]", weather="locationId=maui, type=temperature, property=current"}

that’s great. thanks.

1 Like