Homeassistant Recorder lacks continous recording for binary sensor with low sample rate

I have a Binary sensor from an ESP32 module running ESPHome, the binary sensor works as it should be and the state of the sensor changes at most three times a day, however when i want to plot the state graph of the sensor using grafana and influxDB as you might see the problem it does not work as i intend it to be, the sample count for grafana and influxDB is too low to plot the graph and i have to set the timeline of the graph to show the data for more than a day to see something meaningful, although i know and understand the pure logic why the Recorder works this way, i also believe continuous recording should be a possible feature to those who wants to use it, I tried the following steps to fix this issue without any luck:

  1. manually published the binary sensor state from ESPHome using interval automation method
  2. created a custom sensor that continuously updated it’s state based on the binary sensor state and published it to grafana
  3. used the fill previous feature of grafana and influxDB with no luck

is there a work around for this problem

This solution seemed to work for the poster (same issue):

How does one meaningfully graph a sensor that is either 0 or 1?

You can set the sensor to be graphed on a second Y axis. The grey background here is a ‘dark outside’ binary sensor:

You can do similar things with the mini-graph card and ApexCharts:

Screenshot 2021-10-26 at 17-05-40 Overview - Home Assistant

Or you can use a Grafana plugin like StatusMap:

Each box is an hourly average. The more red = more movement.

OK - those are nice!!

Thank you for your reply this worked for me aswell