I’ve just added the last.fm sensor, the docs are here:
It’s showing an error in my log:
2019-05-25 04:12:18 ERROR (MainThread) [homeassistant.core]
Error doing job: Task exception was never retrieved Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 349,
in _async_add_entity 'Invalid entity id: {}'.format(entity.entity_id)) homeassistant.exceptions.HomeAssistantError:
Invalid entity id: sensor.lastfm_Wasabibest
Here’s my YAML for the sensor:
# lastfm - see whenever a user starts scrobbling, their play count, last song played, and top song played on Last.fm.
# https://www.home-assistant.io/components/lastfm/
- platform: lastfm
api_key: !secret lastfm_api_key
users:
- Wasabibest
No sensor entity created either, what am I doing wrong here?
Last.FM usernames need to be entered in lower case. This seems to be because home assistant only allows entity id’s with lower case characters so sensor.lastfm_Wasabibest is not valid but sensor.lastfm_wasabibest is.
Developer Note: adding .lower() will fix this. e.g.
@property
def entity_id(self):
"""Return the entity ID."""
return "sensor.lastfm_{}".format(self._name.lower())