Closed felixmxr closed 7 months ago
Hey there @gjohansson-st, @dougiteixeira, mind taking a look at this feedback as it has been labeled with an integration (sql
) you are listed as a code owner for? Thanks!
pull request
Just open a PR next time if you intend to fix it. No need to open an issue first. Thanks 👍
Feedback
in the section "state of entity X ago" the SQL code is only valid for mysql installations. the "strftime" function only exists for mysql databases.
for maria db the following should be used
SELECT states.state FROM states INNER JOIN states_meta ON states.metadata_id = states_meta.metadata_id WHERE states_meta.entity_id = 'sensor.watermeter_value' AND last_updated_ts <= (UNIX_TIMESTAMP() - 24*3600) ORDER BY last_updated_ts DESC LIMIT 1;
URL
https://www.home-assistant.io/integrations/sql/
Version
2024.4.1
Additional information
No response