Do you actually mean error or do you mean warning? I don’t know how you would suddenly start getting an error but as of 2021.4.0 you should start getting a warning since you are using using something undefined in a template. There’s a whole section on that in last releases release notes: warnings for undefined variables in templates.
Assuming that is what you are seeing then the warning doesn’t break anything its just encouraging you to change it before it does. Have you tried changing that if statement to this:
Thanks, you are right it was a warning, not an error. I had mixed up the warning/error related to Sonos. I was writing this from memory because I had already restored/downgraded to resolve the issue.
This is the error I’m getting:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/ha/homeassistant/lib/python3.8/site-packages/homeassistant/components/sonos/media_player.py", line 501, in update_media
self._play_mode = event.current_play_mode if event else self.soco.play_mode
File "/home/ha/homeassistant/lib/python3.8/site-packages/pysonos/events_base.py", line 183, in __getattr__
raise AttributeError("No such attribute: %s" % name)
AttributeError: No such attribute: current_play_mode
Not sure what is causing that error, I’ll have to do some trial and error to troubleshoot.