Hi CO_4X4,
so frustrating, so much i need to do but this is taking over me at present.
firstly if I use the dev tools and insert {{ state_attr(‘media_player.sittingroomosmc’, ‘media_title’) }} I get the correct output of ‘ITV Nightscreen’
I have added a sensor.yaml file and also added ‘sensor: !include sensor.yaml’ in my /config/configuration.yaml whilst there is no text in sensor.yaml all is ok.
If I than add to the sensor.yaml
- platform: template
sensors:
strip media title
media_title:
friendly_name: 'Media Title'
value_template: "{{ state_attr('media_player.sittingroomosmc', 'media_title') }}"
it gives a green tick but a restart gives the following error
2021-05-09 15:10:48 ERROR (MainThread) [homeassistant.components.hassio] Invalid config for [sensor.template]: expected dictionary for dictionary value @ data[‘sensors’]. Got None
extra keys not allowed @ data[‘friendly_name’]. Got ‘Media Title’
extra keys not allowed @ data[‘media_title’]. Got None
extra keys not allowed @ data[‘value_template’]. Got “{{ state_attr(‘media_player.sittingroomosmc’, ‘media_title’) }}”. (See ?, line ?).
I then remove the above from sensor.yaml and add this instead
- platform: template
sensors:
strip media title
media_title:
friendly_name: 'Media Title'
value_template: '{{ states.media_player.sittingroomosmc.attributes.media_title }}'
I then get this error
2021-05-09 15:15:20 ERROR (MainThread) [homeassistant.components.hassio] Invalid config for [sensor.template]: expected dictionary for dictionary value @ data[‘sensors’]. Got None
extra keys not allowed @ data[‘friendly_name’]. Got ‘Media Title’
extra keys not allowed @ data[‘media_title’]. Got None
extra keys not allowed @ data[‘value_template’]. Got ‘{{ states.media_player.sittingroomosmc.attributes.media_title }}’. (See ?, line ?).