Automation when electric car has finished charging

Hi guys
Im trying to automate that my google says that the my car has been charged. but I constantly receive errors…
only announce this between 8am and 9am so i dont wake up the kids, only if the sensor has been over 1750 for 4 hours in a row and delay the announcement with 1 minute

if possible it would be better if there could be a condition that the sensor has been charging over 2000 for over 4 h and now dropped below 10. couse the sensor will always be 2000+ kWh when charging and will drop to 1-2 kWh when idling…

- alias: Charging complete
  trigger:
    - platform: numeric_state
      entity_id: sensor.power
      above: 2000
  condition:
        condition: time
          after: '08:00:00'
          before: '21:00:00'
        condition: state
          state: on
          for:
            hours: 4
  action:
    - service: tts.google_translate_say
      entity_id: media_player.google_home
      data:
        language: 'se'
        message: 'Your car is now charged'
        delay:
          minutes: 1

How can anyone answer this when you say you get constant errors, but don’t tell us what errors you receive?

nice response. thanks. “found error in automation” I’m new to this so I cant dig deeper. Dont know where to find more detailed information…I would expect that the pros here could say whats wrong just by looking at this or point me in the right direction, like you cannot have two conditions etc… but I might be wrong…

Your conditions are setup wrong.

Example:

  condition:
    condition: or
    conditions:
      - condition: template
        value_template: '{{ state_attr('sun.sun', 'elevation') < 4 }}'
      - condition: template
        value_template: '{{ states('sensor.sensorluz_7_0') < 10 }}'

Your delay isn’t in the correct place either. Review the delay section here:

Thanks, ill have a look!

Details of where to find logs etc are in this helpful post. How to help us help you - or How to ask a good question