Hi there! I'm trying to fetch live pricing data from my energy supplier, and found an API endpoint that returns said pricing data
The data can be fetched from the following endpoint:
https://www.energiaxxi.com/content/endesa-com/es/facturas/como-saber-cual-es-el-precio-de-la-luz.getPriceToday.sendmail.json?ivaRate=21&lang=es
The pricing data is available hourly in the $.priceData array, with the array index being the hour
However, after creating a rest sensor I see the following error:
Logger: homeassistant.components.rest.util
Source: components/rest/util.py:33
integration: RESTful (documentation, issues)
First occurred: 20:45:28 (1 occurrences)
Last logged: 20:45:28
JSON result was not a dictionary or list with 0th element a dictionary
Here is my sensor code:
rest:
- resource: https://www.energiaxxi.com/content/endesa-com/es/facturas/como-saber-cual-es-el-precio-de-la-luz.getPriceToday.sendmail.json?ivaRate=21&lang=es
scan_interval: 600
method: "GET"
sensor:
- name: energiaxxi_price_data
json_attributes_path: "$.priceData"
value_template: "OK"
json_attributes:
- precio
- hora
- dia
Am I doing this correctly? priceData is an array after all, so I'm not sure if this is correct
If I change the template $priceData[*] it works, but only shows the first hour as those attributes