#Controlling events on a specific day/time

1 messages · Page 1 of 1 (latest)

steep badge
#

I'm trying to set a specific time for my smart charging of my cars to begin.

I have two automations, one that sets 'none' which means basically "charge whenever it's the cheapest price", and another which reverts to when the charging needs to be finished (see example below).

alias: Helgladdning (set time)
description: ""
triggers:
  - trigger: time
    at: "13:00:00"
    weekday:
      - sun
conditions:
  - condition: device
    device_id: 43c0e0d62f426e823251d90865badad3
    domain: select
    entity_id: eeee7a2c9199df196f68a7daba4354be
    type: selected_option
    option: None
  - condition: device
    device_id: 96a56590d30e31a9cb86074e16a8e8ed
    domain: select
    entity_id: ecc9a15d03760c1218554b9411ee66d6
    type: selected_option
    option: None
  - condition: and
    conditions:
      - condition: time
        weekday:
          - sun
actions:
  - device_id: 43c0e0d62f426e823251d90865badad3
    domain: select
    entity_id: eeee7a2c9199df196f68a7daba4354be
    type: select_option
    option: "08:00"
  - device_id: 96a56590d30e31a9cb86074e16a8e8ed
    domain: select
    entity_id: ecc9a15d03760c1218554b9411ee66d6
    type: select_option
    option: "07:00"
mode: single

Problem is that it doesn't trigger just on Sundays, it triggers randomly and the conditions aren't respected. I can manually trigger the above on any weekday, and it will fire the event. Even if Sunday is the only allowed day.

I've had this issue with other time controller automations as well, and now I want to go to the bottom with this - why aren't the day/time respected?

dull fern
#
#

It triggers randomly is very odd statement. Is your system time set correctly on the HA machine?

steep badge
#

Sorry, it appears randomly, but maybe I should say every hour, since that seems to be what's going on.

Any suggestion on why it happens?

Thanks for the pointer btw!

dull fern
#

can you do print screen of few traces? I have a doubt it really triggers every hour.

steep badge
#

Hmm, sorry I just deleted it since it bothered whit my charging even if disabled(!) I will add it back and do some testing soon

dull fern
#

I've tried in // and for me it works as expected. 2025.9.4.

balmy bridge
#

You do use the latest HA? As adding a day to the time trigger is a very recent addition.

junior sandal
balmy bridge
#

Ahh, yeah, when you manually run the automation THAT is the trigger aka, the time trigger is not used an thus the day isn´t checked as well. And to add to that, a run will not check the conditions and just run the actions. That's why it's called "Run actions" and not "Run automation".

steep badge
#

Thanks for all your feedback here. Will set it up again when electricity prices aren't peaking anymore. Right now it's crazy and I don't want to risk charging at the wrong time.

steep badge
#

OK so I decided to roll the dice, and this is the new automation, let's see on friday how it goes, or if it triggers before that

 id: '1758743445438'
 alias: Helgladdning (set time)
 description: Set charging end time for both EVs on Sunday at 13:00
 triggers:
   - at: '13:00:00'
     weekday:
       - sun
     trigger: time
 conditions:
   - condition: state
     entity_id: select.ev_smart_charging_tesla_charge_completion_time
     state: None
   - condition: state
     entity_id: select.ev_smart_charging_volkswagen_charge_completion_time
     state: None
 actions:
   - target:
       entity_id:
         - select.ev_smart_charging_tesla_charge_completion_time
     data:
       option: '08:00'
     action: select.select_option
   - target:
       entity_id:
         - select.ev_smart_charging_volkswagen_charge_completion_time
     data:
       option: '07:00'
     action: select.select_option
 mode: single
#

And here's the reset when the weekend starts

 alias: Helgladdning (reset to none)
 description: Reset charging end time to None for both EVs on Friday at 13:00
 triggers:
   - at: "13:00:00"
     weekday:
       - fri
     trigger: time
 conditions:
   - condition: or
     conditions:
       - condition: not
         conditions:
           - condition: state
             entity_id: select.ev_smart_charging_tesla_charge_completion_time
             state: None
       - condition: not
         conditions:
           - condition: state
             entity_id: select.ev_smart_charging_volkswagen_charge_completion_time
             state: None
 actions:
   - target:
       entity_id:
         - select.ev_smart_charging_tesla_charge_completion_time
     data:
       option: None
     action: select.select_option
   - target:
       entity_id:
         - select.ev_smart_charging_volkswagen_charge_completion_time
     data:
       option: None
     action: select.select_option
 mode: single
noble quarryBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.