Send notifications whenever a HEMS is heading towards any POI from a customisable list.
Notification messages are made up of callsign, registration and href to adsbexchange.com map, in addition to the POI name.
Notifications are being sent using Firebase Cloud Messaging. To configure Google Service Accounts and permissions, see the Google Cloud Console.
-
$HOME/hems-lookout.confMay contain shell variables to be sourced upon start.
-
$HOME/hems-lookout-users.json"Database" containing FCM tokens and associated POIs.
-
query-adsb.shRetrieve ADS-B data from rapidapi.com and store them in
data/adsbas xz. Filter by squawk and registration regex, save result todata/hemsas JSON. Then callnotify.pyon the latter. -
notify.pyCheck json data gathered by
query-adsb.shagainst POIs innotify.jsonand send FCM notifications for each match. FCM authentication data is expected as service account JSON data in configurable locations. -
notify.jsonDefine notification settings - multiple POIs per recipient (as FCM tokens).
[ { "recipient": "fcm_token", "locations": [ { "name": "BGU Ludwigshafen", "lat": 49.4865268, "lon": 8.3892466 }, { ... } ] } ] -
serviceAccount.jsonService account authentication config.
Format is like:
{ "type": "service_account", "project_id": "hems-lookout", "private_key_id": "4242424242424242424242424242424242424242", "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n", "client_email": "example@hems-lookout.iam.gserviceaccount.com", "client_id": "000000000000000000000", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/example%40hems-lookout.iam.gserviceaccount.com", "universe_domain": "googleapis.com" }Manage service accounts in the Google Cloud Console
-
gcmath.pyModule defining LatLon classs and great circle calculations.
-
deploy.shSynchronise required files to remote.
-
install.shSet up Python venv and cronjob.
-
RAPIDAPI_KEY_ADSBEXCHANGEKey to authenticate against
https://adsbexchange-com1.p.rapidapi.com/v2. -
HEMS_LOOKOUT_FCM_AUTHSpecify location of Firebase service account data file required by
notify.py. -
HEMS_LOOKOUT_FCM_AUTH_STRFor testing, specify Firebase service account data as string. Required by
test_notify.py, to create the service account file from a secret. Takes precedence overHEMS_LOOKOUT_FCM_AUTH.