I’ve been playing with the REST API, following the examples at REST API | Home Assistant Developer Docs. My queries are working fine but only for times within the past 5 days, anything further than that is returning zero results. I’m only querying one day at a time.
The data is definitely there (as confirmed by the viewing the entity history in the home assistant GUI), it’s also not at the point when it transitions to LTS (which seems to be more like 10 days).
I’m using the /api/history/period/ endpoint.
Am I missing something? Is this expected behaviour?
My very simple python code:
def get_pv_day(start):
t_start = f"{start.date()}T00:00:00"
t_end = f"{start.date()}T23:59:59"
url = f"http://192.168.1.2:8123/api/history/period/{t_start}Z?filter_entity_id=sensor.solax_today_s_solar_energy&end_time={t_end}Z&no_attributes"
print(requests.get(url, headers=headers).json())
start = datetime(2024, 3, 22, 00, 00, 00)
get_pv_day(start)