Hello,
I am struggling to create a trigger-based sensor that is defined in a separate YAML file.
Configuration Details
In my configuration.yaml
, I have the following entry:
template: !include_dir_list template
I have a folder where I store multiple YAML files, each defining different sensors:
config/template/
Inside this folder, I have a file ‘weather_forecast_card.yaml’ with the following content. However, the sensor does not appear in Home Assistant.
- trigger:
- platform: time_pattern
hours: /1
- platform: homeassistant
event: start
action:
- service: weather.get_forecasts
target:
entity_id: weather.forecast_home
data:
type: daily
response_variable: daily
sensor:
- name: Weather Forecast Dashboard Card
unique_id: weather_forecast_dashboard_card
state: "Something File"
attributes: some attributes ....
If I remove the trigger section and start the file directly with the sensor definition, the sensor appears in the Developer Tools.
What am i doing wrong ?