Given the payload:
var webdata_now_p = “1160”;
I got IndexError: list index out of range when testing in templating:
{{ value | regex_findall_index(‘var webdata_now_p = [0-9]+’)}}
Here is the sensor I’m trying to implement:
sensor:
- platform: rest
resource: http://192.168.1.81/status.html
method: GET
name: Actual Solar Power Production
device_class: power
value_template: “{{ value | regex_findall_index(‘var webdata_now_p = [0-9]+’) }}”
verify_ssl: false
unit_of_measurement: W
authentication: basic
username: the_username
password: the_password
force_update: true
Any help would be appreciated!