Hi all
This weekend I have decided to tidy up my yaml and convert any old template sensors to the newer format, so far so good, I now have a template.yaml included.
In the template.yaml I have the following:
- sensors:
sensor_1:
friendly_name: "freindly name 1"
....
sensor_2:
friendly_name: "friendly name 2"
....
- binary_sensors:
binary_sensor_1:
friendly_name: "binary_sensor_1"
....
binary_sensor_2:
friendly_name: "binary_sensor_2"
.....
I have removed all these entries from the original yaml and so far every thing is working as expected.
HOWEVER:
I have several template switches that I also waned to add to the same template.yaml but seem unable to no matter what formatting I try:
My current switch.yaml is formatted like this at present:
- platform: template
switches:
switch_1:
friendly_name: 'template switch 1'
....
switch_2:
friendly_name: 'template switch 2'
....
I have tried several different ways to add these to template.yaml and no matter what I try I always end up with errors in the logs.
I assume something like this would work:
- sensors:
....
- binary_sensors:
....
- switches:
switch_1:
friendly_name: 'template switch 1'
....
But I get the following errors in the logs:
Invalid config for [template]: [switches] is an invalid option for [template]. Check: template->switches. (See /config/template.yaml, line 314).
(ERROR) config.py The entity definition format under template: differs from the platform configuration format.
Am I being stupid here or missing something obvious?
TIA
Rossk