Hi, I’m trying to make sense to a rest sensor in Home Assistant and got 2 questions.
- The api returns a quite specific date format, does anyone know which kind this is and how to convert it into something more readable? For instance:
{
"d": [
{
"__type": "QueryStats:#Microsoft.Bing.Webmaster.Api",
"AvgClickPosition": -1,
"AvgImpressionPosition": 6,
"Clicks": 0,
"Date": "/Date(1714114800000-0700)/",
"Impressions": 1,
"Query": "my beautiful keyword"
},
- the api returns a list which may contain the same “query”. so for instance
"Query": "my beautiful keyword"
could be listed twice, like this:
- __type: QueryStats:#Microsoft.Bing.Webmaster.Api
AvgClickPosition: -1
AvgImpressionPosition: 7
Clicks: 0
Date: /Date(1717138800000-0700)/
Impressions: 1
Query: my beautiful keyword
- __type: QueryStats:#Microsoft.Bing.Webmaster.Api
AvgClickPosition: -1
AvgImpressionPosition: 6
Clicks: 0
Date: /Date(1717138800000-0700)/
Impressions: 1
Query: another beautiful something
- __type: QueryStats:#Microsoft.Bing.Webmaster.Api
AvgClickPosition: -1
AvgImpressionPosition: 6
Clicks: 0
Date: /Date(1717743600000-0700)/
Impressions: 1
Query: my beautiful keyword
I need to sum the “impressions” of each identical query.
so in my example I’m expecting 2 impressions because the query is listed twice and when I sum those impression values, it’s a total of 2.
Is this even possible with HA? I know how to sum ALL impressions but not how to sum only the identical ones.
any help is appriciated.