API question about using "yesterday" date format

I am new to Beestat but excited to use the API. I would like to use runtime_thermostat_summary.read_id to get yesterday’s summary. The documentation states that it accepts string formats. I wondered if it supports “yesterday”? If so can someone help me with the correct API call format? I tried several variations but none of them seemed to work.

Is there a better way to do this?

Thanks,

Bob

That API call would look like this. Replace the api_key and thermostat_id with your own. Using the value of “yesterday” on November 15 would translate to 2023-11-14 and should work without issue.

https://api.beestat.io/?api_key={YOUR API KEY}&resource=runtime_thermostat_summary&method=read_id&arguments={"attributes":{"thermostat_id":{YOUR THERMOSTAT ID},"date":"yesterday"}}

If you’re not sure of your thermostat_id, you can get it by doing this call:

https://api.beestat.io/?api_key={YOUR API KEY}&resource=thermostat&method=read_id

Thanks Jon. That worked perfectly.

Bob

1 Like