2018-04-02 21:30:29 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2803056716: Sending {'id': 2, 'type': 'event', 'event': {'time_fired': datetime.datetime(2018, 4, 2, 18, 30, 29, 204984, tzinfo=<UTC>), 'event_type': 'state_changed', 'origin': 'LOCAL', 'data': {'old_state': <state automation.ebb_waterpump_controller=on; id=waterpump, friendly_name=EBB Waterpump controller, last_triggered=2018-04-02T21:30:28.218818+03:00 @ 2018-04-02T21:24:53.114969+03:00>, 'new_state': <state automation.ebb_waterpump_controller=on; id=waterpump, friendly_name=EBB Waterpump controller, last_triggered=2018-04-02T21:30:29.204891+03:00 @ 2018-04-02T21:24:53.114969+03:00>, 'entity_id': 'automation.ebb_waterpump_controller'}}}
Nothing else. It seems it fires trigger every second.
- id: waterpump
alias: EBB Waterpump controller
trigger:
platform: time
minutes: /1
condition:
condition: template
value_template: '{{ (now().hour*24*60+now().minute) % states.input_number.slider1.state | int == 0 }}'
action:
- service: switch.turn_on
data:
entity_id: switch.ebb_pump
- delay: '00:00:59'
- service: switch.turn_off
data:
entity_id: switch.ebb_pump
Without “| int”:
2018-04-02 21:45:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: exception=Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 335, in async_trigger
if skip_condition or self._cond_func(variables):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 444, in if_action
return all(check(hass, variables) for check in checks)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/__init__.py", line 444, in <genexpr>
return all(check(hass, variables) for check in checks)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/condition.py", line 317, in template_if
return async_template(hass, value_template, variables)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/condition.py", line 299, in async_template
value = value_template.async_render(variables)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/template.py", line 132, in async_render
return self._compiled.render(kwargs).strip()
File "/srv/homeassistant/lib/python3.5/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/srv/homeassistant/lib/python3.5/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/srv/homeassistant/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "<template>", line 1, in top-level template code
TypeError: unsupported operand type(s) for %: 'int' and 'str'