[SOLVED] Log filling up with an error

Greetings:

I am running OpenUV and have an automation to update it. My logs are filling up with

Mon Jan 28 2019 13:49:15 GMT-0800 (Pacific Standard Time)

Error doing job: Exception in callback <function async_track_utc_time_change..pattern_time_change_listener at 0x7fd48d4f4ae8>
Traceback (most recent call last):
File “uvloop/cbhandles.pyx”, line 64, in uvloop.loop.Handle._run
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/event.py”, line 368, in pattern_time_change_listener
calculate_next(now)
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/event.py”, line 353, in calculate_next
matching_hours)
File “/usr/local/lib/python3.6/site-packages/homeassistant/util/dt.py”, line 256, in find_next_time_expression_time
raise ValueError("Cannot find a next time: Time expression never "
ValueError: Cannot find a next time: Time expression never matches!

So what does your automation look like?

- id: '1548712369563'
 alias: Update OpenUV every 30 minutes during the daytime
 trigger:
 - hours: ''
   minutes: /30
   platform: time_pattern
   seconds: ''
 condition:
   condition: and
   conditions:
     - condition: sun
       after: sunrise
     - condition: sun
       before: sunset
 action:
 - service: openuv.update_data

Have you tried without the hours and seconds options?

Also note the single quotes around the minutes pattern.

 trigger:
   platform: time_pattern
   minutes: '/30'

I have not! Thank you! Will give that a try and report back to close the loop.

Looks like that change did it. Thanks! I appreciate the assist.

No problem. Others may find it useful if you mark the post solved.

I am having the same issue but for the life of me cannot find the part that is wrong…

Error:
2019-01-31 07:37:47 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback <function async_track_utc_time_change..pattern_time_change_listener at 0x7f9bc8638b70>
Traceback (most recent call last):
File “uvloop/cbhandles.pyx”, line 64, in uvloop.loop.Handle._run
File “/usr/src/app/homeassistant/helpers/event.py”, line 368, in pattern_time_change_listener
calculate_next(now)
File “/usr/src/app/homeassistant/helpers/event.py”, line 353, in calculate_next
matching_hours)
File “/usr/src/app/homeassistant/util/dt.py”, line 256, in find_next_time_expression_time
raise ValueError("Cannot find a next time: Time expression never "
ValueError: Cannot find a next time: Time expression never matches!

my automations.yaml:

- id: '1544978233171'
  alias: Pollen_Text
  trigger:
  - at: 07:00:00
    platform: time
  condition:
  - above: '7'
    condition: numeric_state
    entity_id: sensor.allergy_index_today
  action:
  - data:
      message: Allergy Index is High
    service: notify.gmail2
- id: '1544978233174'
  alias: Alarm Away
  hide_entity: true
  trigger:
  - platform: state
    entity_id: sensor.frontd_alarm_level
    to: '255'
  - platform: state
    entity_id: sensor.garaged_alarm_level
    to: '255'
  - platform: state
    entity_id: sensor.backd_alarm_level
    to: '255'
  - platform: state
    entity_id: sensor.multisensor1_alarm_level
    to: '255'
  condition:
    condition: state
    entity_id: alarm_control_panel.ha_alarm
    state: armed_away
  action:
    service: alarm_control_panel.alarm_trigger
    entity_id: alarm_control_panel.ha_alarm
- id: '1544978233175'
  alias: Alarm Home
  hide_entity: true
  trigger:
  - platform: state
    entity_id: sensor.frontd_alarm_level
    to: '255'
  - platform: state
    entity_id: sensor.garaged_alarm_level
    to: '255'
  - platform: state
    entity_id: sensor.backd_alarm_level
    to: '255'
  condition:
    condition: state
    entity_id: alarm_control_panel.ha_alarm
    state: armed_home
  action:
    service: alarm_control_panel.alarm_trigger
    entity_id: alarm_control_panel.ha_alarm
- id: '1544978233176'
  alias: Triggered Flash
  hide_entity: true
  trigger:
    platform: state
    entity_id: alarm_control_panel.ha_alarm
    to: triggered
  action:
  - service: script.turn_on
    entity_id: script.light_flash
  - service: notify.gmail
    data:
      message: Home Alarm Triggered {{now().strftime("%Y%m%d-%H%M%S")}}
- id: '1544978233177'
  alias: Disarmed Off
  hide_entity: true
  trigger:
    platform: state
    entity_id: alarm_control_panel.ha_alarm
    to: disarmed
  action:
  - service: script.turn_off
    entity_id: script.light_loop
  - service: notify.gmail
    data:
      message: Home Alarm Reset {{now().strftime("%Y%m%d-%H%M%S")}}
- id: '1544978233179'
  alias: Turn on Bedroom Motion Light
  trigger:
    platform: state
    entity_id: sensor.bedroom_motion_sensor
    to: motion detected
  action:
    service: homeassistant.turn_on
    entity_id: light.sn2_led
- id: '1544978233179'
  alias: Turn off Bedroom Motion Light
  trigger:
    platform: state
    entity_id: sensor.bedroom_motion_sensor
    to: standby
  action:
    service: homeassistant.turn_off
    entity_id: light.sn2_led
- id: '1544978233180'
  alias: Wake Me Up
  trigger:
    platform: template
    value_template: '{{ states.sensor.time.state == states.sensor.alarm_time.state
      }}'
  condition:
    condition: or
    conditions:
    - condition: and
      conditions:
      - condition: state
        entity_id: input_boolean.alarmweekday
        state: 'on'
      - condition: time
        weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
    - condition: state
      entity_id: input_boolean.alarmweekday
      state: 'off'
  action:
    service: light.turn_on
    entity_id:
    - light.bathroom_lights_level
    - light.lrlamp_level
    - light.tablelamp_level
    - light.dining_room_2
    - light.ceiling_fan_light_2
    - light.bedroom_light_2
    data:
      brightness: 40
- id: '1548631482714'
  alias: Garage Door -Reset
  trigger:
  - hours: ''
    minutes: ''
    platform: time_pattern
    seconds: '4'
  condition:
  - condition: state
    entity_id: switch.garageswitch_switch
    state: 'on'
  action:
  - service: switch.turn_off

When do you think the garage door reset automation triggers?

Hmm, I had rewrote it after my upgrade from 0.69 to 0.86 as it was throwing a format error (was time). It is suppose to work as if it sees the switch ‘on’, wait 4 seconds then turn off.

before the 0.86 update…

- id: '1544978233172'
  alias: Garage Door Reset
  hide_entity: true
  trigger:
  - platform: time
    seconds: /4
  condition:
    condition: state
    entity_id: switch.garageswitch_switch
    state: 'on'
  action:
    service: switch.turn_off
    entity_id: switch.garageswitch_switch

I figured that the internal one had done it correctly but I just the below version and the errors are gone… guess I just needed to see it in a message on home-assistant board, lol. I’ll have to test is later to make sure it still works.

- id: '1548631482714'
  alias: Garage Door -Reset
  trigger:
  - platform: time_pattern
    seconds: '/4'
  condition:
  - condition: state
    entity_id: switch.garageswitch_switch
    state: 'on'
  action:
  - service: switch.turn_off

The way you had it originally it would trigger every minute when the seconds = 04. The way you have it now it will trigger every 4 seconds (then check the condition).

It would be less load on the cpu if you did something like this;

trigger:
  - platform: state
    entity_id: switch.garageswitch_switch
    to: 'on'
    for:
      seconds: 4

Thank you. The purpose of this it to manage my ‘rigged/diy’ garage door opener. If the switch is on, wait 4 seconds and turn it off.

Just so I understand, so I would remove the condition I had altogether. End result being:

- id: '1548631482714'
  alias: Garage Door -Reset
  trigger:
  - platform: state
    entity_id: switch.garageswitch_switch
    to: 'on'
    for:
      seconds: 4
  action:
  - service: switch.turn_off
1 Like