I have a template sensor which works. I changed it to make it work better then restarted HA but whilst it came online the front end never came back (also my Dash button didn’t work so it wasn’t actually fully running). I could however still use Putty so I did a restart but it did the same again so I don’t think it was a fluke.
Thankfully I could still edit my config so I reset the edits and HA came back.
So, can anyone see why the before works but not the after?
(Before you ask, yes my changes passed the ‘Check Config’)
Unfortunately not without causing the error again as my log gets cleared out after every restart. I’m not keen to do it again in case for some reason it results a worse outcome
I did look at the log and it stopped after the first of the four ‘Future exception was never retrieved’ errors I get every time I restart.
2018-09-21 15:05:59 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 325, in wrapper
result = method(*args, **kwargs)
TypeError: update() takes 1 positional argument but 2 were given
2018-09-21 15:05:59 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 325, in wrapper
result = method(*args, **kwargs)
TypeError: update() takes 1 positional argument but 2 were given
I guess that is possible. It can’t be the first time it has ever happened though, surely? (Maybe it could be Lovelace related so a possible bug as this sensor is used in a view?)
I should have said, I did that, my templating skills are nowhere near good enough to write this ‘freestyle’ without testing it first!
Probably not, better to just set it to ‘unknown’ or ‘pending’ I would think.
I don’t think that error message is to do with your template, but I could be way off. I don’t really understand the python side but I don’t think the ‘positional argument’ bit would relate to template resolution.
No nor do I, I have been getting it four times at each startup for months.
Maybe I’ll bite the bullet and try it again with an else.
It’s a bit alarming though when it just stops working like that!
Thanks for pointing it out as a possibility though.
EDIT: Actually the whole thing is a bit self referential. Your answer ‘Probably not’ makes me inclined to think HA really doesn’t like the way I have constructed it. Maybe I need a new post to ask how to set a template_sensor in such a way that it only changes under certain circumstances, which depend on itself…