I am able to solve it as below for query
SELECT mean(“Consumption”) AS “mean_Consumption” FROM “homeassistant”.“autogen”.“thames_daily_water_usage” WHERE time > :dashboardTime: AND time < :upperDashboardTime: AND “ticker”=‘dailywaterusage’ GROUP BY time(:interval:) FILL(null)
- platform: influxdb
host: 192.168.xx.xx # Replace with the host where InfluxDB is running
port: 8086 # Default InfluxDB port
username: xxxx
password: xxx
database: homeassistant
queries:
- name: "Thames_Daily_Water_Consumption"
unit_of_measurement: "L" # Update with appropriate unit
value_template: '{{ value_json }}'
group_function: last
where: "ticker='dailywaterusage'"
measurement: "homeassistant.autogen.thames_daily_water_usage"
field: "Consumption"