This thread is for an old component/card that no longer exists. For the Upcoming-Media-Card thread go here: https://community.home-assistant.io/t/lovelace-upcoming-media-card/
localhost would only work if sonarr is installed on the same machine that’s running hassio. you need to use the IP address of the machine sonarr is running on.