I’ve been trying to configure fail2ban and has followed the cookbook here to the letter
However, I don’t see the log file where it should’ve been and get this error
[homeassistant.config] Invalid config for [sensor.fail2ban]: file not readable for dictionary value @ data['file_path']. Got '/var/log/fail2ban.log'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.fail2ban/
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType'
2017-11-29 15:25:46 ERROR (MainThread) [homeassistant.components.sensor] Error on device update!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 217, in
async_add_entity
yield from entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 306, in
async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/fail2ban.py", line 91, in
update
if self.log_parser.timer():
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/fail2ban.py", line 129, in timer
boundary = dt_util.now() - self.interval
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType'
To fix that error see my response here. Basically, scan_interval was intended to be optional, but as of now that is not true. Setting scan_interval in your config will fix that issue.