Closed htmltiger closed 1 year ago
Can you try the query-template
branch to see if it does what you're asking for? The changes checks whether any of the queries are templates, and if so renders them before running the SQL query.
Due to validation (queries must start with SELECT
) and heuristic substitutions (results are limited to 1 unless LIMIT
is set) that the upstream integration performs on the query, those parts can't be templatised, though such use cases should be rare.
Added in edcf0395c928e71f351d7d1ede97d707e1ea597e
Hi,
is it possible to have a query template where we can build a query string based on other sensor state?
for eg
query: "SELECT * FROM lookup WHERE Code = {{states('sensor.dx_trip_0')}};"
https://community.home-assistant.io/t/add-support-for-query-template-to-sql-integration/188760Thanks for the useful plugin.