I’ve used this method to buy an RPI myself. I can’t give any guarantees on this and they sell out fast! Please visit https://rpilocator.com to thank the author of the service we are using here. Also check out his tips and tricks page.. This automation uses the feed he supplies.
NOTE: I consider this beta! There are lots of improvements that can be made. This is my first Blueprint.
Requirements:
Feedreader
Version V0.90
blueprint:
name: 0.91 Pilocator Alerts
description: Send an alert when Pilocator posts Raspberry PI availability. Requires feed reader.
domain: automation
input:
notify_device:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive notifications.
selector:
device:
integration: mobile_app
country_code:
name: Country Code
default: "Stock Alert ("
selector:
select:
mode: dropdown
options:
- label: "(ANY)"
value: "Stock Alert ("
- label: "(AT)"
value: "Stock Alert (AT)"
- label: "(AU)"
value: "Stock Alert (AU)"
- label: "(BE)"
value: "Stock Alert (BE)"
- label: "(CA)"
value: "Stock Alert (CA)"
- label: "(CH)"
value: "Stock Alert (CH)"
- label: "(CN)"
value: "Stock Alert (CN)"
- label: "(DE)"
value: "Stock Alert (DE)"
- label: "(ES)"
value: "Stock Alert (ES)"
- label: "(FR)"
value: "Stock Alert (FR)"
- label: "(IT)"
value: "Stock Alert (IT)"
- label: "(NL)"
value: "Stock Alert (NL)"
- label: "(PL)"
value: "Stock Alert (PL)"
- label: "(PT)"
value: "Stock Alert (PT)"
- label: "(SE)"
value: "Stock Alert (SE)"
- label: "(UK)"
value: "Stock Alert (UK)"
- label: "(UK)"
value: "Stock Alert (UK)"
- label: "(US)"
value: "Stock Alert (US)"
- label: "(ZA)"
value: "Stock Alert (ZA)"
pi4:
name: pi4
default: "--no--"
selector:
select:
mode: dropdown
options:
- label: "NO"
value: "--no--"
- label: "ANY"
value: "RPi 4"
- label: "1GB"
value: "RPi 4 Model B - 1GB"
- label: "2GB"
value: "RPi 4 Model B - 2GB"
- label: "4GB"
value: "RPi 4 Model B - 4GB"
- label: "8GB"
value: "RPi 4 Model B - 8GB"
pi5:
name: pi5
default: "--no--"
selector:
select:
mode: dropdown
options:
- label: 'NO'
value: "--no--"
- label: "ANY"
value: "RPi 5"
- label: "4GB"
value: "RPi 5 - 4GB"
- label: "8GB"
value: "RPi 5 - 8GB"
multiple: false
cm4_ram:
name: cm4
default: "--no--"
selector:
select:
mode: dropdown
options:
- label: "NO"
value: "--no--"
- label: "ANY"
value: "CM4"
- label: "2GB"
value: "CM4 - 2GB"
- label: "4GB"
value: "CM4 - 4GB"
cm4_wifi:
name: cm4 Wifi
default: "Wifi"
selector:
select:
mode: dropdown
options:
- label: "ANY"
value: "Wifi"
- label: "With Wifi"
value: "With Wifi"
- label: "No Wifi"
value: "No Wifi"
cm4_mmc:
name: cm4 mmc
default: "MMC"
selector:
select:
mode: dropdown
options:
- label: "ANY"
value: "MMC"
- label: "No MMC"
value: "No MMC"
- label: "8GB MMC"
value: "8GB MMC"
- label: "16GB MMC"
value: "16GB MMC"
- label: "32GB MMC"
value: "32GB MMC"
zero_2_w:
name: Zero 2 W
default: "--NO--"
selector:
select:
mode: dropdown
options:
- label: "NO"
value: "--NO--"
- label: "ANY"
value: "Raspberry Pi Zero 2 W"
trigger:
- platform: event
event_type: feedreader
variables:
country_code: !input country_code
pi4: !input pi4
cm4_ram: !input cm4_ram
cm4_wifi: !input cm4_wifi
cm4_mmc: !input cm4_mmc
zero_2_w: !input zero_2_w
## This is live data ########################################################
pi_message: "{{ trigger.event.data.summary }}"
pi_uri: '{{ trigger.event.data.link }}'
## The following two lines are test data. Uncomment for testing.
# pi_message: "{{ 'Stock Alert (US): RPi 4 Model B - 2GB RAM is In Stock at Adafruit 100+ units in stock.' }}"
# pi_uri: '{{ "https://rpilocator.com" }}'
## This is the logic #########################################################
pi_alert: >-
{{ (country_code in pi_message and pi4 in pi_message) or (country_code
in pi_message and cm4_wifi in pi_message and cm4_mmc in pi_message and
cm4_ram in pi_message) or (country_code in pi_message and zero_2_w in
pi_message) }}
condition:
condition: template
value_template: "{{ pi_alert }}"
action:
- alias: "There may be a PI in your future!"
domain: mobile_app
type: notify
device_id: !input notify_device
message: "{{ pi_message + ' v0.91'}}"
data:
actions:
- action: "URI" # Must be set to URI if you plan to use a URI
title: "pilocator.com"
uri: "{{ pi_uri }}"
This goes in your config.yaml
feedreader:
urls:
- rpilocator.com
scan_interval:
minutes: 15
max_entries: 5