Edit your post, the code is unformatted. Not crucial in this particular case since “history_stats” syntax does not have indents, but this is a matter of “help people to help you”.
The “history_stats” platform needs an entity_id of a monitored entity. Is the “binary_sensor.hp_compressor” a proper id of this entity?
A bit the same here, the starts seems to become correct, but the runtime is off, I think it’s at least partially because the compressor starts before midnight and keeps running until the morning.
The history-graph shows you same 7.5 which you consider as actual.
If you have any issues with apexcharts - better to ask in the huge apexcharts thread.