home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.41k stars 30.3k forks source link

Automation launches every day at midnight instead of every 60 hours #32587

Closed yabolek closed 4 years ago

yabolek commented 4 years ago

The problem

Hello,

I wanted to set an automation for watering my plants every 60 hours, but it seems, that instead 60 hours the automation launches every midnight. Is this a bug, or a feature ? ;)

Environment

Problem-relevant configuration.yaml

- id: '1574009746848'
  alias: Uprawa Podlewanie
  description: bylo 5 minut
  trigger:
  - hours: /60
    platform: time_pattern
  condition: []
  action:
  - device_id: f109a8097d224790aac5990bf176e8be
    domain: switch
    entity_id: switch.podlewaczka
    type: turn_on
  - delay: 00:03:00
  - device_id: f109a8097d224790aac5990bf176e8be
    domain: switch
    entity_id: switch.podlewaczka
    type: turn_off

Traceback/Error logs

home-assistant.log.2:2020-01-30 00:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Uprawa Podlewanie
home-assistant.log.2:2020-01-31 00:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Uprawa Podlewanie
home-assistant.log.2:2020-02-01 00:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Uprawa Podlewanie
home-assistant.log.3:2019-12-10 00:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Uprawa Podlewanie
home-assistant.log.3:2019-12-11 00:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Uprawa Podlewanie
home-assistant.log.4:2019-12-05 00:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Uprawa Podlewanie
home-assistant.log.6:2019-12-03 00:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Uprawa Podlewanie
home-assistant.log.7:2019-12-02 00:00:00 INFO (MainThread) [homeassistant.components.automation] Executing Uprawa Podlewanie

Additional information

probot-home-assistant[bot] commented 4 years ago

Hey there @home-assistant/core, mind taking a look at this issue as its been labeled with a integration (automation) you are listed as a codeowner for? Thanks!

cgtobi commented 4 years ago

The documentation actually suggests quoting the time pattern (")

  trigger:
    hours: "/60"
    platform: time_pattern
yabolek commented 4 years ago

The documentation actually suggests quoting the time pattern (")

  trigger:
    hours: "/60"
    platform: time_pattern

Thanks, this automation was created via GUI - I did not interfere with the file itself. Do you think that is the problem?

cgtobi commented 4 years ago

Did you enter it with quotes? Does it works if you use quotes?

yabolek commented 4 years ago

Did you enter it with quotes? Does it works if you use quotes?

Unfortunately it does not work. Still launches every midnight :(

balloob commented 4 years ago

Valid hour values range from 0 - 23. It can never be 60:00:00. The maximum is 23:59:59.

yabolek commented 4 years ago

Valid hour values range from 0 - 23. It can never be 60:00:00. The maximum is 23:59:59.

I wanted it to launch every 60 hours so I thought /60 should work.

What should I do to have it launch every 60 hours ?

balloob commented 4 years ago

That's not currently possible.

balloob commented 4 years ago

Workaround is to write a script with a delay of 60 hours that calls itself.