InfluxDB + MYSQL Schema Searching ( Using the Two Together ) to generate API

Hi , Let me write it down my Requirement

Current InfluxDB Schema




“fields”:{“temp”:29.64,“humidity”:59,“vbatt”:3063,“rssi”:-68,“device_temperature”:29.64,“device_humidity”:59,“upload_time”:“2023-11-15 12:09:06.600”,“x0”:-78,“y0”:-500,“z0”:-875},



I Want to build a InfluxDB Query API using php or fastapi where I can get the following result in one line json ,

  1. List all devices latest values

  2. Device_temperature

  3. Device_humidity

  4. Upload_time

  5. Timestamp

  6. X

  7. Y

  8. Z

  9. Rssi

  10. Vbattery

  11. List all devices which are missing or having no values from the past 48hrs , List of Items to be checked from an Array , where an Array will contain device_mac address .

  12. Search MySql Key and find the point 1 . and Point 2 from InfluxDB and return all values in json .

  13. Get Count of Devices which have Low temperature between two date-time for a group of device_mac values

  14. Send InfluxDB Alerts to an Endpoint if a Device_Temperature for any specific device_mac matches criteria

  15. Working hrs time

  16. Temperature / humidity / rssi / vbatt

  17. Enable / Disable Criteria