Hello,
I’m trying to use the include in the configuration.yaml file.
I’m seeing different behavior when I would add all the files in the configuration.yaml file. When I do this alle the enties/sensors will be created. If start separating them in directory called sensor, they won’t be created and I don’t see any messages in the log file.
This is my configuration.yaml file:
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
light: !include lights.yaml
utility_meter: !include utility_meter/utility.yaml
sensor: !include_dir_list sensor/
File 1 in the sensor folder (sensor):
- platform: template
sensors:
energy_gass_eur:
friendly_name: ‘Kosten vandaag gas’
value_template: “{{ (states(‘sensor.gas_daily’)|float * states(‘input_number.gas_energy_cost’)|float)|round(2) }}”
unit_of_measurement: “€”
icon_template: mdi:currency-eur
PRICES GAS
- platform: template
sensors:
gas_price_today:
unit_of_measurement: ‘EUR’
value_template: >-
{% set a = states(‘sensor.gas_daily’) | float %}
{% set b = states(‘input_number.all_in_enkeltarief_gas’) | float %}
{% set c = states(‘input_number.netbeheerkosten_gas’) | float %}
{% set d = states(‘input_number.vaste_leveringskosten_gas’) | float %}
{{ (((a * b) + c) + d) | round(2) }}
gas_price_yesterday:
unit_of_measurement: ‘EUR’
value_template: >-
{% set a = states(‘sensor.gas_yesterday’) | float %}
{% set b = states(‘input_number.all_in_enkeltarief_gas’) | float %}
{% set c = states(‘input_number.netbeheerkosten_gas’) | float %}
{% set d = states(‘input_number.vaste_leveringskosten_gas’) | float %}
{{ (((a * b) + c) + d) | round(2) }}
File 2 (folder sensor):
- platform: template
sensors:
energy_water_eur:
friendly_name: ‘Kosten vandaag water’
value_template: “{{ (states(‘sensor.water_daily’)|float * states(‘input_number.water_energy_cost’)|float)|round(2) }}”
unit_of_measurement: “€”
icon_template: mdi:currency-eur
PRICES GAS
- platform: template
sensors:
water_price_today:
unit_of_measurement: ‘EUR’
value_template: >-
{% set a = states(‘sensor.water_daily’) | float %}
{% set b = states(‘input_number.water_energy_cost’) | float %}
{% set c = states(‘input_number.water_belasting_cost’) | float %}
{% set d = states(‘input_number.vaste_leveringskosten_water’) | float %}
{{ (((a * b) + c) + d) | round(2) }}
water_price_yesterday:
unit_of_measurement: ‘EUR’
value_template: >-
{% set a = states(‘sensor.water_yesterday’) | float %}
{% set b = states(‘input_number.water_energy_cost’) | float %}
{% set c = states(‘input_number.water_belasting_cost’) | float %}
{% set d = states(‘input_number.vaste_leveringskosten_water’) | float %}
{{ (((a * b) + c) + d) | round(2) }}
What have I done wrong?
thx
sasa