Automation does not Trigger

Hello All,

i have reset up hassio on new system and wrote most of the automatons new, some I just took over from the old installation as they worked fine and there was not reason to change them.

But suddenly do not work and some work. I am not sure why this is.

Es example this automation:

- alias: turn on vacuum if no one is home
  trigger: 
    platform: time
    at: '10:00:00' 
  condition:
  - condition: time
    after: '09:00'
    before: '12:00'
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  - condition: state
    entity_id: group.family
    state: 'not_home'
  action:    
    service: vacuum.start    
    entity_id: vacuum.eva

Simple Automation.
I double checked all, the entities are correct, if I call the service by hand, the vacuum does start, also the conditions triggers are fine.
Even if I star the animation by hand it works ( I know that the trigger then is not checked).
So the only thing I can imagine could be the start trigger, the time, but how can I check it ?
There is also nothing in the logs in combination with this automation.

Anyone an idea what I can do here ?

Thanks in advance

your indentation is wrong

- alias: turn on vacuum if no one is home
  trigger: 
    platform: time
    at: '10:00:00' 
  condition:
    - condition: time
      after: '09:00'
      before: '12:00'
      weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
    - condition: state
      entity_id: group.family
      state: 'not_home'
  action:    
    service: vacuum.start    
    entity_id: vacuum.eva

Hi,

thanks I changed it, but still not working.

- alias: turn on vacuum if no one is home
  trigger: 
    platform: time
    at: '11:30:00'
  condition:
    - condition: time
      after: '09:00'
      before: '22:00'
      weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
    - condition: state
      entity_id: group.family
      state: 'not_home'
  action:    
    service: vacuum.start    
    entity_id: vacuum.eva

Hi!
Do not know why is that happening, but what if you will try another trigger? Like motion sensore or something else. Just to make sure it works

What is next? Do not know, but then you will be sure, that there is something with trigger
Anyways, let’s see what clever people would suggest :slight_smile:

How are you coming to the conclusion that it isn’t working? Unless the time is currently just before 10am, it won’t trigger, so I’m guessing you are clicking the ‘trigger’ button after opening up the automation entity in the dev-states panel? What happens if you do that?

EDIT: I just noticed that you had 2 different times, so I’m guessing you changed the time and waited for it to pass. Try a the manual trigger to prove that the action works. Did you reload automations or restart HA after making the changes?

HI,

yes, sorry did not mention it, I changed the time so I can be sure I do not have to wait until tomorrow.
I restarte HA fully, just to be sure.

If trigger the automation manually it does work fine.
The Vacuum starts.

I can not check the motion sensor as I am not home :smiley:
But let me remodeled it with a simple light, if I turn on the light, start the vacuum.

Interesting:

- alias: new
  trigger: 
    platform: state
    entity_id: light.flur
    to: 'on'
  condition:
    - condition: time
      after: '09:00'
      before: '22:00'
      weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
    - condition: state
      entity_id: group.family
      state: 'not_home'
  action:    
    service: vacuum.start    
    entity_id: vacuum.eva

This is working as expected.
So there must the something wrong with the time…

Is your system time correct?

Should be correct:

haubuntu:~$ timedatectl
                      Local time: Mon 2019-02-04 12:56:53 CET
                  Universal time: Mon 2019-02-04 11:56:53 UTC
                        RTC time: Mon 2019-02-04 11:56:53
                       Time zone: Europe/Berlin (CET, +0100)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

What’s the time in home assistant?

( sensor.time )

I did not have the sensor.time component.

I added them as sensor, and still no luck.
So i changed it to a state triger and this is working fine now.

I can´t remember do add a time sensor anytime in my config, is this new and i missed it ?
Since when is time a sensor ?

Anyway it does work now !
And this is explains also why some other, times based automations do not work :slight_smile:

Thanks a lot !

Here, just for the records the working automation AFTER adding the time and date component as sensor.

- alias: turn on vacuum if no one is home
  trigger: 
    platform: state
    entity_id: sensor.time
    to: '10:00'
  condition:
    - condition: time
      after: '09:00'
      before: '22:00'
      weekday:
      - mon
      - tue
      - wed1
      - thu
      - fri
    - condition: state
      entity_id: group.family
      state: 'not_home'
  action:    
    service: vacuum.start    
    entity_id: vacuum.eva

The time sensor has been around since 2015 according to the document history. It is not required to be able to use the time platform as a trigger. It’s just a sensor you can use to display the time in the front end or use to update templates that use now().

I have automations very similar to yours that trigger on the time platform (I’m using HA v 0.86.4). They are working. It is very odd that yours is not.

- id: garbage_reminder
  alias: 'Garbage Reminder'  
  trigger:
    platform: time
    at: '20:00:00'
  condition:
    condition: time
    weekday:
      - sun
  action:

Whst is the state of the automation? If you look at the automation in the dev-states page it should show as ‘on’. If not then you need to turn it to ‘on’ (enable it).

They are all on. And some of them are working fine.

Still not all perfect, need to figure out what happens here, will need to check one by one

I have a similar issue since one of the latest releases. Problem seems to have to do with the fact that my presence groups sometimes show ‘On’ or ‘Off’ as their status, instead of ‘Home’ and ‘Not home’.

Reloading the groups fixes the issue temporarily.