SQL sensor Order by "strftime" not working anymore


Since upgrade to version 2022.4.5 my SQL sensors where I’m using order by strftime, not shoing any data.


  • platform: sql
    • name: sh3em Energy Total 24h ago
      query: “SELECT * FROM states WHERE entity_id = ‘sensor.energy_total’ ORDER BY ABS(strftime(’%s’, created);”
      column: ‘state’
      unit_of_measurement: “kWh”

If I remove ORDER BY, than I get data from database.

Thank you for any suggestion.

Query working normaly.
The problem is that since last update, field “created” has value NULL