Hello i am trying to get this added to configuration.yaml
and automations.yaml. but when check configuration before restart.
it says this
Configuratiewaarschuwingen
Invalid config for 'command_line' at configuration.yaml, line 44: 'triggers' is an invalid option for 'command_line', check: command_line->1->triggers
Invalid config for 'command_line' at configuration.yaml, line 45: 'resource' is an invalid option for 'command_line', check: command_line->1->resource
Invalid config for 'command_line' at configuration.yaml, line 46: 'name' is an invalid option for 'command_line', check: command_line->1->name
Invalid config for 'command_line' at configuration.yaml, line 47: 'scan_interval' is an invalid option for 'command_line', check: command_line->1->scan_interval
Invalid config for 'command_line' at configuration.yaml, line 48: 'value_template' is an invalid option for 'command_line', check: command_line->1->value_template
Invalid config for 'command_line' at configuration.yaml, line 49: 'json_attributes' is an invalid option for 'command_line', check: command_line->1->json_attributes
# Enever.nl stroomprijzen
- triggers: rest
resource: https://enever.nl/api/stroomprijs_vandaag.php?token=my code is removed here
name: Enever Stroomprijs ANWB
scan_interval: 86400
value_template: "OK"
json_attributes:
- data
- platform: template
sensors:
stroomprijs_anwb:
device_class: monetary
unit_of_measurement: €/kWh
unique_id: "enever_stroomprijs_anwb"
value_template: >
{% set now_ts = as_timestamp(utcnow()) %}
{% set values = namespace() %}
{% set values.current = None %}
{% for row in states.sensor.enever_stroomprijs_anwb.attributes.data|reverse if not values.current %}
{% set row_timestamp = as_timestamp(row.datum) %}
{% if now_ts > row_timestamp %}
{% set values.current = row %}
{% endif -%}
{% endfor -%}
{% if values.current %}
{{ values.current.prijsANWB }}
{% else %}
{{ states(entity_id) }}
{% endif %}
friendly_name: "Stroomprijs ANWB"
# Enever.nl gasprijzen
- trigger: rest
resource: https://enever.nl/api/gasprijs_vandaag.php?token=my code is removed here
name: Gasprijs ANWB
unique_id: enever_gasprijs_anwb
force_update: true
scan_interval: 86400
device_class: monetary
unit_of_measurement: €/m³
value_template: >
{% set now_ts = as_timestamp(utcnow()) %}
{% set values = namespace() %}
{% set values.current = None %}
{% for row in value_json.data|reverse if not values.current %}
{% set row_timestamp = as_timestamp(row.datum) %}
{% if now_ts > row_timestamp %}
{% set values.current = row %}
{% endif -%}
{% endfor -%}
{% if values.current %}
{{ values.current.prijsANWB }}
{% else %}
{{ states(entity_id) }}
{% endif %}
and this i changed it to this but i think its good please have a look also here.
automation.yaml
# Enever.nl Update Gasprijs
- id: update_anwb_gasprijs_6uur
alias: "Update ANWB gasprijs 6 uur"
triggers:
- trigger: time
at: "06:01:23"
condition: []
actions:
action: homeassistant.update_entity
target:
entity_id:
- sensor.gasprijs_anwb
- id: update_anwb_gasprijs_7uur
alias: "Update ANWB gasprijs 7 uur"
triggers:
- trigger: time
at: "07:00:23"
condition: []
actions:
action: homeassistant.update_entity
target:
entity_id:
- sensor.gasprijs_anwb
# Enever.nl Update Stroomprijs
- id: update_enever_anwb_kwhprijs_0uur
alias: "Update electricity price feed"
description: Update electricity price feed
triggers:
- trigger: time
at: "00:00:10"
condition: []
actions:
- action: homeassistant.update_entity
data: {}
target:
entity_id:
- sensor.enever_stroomprijs_anwb
mode: single
- id: update_enever_anwb_kwhprijs_uur
alias: "Update dynamische stroom tarieven"
description: Update dynamische stroom tarieven
triggers:
- trigger: time_pattern
minutes: "00"
seconds: "00"
condition: []
actions:
- action: homeassistant.update_entity
data: {}
target:
entity_id:
- sensor.stroomprijs_anwb
mode: single