I want to put my sensors in templmate.yaml file but I get a lot off errors.
# EMHASS integreer Solcast Forcast oost en west samengevoegd
- platform: rest
name: "Solcast Forecast Zonnetje Z/O"
json_attributes:
- forecasts
resource: https://api.solcast.com.au/rooftop_sites/2b55-56d8-7046-a4d8/forecasts?format=json&api_key=jKQ62J688md1XW-nSabOg81SZcVAblIQ&hours=24
method: GET
value_template: "{{ (value_json.forecasts[0].pv_estimate)|round(2) }}"
unit_of_measurement: "kW"
device_class: power
scan_interval: 86400
force_update: true
- platform: rest
name: "Solcast Forecast Zonnetje Z/W"
json_attributes:
- forecasts
resource: https://api.solcast.com.au/rooftop_sites/521d-2dc0-0583-a262/forecasts?format=json&api_key=jKQ62J688md1XW-nSabOg81SZcVAblIQ&hours=24
method: GET
value_template: "{{ (value_json.forecasts[0].pv_estimate)|round(2) }}"
unit_of_measurement: "kW"
device_class: power
scan_interval: 86400
force_update: true
- platform: template
sensors:
solcast_24hrs_forecast_zonnetje_z_o:
value_template: >-
{%- set power = state_attr('sensor.solcast_forecast_zonnetje_z_o', 'forecasts') | map(attribute='pv_estimate') | list %}
{%- set values_all = namespace(all=[]) %}
{% for i in range(power | length) %}
{%- set v = (power[i] | float |multiply(1000) ) | int(0) %}
{%- set values_all.all = values_all.all + [ v ] %}
{%- endfor %} {{ (values_all.all)[:48] }}
solcast_24hrs_forecast_zonnetje_z_w:
value_template: >-
{%- set power = state_attr('sensor.solcast_forecast_zonnetje_z_w', 'forecasts') | map(attribute='pv_estimate') | list %}
{%- set values_all = namespace(all=[]) %}
{% for i in range(power | length) %}
{%- set v = (power[i] | float |multiply(1000) ) | int(0) %}
{%- set values_all.all = values_all.all + [ v ] %}
{%- endfor %} {{ (values_all.all)[:48] }}
solcast_24hrs_forecast:
value_template: >-
{% set a = states("sensor.solcast_24hrs_forecast_zonnetje_z_o")[1:-1].split(',') | map('int') | list %}
{% set b = states("sensor.solcast_24hrs_forecast_zonnetje_z_w")[1:-1].split(',') | map('int') | list %}
{% set ns = namespace(items = []) %}
{% for i in range(a | length) %}
{% set ns.items = ns.items + [ a[i] + b[i] ] %}
{% endfor %}
{{ ns.items }}
Logger: homeassistant.config
Bron: config.py:609
First occurred: 09:19:42 (35 gebeurtenissen)
Laatst gelogd: 16:45:47
- Invalid config for ātemplateā at templates.yaml, line 63: āplatformā is an invalid option for ātemplateā, check: platform Invalid config for ātemplateā at templates.yaml, line 64: ānameā is an invalid option for ātemplateā, check: name Invalid config for ātemplateā at templates.yaml, line 65: ājson_attributesā is an invalid option for ātemplateā, check: json_attributes Invalid config for ātemplateā at templates.yaml, line 67: āresourceā is an invalid option for ātemplateā, check: resource Invalid config for ātemplateā at templates.yaml, line 68: āmethodā is an invalid option for ātemplateā, check: method Invalid config for ātemplateā at templates.yaml, line 69: āvalue_templateā is an invalid option for ātemplateā, check: value_template Invalid config for ātemplateā at templates.yaml, line 70: āunit_of_measurementā is an invalid option for ātemplateā, check: unit_of_measurement Invalid config for ātemplateā at templates.yaml, line 71: ādevice_classā is an invalid option for ātemplateā, check: device_class Invalid config for ātemplateā at templates.yaml, line 72: āscan_intervalā is an invalid option for ātemplateā, check: scan_interval Invalid config for ātemplateā at templates.yaml, line 73: āforce_updateā is an invalid option for ātemplateā, check: force_update
- Invalid config for ātemplateā at templates.yaml, line 75: āplatformā is an invalid option for ātemplateā, check: platform Invalid config for ātemplateā at templates.yaml, line 76: ānameā is an invalid option for ātemplateā, check: name Invalid config for ātemplateā at templates.yaml, line 77: ājson_attributesā is an invalid option for ātemplateā, check: json_attributes Invalid config for ātemplateā at templates.yaml, line 79: āresourceā is an invalid option for ātemplateā, check: resource Invalid config for ātemplateā at templates.yaml, line 80: āmethodā is an invalid option for ātemplateā, check: method Invalid config for ātemplateā at templates.yaml, line 81: āvalue_templateā is an invalid option for ātemplateā, check: value_template Invalid config for ātemplateā at templates.yaml, line 82: āunit_of_measurementā is an invalid option for ātemplateā, check: unit_of_measurement Invalid config for ātemplateā at templates.yaml, line 83: ādevice_classā is an invalid option for ātemplateā, check: device_class Invalid config for ātemplateā at templates.yaml, line 84: āscan_intervalā is an invalid option for ātemplateā, check: scan_interval Invalid config for ātemplateā at templates.yaml, line 85: āforce_updateā is an invalid option for ātemplateā, check: force_update
- Invalid config for ātemplateā at templates.yaml, line 87: āplatformā is an invalid option for ātemplateā, check: platform
- Invalid config for ātemplateā at templates.yaml, line 122: invalid template (TemplateSyntaxError: expected token āend of print statementā, got āHKZ681ā) for dictionary value āsensors->plate_recognizer->value_templateā, got ā{{ state_attr(āimage_processing.platerecognizer_q3538_lve_0ā, āwatched_platesā).1HKZ681 }}ā
- Invalid config for ātemplateā at templates.yaml, line 127: invalid template (TemplateSyntaxError: expected token āend of print statementā, got āEHS016ā) for dictionary value āsensors->plate_recognizer->value_templateā, got ā{{ state_attr(āimage_processing.platerecognizer_q3538_lve_0ā, āwatched_platesā).2EHS016 }}ā