MySQL and Grafana

I searched and tryed alot but cant find a query that is working.

i have binary sensors (on|off) and sensors with numeric values and cant get any graph showing up :confused: i dont use influxdb and dont want to.

my tries:

SELECT
  last_updated AS "time"
  cast (state as float) as value
FROM states
WHERE
  $__timeFilter(last_updated)
and
  entity_id = 'binary_sensor.bms_badezimmer'
ORDER BY last_updated

and

SELECT
  last_updated AS "time",
  state AS metric,
  event_id
FROM states
WHERE
  $__timeFilter(last_updated) AND
  entity_id = 'binary_sensor.bms_badezimmer'
ORDER BY last_updated

i dont know what i making wrong :confused: