Configuration.yaml problem

I was testing a few things and I manage to lost all my automations in the fronted.
Right now I get " entity not available: automation xxx "
The problem is in my configuration.yaml which is below

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

homeassistant:
  time_zone: Europe/Athens
  
#discovery:

#automation: !include automations.yaml

# Text to speech
tts:
  - platform: google_translate

I tried to add the “automation: !include automations.yaml” but the problem remains

In the log files I am getting

Invalid config for [automation]: [platform] is an invalid option for [automation]. Check: automation->platform. (See /config/configuration.yaml, line 14). Please check the docs at https://home-assistant.io/integrations/automation/

which is the #automation: !include automations.yaml

but with or without this line my automations are not available. Any ideas what I should do?

Post your automations.

my automations are the same as it was in the morning that everything was fine


###  Floorlight on at Sunset ###
- id: Floorlight on at Sunset
  alias: Floorlight on at Sunset
  trigger:
    - platform: sun
      event: sunset
      offset: '-00:25:00'
  action:
    - service: switch.turn_on
      entity_id: switch.sonoff_10001bb5c7
      
###  FloorLight off when sun is up ###
- id: FloorLight off when sun is up
  alias: FloorLight off when sun is up
  trigger:
    platform: numeric_state
    entity_id: sun.sun
    value_template: "{{ state.attributes.elevation }}"
    above: 2.5
  action:
    service: switch.turn_off
    entity_id: switch.sonoff_10001bb5c7
      
- id: testAirCon by Temperature
  alias: AirCon by Temperature
  trigger:
    platform: numeric_state
    entity_id: sensor.temperature
    below: 19
  condition:
    condition: time
    after: '17:00:00'
    before: '23:59:59'
  action:
    - service: climate.set_temperature
      data:
        entity_id: climate.living_room_ac
        hvac_mode: 'heat'
        temperature: 26
        
#Living_Room AirCon_Heat
- id: Living Room AC
  alias: Living Room Heat
  trigger:
    platform: time
    at: '21:30:00'
  action:
    - service: climate.set_temperature
      data:
        entity_id: climate.living_room_ac
        hvac_mode: 'heat'
        temperature: 26
        
#Bedroom Air Con LR Heat on
- id: Bedroom AC
  alias: Bedroom Heat 
  trigger:
    platform: time
    at: '21:30:00'
  action:
    - service: climate.set_temperature
      data:
        entity_id: climate.bedroom_ac
        hvac_mode: 'heat'
        temperature: 26
        
#Margarita Air Con LR Heat on
- id: Margarita AC
  alias: Margarita Heat 
  trigger:
    platform: time
    at: '21:30:00'
  action:
    - service: climate.set_temperature
      data:
        entity_id: climate.kid_ac
        hvac_mode: 'heat'
        temperature: 26
        
#Tent Tent_windy        
- id: Tent_windyy
  alias: Tent windy
  trigger:
    platform: numeric_state
    entity_id: sensor.dark_sky_wind_speed
    above: 35
  action:
    - service: cover.close_cover
      entity_id: cover.50758014840d8e918614
    - delay: 
        seconds: '60'  
    - service: cover.open_cover
      entity_id: cover.50758014840d8e918614
    - delay: 
         seconds: '15'
    - service: cover.stop_cover
      entity_id: cover.50758014840d8e918614
      
#Tent half open
- id: Tent half open
  alias: Tent Half Open 
  trigger:
    platform: time
    at: '09:20:00'
  action:
    - service: cover.close_cover
      entity_id: cover.50758014840d8e918614
    - delay: 
        seconds: '60'  
    - service: cover.open_cover
      entity_id: cover.50758014840d8e918614
    - delay: 
         seconds: '15'
    - service: cover.stop_cover
      entity_id: cover.50758014840d8e918614

#Kitchen Water Leak
- id: Kitchen_Water_Leak
  alias: Kitchen Water Leak
  trigger:
    - platform: state
      entity_id: binary_sensor.water_kitchen_sensor
      to: 'on'
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.kitchen_water_leak
  condition:
    condition: state
    entity_id: binary_sensor.water_kitchen_sensor
    state: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.book
    - service: notify.pushbullet_notification
      data:
        title: 'Kitchen Water Leak'
        #target: 'device/mySmartphone' #See Pushbullet integration for usage
        message: "Water Leak!!"
    - service: timer.start
      entity_id: timer.kitchen_water_leak
    - service: tts.google_translate_say
      entity_id: media_player.living_room_speaker
      data_template:
        message: "Water Leak"


#Water Heater Off
- id: Hot Water off
  alias: Hot Water off
  trigger:
    entity_id: switch.sonoff_100099b6de
    platform: state
    to: 'on'
    for:
      minutes: '45'
  action:
    service: switch.turn_off
    entity_id: switch.sonoff_100099b6de
    
#Bathroom Heater Off time
- id: Bathroom Heater Off Time
  alias: Bathroom Heater Off Time
  trigger:
    entity_id: switch.sonoff_10001bb126
    platform: state
    to: 'on'
    for:
      minutes: '14'
  action:
    service: switch.turn_off
    entity_id: switch.sonoff_10001bb126

#Bathroom Heater Off Temperature
- id: Bathroom Heater off Temperature
  alias: Bathroom Heater off Temperature
  trigger:
    platform: numeric_state
    entity_id: sensor.temperature_7
    above: 22
  action:
    - service: switch.turn_off
      entity_id: switch.sonoff_10001bb126
      
#Bed Heat
- id: Bed Heat
  alias: Bed Heat
  trigger:
    platform: time
    at: '21:45:00'
  condition:
    condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
  action:
    - service: switch.turn_on
      entity_id: switch.sonoff_10001baf48

** I have to add that today I updated the HA to Home Assistant 0.102.0
However I don’t think that this is the problem

Shouldn’t that be sun.sun ?

If you changed it say 3 weeks ago, didn’t reload it and you restarted today, then that would have forced the reload …
So it ‘was’ caused by you updating (and by an inconsistent previous edit) :man_shrugging:

I am really not sure. I don’t remember to alter it today and it was working fine for over a month.
Even if it should be sun.sun could it cause so much mess in order to loose all my automations?

This is bad practice, you are comparing a string with a number

I’ve been looking two minutes and found two mistakes… Just check through ALL your automations

the platform sun is not the problem. see the first example

also the “{{ state.attributes.elevation }}” was working ok and I have several restarts untill now

Okay, good luck

Dear Mutt
thanks for your help. I am using HA only for 2 months, and most of my automations are completed with the help of this forum. You suggesting to check my automations but I am not able to find something wrong due to limited knowledge. How I could check them. The problems you are suggesting for all I can tell are not, since until this morning were fine. Thanks anyway and really hope someone can find a solution

And this is all your automations.yaml file?

yes only these

Any your automation file is in the same directory as the configuration.yaml file? And the configuration.yaml you posted in your first post is the whole configuration.yaml?

No they are not.
However, I updated the configurator, and tried to add the ““automation: !include automations.yaml””
After a restart my automations are back!

Few days ago I tried to install a custom theme, and also tried to split my automations
I just added some lines like the following but I don’t remember exactly…
Today before the update I checked the configuration file (in tools) and responded with error in these lines. So I erased them. I checked the config again it was green so I proceed with the update.
I am not really sure where the fault was but at least is working now…

zone: !include zone.yaml
sensor: !include sensor.yaml
switch: !include switch.yaml
device_tracker: !include device_tracker.yaml

You need to point the !include to the right direction, if the file you want to include is not in the same direction it will not work.
Let’s say you have this structure:

configuration.yaml
config
   |_ automations.yaml
   |_ sensor.yaml

Then your include would be

automation: !include config/automations.yaml
sensor: !include config/sensor.yaml
etc.

For

Read directory

Burning, are you sure about that? My inclusions all assume config as the base directory ?

Of course it should be “directory” and not “direction” :upside_down_face:

I assume that it needs to be this way, otherwise I could not imagine how the system would know which file you mean.
Let’s say you have a folder configuration, which contains configuration.yaml, a folder config and a folder automation. In the folder config you have a file automations.yaml and in the folder automation you have another file called automation.yaml. How would the system know which of these two automation.yaml file it should take?
I might be completely wrong here, however in my system it works this way, to be honest I never tried it otherwise.

In the documentation

It says : -
Inside the base configuration file add the following entries:

automation: !include automation.yaml
zone: !include zone.yaml
sensor: !include sensor.yaml
switch: !include switch.yaml
device_tracker: !include device_tracker.yaml

Moe’s comming