I’ve added a new sensor, which uses a third-party scaper API to get values. I know the API is working, as I can call it in from Postman with the same variables etc.
My config is:
logger:
logs:
homeassistant.components.rest.sensor: debug
rest:
- resource: "https://api.browse.ai/v2/robots/xxxxxxxxxxxxxxxx/tasks/xxxxxxxxxxxxxxxxxxxxx"
scan_interval: 43200
authentication: basic
headers:
Authorization: >
Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
sensor:
- name: "Tank Balance"
value_template: "{{ value_json.result.capturedTexts }}"
- resource: "https://www.boilerjuice.com/includes/priceChart.inc.php?a=1&ot=1&c=0&va=1&ex=1&d=2"
scan_interval: 43200
sensor:
- name: "Oil Price"
value_template: "{{ value_json.rows[0].c[1].v }}"
The Oil Price is showing, correctly and updating, but the Tank Balance isn’t appearing as a device, or entity under Rest. I’ve tried switching the entries in the config file. And each time I’m making a change (tinkering) I reboot HA, not just reload.
Nothing seems to be appearing in the logs either.
The value_template for Tank Balance should reference [‘Tank Account’], but when I include that, I get the following error:
Invalid config for 'rest' at configuration.yaml, line 34: invalid template (TemplateSyntaxError: expected name or number) for dictionary value 'rest->0->sensor->0->value_template', got "{{ value_json.result.capturedTexts.['Tank Account'] }}", please check the docs at https://www.home-assistant.io/integrations/rest
Any thoughts/help gratefully received