I have a rule for data reading, but to read a correct data from midnight, I must read one hour before :
val ZonedDateTime zdt = ZonedDateTime.now()
val actual_day = zdt.minusDays(1).withHour(23).withMinute(0).withSecond(0)
val number = Modbus_Data_Grid_sum_2634_Value_as_Number.historicState(actual_day).state as Number
this value is
but if I will check in the graph, readed value is exactly in midnight
Then that means you have the tiemzone set wrong somewhere. Either OH’s location settings, the timezone setting on the Java that is running OH, the operating system timezone, or the timezone setting of your database is wrong.
Also be aware in Grafana the charts will always only use GMT for the time scale. That is a deliberate choice made by the developers of Grafana and they are not going to change it.