MQTT via Influxbd automation trigger

I have no idea how to phrase this or if the thing I want is possible though I’m sure it’s possible in HA but here’s what I want to do:

I have an Influxdb running on a separate RPI than my HA installation (which is on a Yellow). All my HA data from my sensors in HA (eg Aqara temperature sensor) are populating the DB correctly. I also have an external sensor populating the same DB. The Grafana addon reads all this data correctly from both the internal HA sensors and also the external one and displays them on the graphs I have.

What I want to do is trigger an automation based on the info the external device is sending to the Influxdb but this is where my knowledge fails me. I have no idea where to start with it or if I can actually trigger an automation based on the info I want to.

The external device is MQTT and one of the Topics it publishes is ‘Temperature’ - the one I want the automation to trigger. If anyone can point me in the right direction I’d be grateful. As I said, I have no idea where to start with this one.

For info: All software is current version.
Influxdb is running on Raspberry Pi 4 static IP on home network
Home Assistant running on Yellow
All info from all sensors logged in Influxdb correctly and can be displayed in Grafana

Thanks all.

If you are using HA to populate InfluxDB, then obviously you can create automations on those HA sensors.
Or do I miss something?

I mean you can pull from influxdb to a sensor…but if the device is posting to MQTT, it’s much easier to make an MQTT sensor instead. Then it will trigger on update and condition.

I can and have created automations for the sensors that are from within HA but I have 1 sensor populating the Influxdb that HA doesn’t integrate with, that’s the one I want to get the info from Influx and create an automation based on the Influx info

That’s the bit I have no idea of. Or haw to make an MQTT sensor

Then you can “import” a sensor from influxdb to HA, if I understand correctly what you mean. Not sure I do because I don’t get what MQTT has to do with this, then…

A binary one

A value one.

Literally 20 seconds would have given you this information .