@phsdv wrote:
I have some data that I want to get into HA. The input is quite long, so with the RESTfull integration I am over the 256 char limit. When using
grep period
I get all the data I am looking for see below:
(for the curious people, this is the output of a windturbine in Wh).$ curl --silent https://zep-api.windcentrale.nl/production/2 | grep period <subset interval="HOUR" period="DAY" tstart="2020-04-06 00:00:00" tend="2020-04-06 23:59:00" sum="14632.255"> <subset interval="DAY" period="MONTH" tstart="2020-04-01 00:00:00" tend="2020-04-30 00:00:00" sum="88488.797"> <subset interval="DAY" period="WEEK" tstart="2020-03-31 00:00:00" tend="2020-04-06 00:00:00" sum="91294.59000000001"> <subset interval="MONTH" period="YEAR" tstart="2020-01-01 00:00:00" tend="2020-12-31 00:00:00" sum="2189460.426"> <subset interval="YEAR" period="LIFETIME" tstart="2013-01-01 00:00:00" tend="2020-12-31 00:00:00" sum="3.4027436681E7">
What I want to see in HA is for each different period the value of the sum. Thus I would like to get this:
somename.DAY= 14632.255 somename.MONTH=88488.797 ... somename.YEAR=3.4027436681E7
How to do this in HA? Any pointers is appreciated.
I have it working for DAY only with the use of curl|grep|awk|sed but it is a bit long commandline and only for 1 sum, not for all.
Posts: 3
Participants: 3