I’m getting an error in the home-assistant.log regarding Splunk. I am successfully getting data in Splunk, but something is having an issue.
17-04-13 16:28:11 ERROR (Thread-12) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/splunk.py", line 78, in splunk_event_listener
requests.post(event_collector, data=json.dumps(payload),
File "/usr/lib/python3.4/json/__init__.py", line 230, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python3.4/json/encoder.py", line 192, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.4/json/encoder.py", line 250, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.4/json/encoder.py", line 173, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: datetime.datetime(2017, 4, 13, 16, 6, 30) is not JSON serializable
The error is happening sporadically (but happening all the time…) - i.e. sometimes it is 5 seconds apart, sometimes it is 40 seconds apart. My splunk config in configuration.yaml is:
splunk:
token: !secret splunk_token
host: 192.168.1.101
port: 8088