Even after much reading, I’m afraid I still don’t have a proper grasp of how platform templates work, so that’s probably why I’m struggling to get one working for my garage door automation I’m attempting. This is my relevant bit of config:
cover:
- platform: template
covers:
garage_door_hass:
friendly_name: "Garage Door - HASS"
value_template: "{{is_state('binary_sensor.garage_door', 'on')}}"
open_cover:
service: homeassistant.turn_on
entity_id: switch.garage_door_switch
close_cover:
service: homeassistant.turn_on
entity_id: switch.garage_door_switch
stop_cover:
service: homeassistant.turn_on
entity_id: switch.garage_door_switch
“Check Config” works OK, but I’m seeing this error in the log:
Error while setting up platform template
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/src/homeassistant/homeassistant/components/template/cover.py", line 94, in async_setup_platform
OPEN_ACTION, POSITION_ACTION)
File "/usr/local/lib/python3.7/logging/__init__.py", line 1407, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/local/lib/python3.7/logging/__init__.py", line 1514, in _log
self.handle(record)
File "/usr/local/lib/python3.7/logging/__init__.py", line 1524, in handle
self.callHandlers(record)
File "/usr/local/lib/python3.7/logging/__init__.py", line 1586, in callHandlers
hdlr.handle(record)
File "/usr/local/lib/python3.7/logging/__init__.py", line 894, in handle
self.emit(record)
File "/usr/src/homeassistant/homeassistant/components/system_log/__init__.py", line 167, in emit
_figure_out_source(record, stack, self.hass))
File "/usr/src/homeassistant/homeassistant/components/system_log/__init__.py", line 92, in __init__
self.message = record.getMessage()
File "/usr/local/lib/python3.7/logging/__init__.py", line 369, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
I assume the issue is with the value_template. I’ve tried loads of variations of this, but I can’t get any to work.
Can anyone help me decipher what that error message is telling me please?