Nintendo Switch Wish List Sensor and Card

I’ve created a sensor that lets you know when games on your Nintendo Switch wish list are on sale. It can be installed via HACS or manually.

Custom Component: https://github.com/custom-components/sensor.nintendo_wishlist
Custom Card: https://github.com/custom-cards/nintendo-wishlist-card

Screenshot%20from%202019-07-23%2013-08-09

It currently supports 14 countries. If your country is not on the list, then there is currently no way to get the sale data used to populate the sensor and card.

Hi @fahr ,
congratulations for this sensor! really beautiful and functional!

I have a problem with requests, even having entered the commands:

nintendo_wishlist:
 scan_interval:
 # at least one of the following must be specified:
 days: 1
 hours: 0
 minutes: 0
 seconds: 0
 milliseconds: 0

Traffic from HA to Nintendo is high! about 11GB per day!
Could you tell me how to reduce this traffic and update once a day?

Thanks so much!

Just wanted to double check before I start investigating, is what you pasted there the exact yaml in your configuration? If it is, the keys under scan_interval need to be indented for it to work. e.g.

nintendo_wishlist:
 scan_interval:
   days: 1
   hours: 0
   minutes: 0
   seconds: 0
   milliseconds: 0

Hi @fahr ,
This is the configuration I entered in the configuration.yaml file

#############################
#                           
#     Nintendo Switch       
#                           
#############################

nintendo_wishlist:
  scan_interval:
    # at least one of the following must be specified:
    days: 1
    hours: 0
    minutes: 0
    seconds: 0
    milliseconds: 0
  country: IT
  wishlist:
    - Pokémon Scudo
    - Picross
    - Yu-Gi-Oh
    - New Pokémon Snap
    - Super Mario Party
    - "Pokémon Let's Go, Pikachu!"
    - "The Legend of Zelda: Breath of the Wild"
    - Mario Kart 8 Deluxe
    - Brain Training

Thanks for sharing your configuration, that looks correct to me. 11GB is a lot of traffic! The default interval is once an hour and the data it fetches is just text. It does have to fetch a few pages of data, but it wouldn’t be anywhere near even that much traffic. Let’s say it has to grab 10 pages of data every hour (pretty sure it’s less than 10), and each page is 1 mb of data (realistically it’s probably much less than this) then we are looking at ~10mb / hr * 24 which is only 240mb.

One thing the component doesn’t do is cache the images of games on sale, so if they are displaying in your dashboard it loads the url each time it’s displayed. That still seems like it would take a lot of page loads to hit that 11gb mark you are seeing in a single day.

I’ll try out your config and add some debug logging to ensure it’s only fetching data once a day and come back in a day or two with what I found.

yesterday I tried to comment on that piece of code and the traffic dropped significantly.
Below I show you the traffic made by the Home-Assistant client in the last week with the sensor on (to the left of the red line) and off (from 00:00 on 15/04), this screen is taken from my Cisco Meraki dashboard.

yesterday at 11.30 pm I activated the Nintendo sensor. Below is the screenshot of the Home Assistant activity.
About 4GB overnight only.

I used your configuration last night and at first it looked fine, only ran once after 4 hours or so. This morning though it looks like it had run 1700 times which is clearly not right. Not exactly sure what’s going on but I’ll look into it a bit this weekend.

I created an issue on github to make it easier for others to track and will post any updates there.

@Matthew11 This should now be fixed in v3.1.5: Release v3.1.5 · custom-components/sensor.nintendo_wishlist · GitHub :tada:

Thanks for letting me know about this!

1 Like

Hi @fahr !
I checked the traffic made by the Home-Assistant for the Nintendo sensor all weekend.
Now the traffic is correct and everything is working fine!

Thank you so much for the support and for the quick solution!
Have a nice day :smiley: