Dear All,
I am doing certain engneering automation for which I need to compute some integral values. For that I need to acces the historic data. The only way I found to make it from HA is through the REST commands. I have found that through the GET method I potentially can acces api/history/period records. But to do that I decided to get familar with the rest commands to start from, and that’s where I am stuck at the moment. I am trying to call from developer-tools/service my test command I defined in the config to understand if it works and nothing happends. Can anyone advise how to test these commands and where to look for the result?. Below is my zero approximation test command. It used to give me the error info in the log in previous notations, but now nothing happends - no error in the log, no result in the dev-tools… I am confused…
get_state:
url: http://localhost:8123/api/
method: GET
headers:
authorization: !secret rest_api_token
content-type: 'application/json'
You don’t need the API for histotical data, you can use history stats.
Yes and no…
I have used this type of sensor for the purpose to get to know how long something used to happen - circulating pump operates or gas heater burns gas, in my case. But now I need to derrive integral values and this thing is no use to me. I need to set integration limits - start time and end time and ran through the values between these limits to integrate the curve. I tried integration sensor - but it is as usless as history sensor - it starts integrating the curve and never stops - how far can it go, who knows? when does it overflow the float limit? History sensor is good in some sence because I menaged to trick it’s statics - it accepts datetime object as start and end parameters and I can create it easily using strptime function, hence there is no problem to make dinamically change the interval of interest - I do this in my stats folder interface, where user sets start and end times and retrives agrigate operation time for that period. But how would I do that with integration sensor? Thus, as I can see, I need to retrive the hystory data itself from SQL database…