Automation editor problem?

I’m past templating problems but something is amiss with my automation.

I’ve got the template tool in dev tools/template evaluating my statement to TRUE when the temp is >72 and FALSE when it’s less, and the script does exactly what I want it to do (turn on water for 1 minute) but I have 2 problems. The automation never triggers and yes, it is turned on. I can trigger it manually and it runs once. but it won’t trigger by itself and it does not repeat every 4 minutes. This was all created in the automation editor, not by hand.

Copy to clipboard

- id: '1567518945323'
  alias: Water on if temp >72
  trigger:
  - minutes: /4
    platform: time_pattern
  condition:
  - condition: template
    value_template: ”{{ state_attr('weather.hopi_house', 'temperature') | int > 72
      }}”
  action:
  - data:
      entity_id: switch.water
    service: script.1567805755733

I read something about the automation editor malforming these platform automations. Am I running into the same problem? I’m on hassio 0.98.1

I took this screen shot at 3:35pm after manually triggering it. it should have repeated twice by now.
2019-09-06%2015_30_18-Home%20Assistant

I don’t know if it’s causing the problem, but I always enclose times and time_patterns in quotes. For instance:

    - platform: time_pattern
      seconds: '/30'

I recommend making a test automation just for the time pattern to make sure that it’s working, and maybe create a persistent notification with the template value in the action to see what it’s evaluating to.

The moment I do that and reload automations, it disappears from the list of available automations which I assume means it’s an error, remove the quotes and it reappears. . I’ve tried both types of quotes ‘ and “

Jeff

See my last edit for another suggestion. I don’t put much stock in the GUI automation editor and wouldn’t be surprised if it behaves strangely.

Well, as a hack programmer, I’m trying to use the tools as provided.

I’ll try your suggestion. - Jeff

EDIT - no go on the time patterns. They don’t trigger at all. I manually added the quotes after trying it without them.

- id: '1567820662562'
  alias: test time pattern
  trigger:
  - hours: ''
    minutes: ’/1’
    platform: time_pattern
    seconds: ''
  condition: []
  action:
  - alias: ''
    data: {}
    service: notify.notify

With no quotes, the automation appears again in the list of automations, and then throws this error once per second (not once per min).

Fri Sep 06 2019 19:24:04 GMT-0700 (PDT)

Error doing job: Exception in callback async_track_utc_time_change..pattern_time_change_listener() at /usr/src/homeassistant/homeassistant/helpers/event.py:399
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/events.py”, line 88, in _run
self._context.run(self._callback, *self._args)
File “/usr/src/homeassistant/homeassistant/helpers/event.py”, line 408, in pattern_time_change_listener
calculate_next(now)
File “/usr/src/homeassistant/homeassistant/helpers/event.py”, line 392, in calculate_next
localized_now, matching_seconds, matching_minutes, matching_hours
File “/usr/src/homeassistant/homeassistant/util/dt.py”, line 264, in find_next_time_expression_time
raise ValueError("Cannot find a next time: Time expression never " “matches!”)
ValueError: Cannot find a next time: Time expression never matches!

The quotes around the time pattern are different (incorrect) compared to other quotes. Did you perchance edit on a mobile/ipad?

Perhaps copy the quotes from the alias to the time pattern…

That’s very observant! And yes, iPad.

New quotes and exactly the same error in the log. Here’s the automation. It now appears in the list of automations. It still doesn’t trigger

- id: '1567820662562'
  alias: test time pattern
  trigger:
  - hours: ''
    minutes: '/1'
    platform: time_pattern
    seconds: ''
  condition: []
  action:
  - alias: ''
    data: {}
    service: notify.notify

Error doing job: Exception in callback async_track_utc_time_change..pattern_time_change_listener() at /usr/src/homeassistant/homeassistant/helpers/event.py:399
Traceback (most recent call last):
File “/usr/local/lib/python3.7/asyncio/events.py”, line 88, in _run
self._context.run(self._callback, *self._args)
File “/usr/src/homeassistant/homeassistant/helpers/event.py”, line 408, in pattern_time_change_listener
calculate_next(now)
File “/usr/src/homeassistant/homeassistant/helpers/event.py”, line 392, in calculate_next
localized_now, matching_seconds, matching_minutes, matching_hours
File “/usr/src/homeassistant/homeassistant/util/dt.py”, line 264, in find_next_time_expression_time
raise ValueError("Cannot find a next time: Time expression never " “matches!”)
ValueError: Cannot find a next time: Time expression never matches!

Try this:

- id: '1567820662562'
  alias: test time pattern
  trigger:
  - minutes: '/1'
    platform: time_pattern
  condition: []
  action:
  - service: notify.notify
    data:
      message: 'Message here'
      title: 'Title for message here'

This works and triggers every minute… and the script turns on the water switch.

- id: '1567820662562'
  alias: test time pattern
  trigger:
  - minutes: /1
    platform: time_pattern
  condition: []
  action:
  - alias: ''
    data: {}
    service: script.1567805755733

But this does not trigger at all. No errors. The only difference is I added the condition template using the automation editor…

- id: '1567820662562'
  alias: test time pattern
  trigger:
  - minutes: /1
    platform: time_pattern
  condition:
  - condition: template
    value_template: ”{{ state_attr('weather.hopi_house', 'temperature') | int > 72}}”
  action:
  - alias: ''
    data: {}
    service: script.1567805755733

Again, the quotes look wrong. (around the template condition)

Wow… “smart punctuation” was turned on… that’s something new in the latest iOS. I’m Still battling it. I’ll tackle it from my pc tomorrow.

Jeff