I used to have a working rest sensor but for some releases now, it complains that it cannot parse the json.
This is my configuration:
sensor:
- platform: rest
name: Aantal activiteiten Tienen
resource: https://www.tienen.be/~datasource/solr/select?rows=1&q=*%3A*&q.op=AND&fq=ego_module%3Aevent%20AND%20recurring_event_bs%3Afalse%20AND%20ego_site%3A1%20AND%20ego_publishState%3A1%20AND%20ego_language%3A1%20AND%20-category_ids%3A65052%20AND%20event_date_from_dts%3A%5BNOW%20TO%20NOW%2B1DAY%2FDAY%5D%20%20AND%20ego_publishFrom%3A%5B*%20TO%20NOW%5D%20AND%20-ego_publishTill%3A%5B*%20TO%20NOW%5D&fq=(ego_isSecured_is%3A0%20OR%20((ego_isSecured_is%3A2%20OR%20ego_isSecured_is%3A3)%20AND%20-*%3A*)%20OR%20(ego_isSecured_is%3A1%20AND%20-*%3A*%20AND%20entity_id%3A0)%20OR%20(*%3A*%20-ego_isSecured_is%3A%5B*%20TO%20*%5D))&facet=true&facet.method=enum&facet.limit=1000&group=true&group.field=ego_id&group.ngroups=true&group.facet=true&sort=recurring_event_bs%20asc%2C%20event_date_from_dts%20asc%2C%20title%20asc&wt=json
value_template: "{{ value_json['grouped']['ego_id']['matches']}}"
scan_interval: 86400
unit_of_measurement: nbr
- platform: rest
name: Activiteiten Tienen
json_attributes:
- grouped
resource: https://www.tienen.be/~datasource/solr/select?rows=30&q=*%3A*&q.op=AND&fq=ego_module%3Aevent%20AND%20ego_site%3A1%20AND%20ego_publishState%3A1%20AND%20ego_language%3A1%20AND%20-category_ids%3A65052%20AND%20event_date_from_dts%3A%5BNOW%20TO%20*%5D%20%20AND%20ego_publishFrom%3A%5B*%20TO%20NOW%5D%20AND%20-ego_publishTill%3A%5B*%20TO%20NOW%5D&fq=(ego_isSecured_is%3A0%20OR%20((ego_isSecured_is%3A2%20OR%20ego_isSecured_is%3A3)%20AND%20-*%3A*)%20OR%20(ego_isSecured_is%3A1%20AND%20-*%3A*%20AND%20entity_id%3A0)%20OR%20(*%3A*%20-ego_isSecured_is%3A%5B*%20TO%20*%5D))&facet=true&facet.method=enum&facet.limit=1000&group=true&group.field=ego_id&group.ngroups=true&group.facet=true&sort=recurring_event_bs%20asc%2C%20event_date_from_dts%20asc%2C%20title%20asc&wt=json
value_template: "{{ value_json['grouped']['ego_id']['matches']}}"
scan_interval: 86400
unit_of_measurement: nbr
I off-course checked the url’s and the endpoints are up. I expect 2 sensors where one of them has an attribute called grouped
that contains a huge json value
This is the HA warning:
2021-04-12 15:54:11 WARNING (MainThread) [homeassistant.components.rest.sensor] REST result could not be parsed as JSON
What am I doing wrong? Thanks again?