You did not read those topics very well.
None of that goes in sensors.yaml.
Put this in your configuration.yaml:
sensor: !include sensors.yaml
template: !include templates.yaml
Put this in templates.yaml
- sensor:
- default_entity_id: sensor.aemet_dir_viento_texto
name: "Dirección viento"
state: >
{% if ( states('sensor.aemet_wind_bearing') | float < 22.5 ) %}
Norte
{% elif ( states('sensor.aemet_wind_bearing') | float < 67.5 ) %}
Noreste
{% elif ( states('sensor.aemet_wind_bearing') | float < 112.5 ) %}
Este
{% elif ( states('sensor.aemet_wind_bearing') | float < 157.5 ) %}
Sureste
{% elif ( states('sensor.aemet_wind_bearing') | float < 202.5 ) %}
Sur
{% elif ( states('sensor.aemet_wind_bearing') | float < 247.5 ) %}
Suroeste
{% elif ( states('sensor.aemet_wind_bearing') | float < 292.5 ) %}
Oeste
{% elif ( states('sensor.aemet_wind_bearing') | float < 337.5 ) %}
Cierzo
{% else %}
Norte
{% endif %}
- default_entity_id: a_a_recibidor_planta_baja_estado
name: "Estado del A/A del recibidor de la planta baja"
state: >
{% if ( states('sensor.medidor_corriente_a_a_planta_baja_power_a') | float > 0 ) %}
on
{% else %}
off
{% endif %}
- default_entity_id: a_a_rellano_1a_planta_estado
name: "Estado del A/A del rellano de la 1ª planta"
state: >
{% if ( states('sensor.medidor_corriente_a_a_1a_planta_power_a') | float > 0 ) %}
on
{% else %}
off
{% endif %}
- default_entity_id: sensor.a_a_buhardilla_escaleras_estado
name: "Estado del A/A de la buhardilla y escaleras"
state: >
{% if ( states('sensor.medidor_corriente_a_a_buhardilla_power_a') | float > 0 ) %}
on
{% else %}
off
{% endif %}
Those last three sensors should be binary sensors as they only have two states.
If you need further help migrating the config then post in the pinned help topic. https://community.home-assistant.io/t/deprecation-of-legacy-template-entities-in-2025-12/955562