Help with influxdb query -> count how many times a value has occurred -> showed in a state timeline for instance

Can someone help me with the influxdb2 query? I would like to show the results with for example State Timeline in Grafana.
What I want to achieve: a sum of how many times the value True has occurred (in table “_value” and then a timeline is set, so that you can see it per day.

With this query I get the message “date does not have a time field”…while the query certainly contains that, or am I missing something?

from(bucket: “home_assistant”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “binary_sensor.deurbel_ringing_sensor”)
|> filter(fn: (r) => r[“_field”] == “state” and r._value == “True”)
|> group(columns: [“_time”])
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: “count”)

output from the query in the Influx explorer