Tsar
(Christian)
1
Hi,
I have this in my templates.yaml file :
- trigger:
- trigger: event
event_type: event_template_reloaded
- platform: state
entity_id:
- weather.owm_onecall_daily
- platform: time_pattern
hours: /1
action:
...
Works fine, but why do I get these errors in Studio Code Server ?
tom_l
2
Because you are using a mix of old and new syntax.
The modern syntax is:
- triggers:
- trigger: event
event_type: event_template_reloaded
- trigger: state
entity_id:
- weather.owm_onecall_daily
- trigger: time_pattern
hours: /1
conditions:
- condition: ...
actions:
- action: ...
Tsar
(Christian)
4
Tom,
Seems there is still a problem :
- triggers:
- trigger: event
event_type: event_template_reloaded
- trigger: state
entity_id:
- weather.owm_onecall_daily
- trigger: time_pattern
hours: /1
conditions: []
actions:
- action: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.owm_onecall_daily
response_variable: daily
sensor:
- name: OpenWeatherMap Forecast Cloud coverage
unique_id: openweathermap_forecast_cloud_coverage
state: "{{ daily['weather.owm_onecall_daily'].forecast[0].cloud_coverage }}"
unit_of_measurement: "%"
Seems this is the solution 
- trigger:
- trigger: event
event_type: event_template_reloaded
- trigger: state
entity_id:
- weather.owm_onecall_daily
- trigger: time_pattern
hours: /1
action:
Edwin_D
(Edwin D.)
5
I’m guessing Studio Code has not caught on to the latest changes to trigger based template sensors. The conditions should be possible.
tom_l
6
What version of the Home Assistant Config Helper extension are you using?
Tsar
(Christian)
7
Where do I find that ?
I install all updates, so I should be up-to-date with everything I presume.
The version of Studio Code Server is 5.19.3
tom_l
8
Are you using the add-on or desktop version of VSCode?
tom_l
10
Oops. Yeah for template sensors it is trigger not triggers.
Bit of an inconsistency there compared to the syntax used in automations.