-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration
In earlier versions of this project, all configuration settings for the project were defined as constants at the top of the remind.py
file. What this meant to users was that if I released an update to the prject source, any setting changes you made would be overwritten by the software update. That's not nice, is it?
For this version, I extracted all of the user-settable settings from the remind.py
file (and added a few new ones) to the project's config.json
file. That file doesn't exist right now because to include it in the project would simply create the same overwriting issue described in the previous paragraph. Instead, I included a files called config.rename
that contains all the settings; to use it, you must use that file as a starting point for your settings for this project. You could rename the file to the required file name, but then you'd lose the original settings to use as a reference later. Instead, lets make a copy of the source file, then modify the copy. There's two ways to do this, you can use the graphical File Manger or commands typed in a terminal window.
To use the File Manager Open the Raspbian File Manager application (it's the one that looks like a folder) in the menu bar at the top-left corner of the screen. Navigate to the pi-remind-hd-notify
folder then right click on the config.rename
file and select Copy. Next, right-click on an open space in the same folder and select Paste. The File Manager application will warn you that there is already a file with the same name in this location, in the dialog that appears (shown below), simply rename the file to config.json
and click the Rename button to complete the copy.
The other option is to open a terminal window, navigate to the pi-remind-hd-notify
folder, and execute the following command:
cp config.rename config.json
With either approach, validate that you now have a file in the pi-remind-hd-notify
folder called config.json
. When you open the file, it will look something like this:
{
"access_token": "YOUR_PARTICLE_ACCESS_TOKEN",
"busy_only": false,
"device_id": "YOUR_PARTICLE_DEVICE_ID",
"debug_mode": false,
"display_meeting_summary": true,
"reminder_only": false,
"use_reboot_counter": true,
"reboot_counter_limit": 10,
"use_remote_notify": true,
"use_working_hours": true,
"work_start": "8:00",
"work_end": "17:30"
}
You can leave the file as is if you want, I tried to preload it with the most common options.
Note: On startup, the Pi Remind app validates that the config file contains all of the configuration properties shown above, so please don't remove any from the file.
The remaining sections describe each of the configuration options in detail; the following list provides links to each section:
access_token
busy_only
device_id
debug_mode
-
display_meeting_summary
, reminder_only
use_reboot_counter
reboot_counter_limit
use_remote_notify
use_working_hours
work_start
work_end
The configuration settings described in this section control how Pi Remind interacts with your calendar and how it displays calendar information on the Pi Remind display.
Google Calendar supports two appointment status states: Busy or Free. If you only want to be notified of appointments that you've marked as Busy, set the value for busy_only
to true
:
"busy_only": true,
If you have appointments you've marked as Free but you want reminded of them, set busy_status
to false
.
"busy_only": false,
How I use this: If I know I'm not planning on attending a meeting, I decline the meeting so it doesn't even show up on my calendar. If I plan on attending the meeting, I Accept it and leave the status as Busy. For meetings I'm not sure I'm attending, I'll set the meeting status to Free then disable busy_status
(set it to false
) so Pi Remind notifies me of all appointments.
Note: Pi Remind automatically ignores all day meetings, so it only sees meetings that have start and end times.
This setting controls whether Pi Remind displays the upcoming meeting summaries on the display during a notification. By default, Pi Remind displays the subject of every appointment when reminding you:
"display_meeting_summary": true,
If you have confidential appointments and don't want nearby eyes seeing who you're meeting next, or what you're meeting about, disable the feature using the following:
"display_meeting_summary": false,
With this configuration, Pi Remind will use the LEDs to flash a reminder for upcoming appointments, but won't display meeting subjects.
Another way some people manage their calendars is to set reminders for appointments they want to attend, and no reminder for unimportant or tentative meetings. By default, Pi Remind notifies you of all appointments through this configuration setting:
"reminder_only": false,
If you want to be reminded only for appointments that have a reminder set, configure Pi Remind using the following:
"reminder_only": true,
Note: Pi Remind ignores the reminder time, so no matter when you have a reminder set, Pi Remind will notify you of upcoming appointments starting 10 minutes before the scheduled start. Fixing this is planned for some future release of Pi Remind.
The biggest change for this version of the Pi Remind project comes from enabling support for the Remote Notify device from Fumbly Stuff.
The microcontroller in Remote Notify is a Particle Photon, an Arduino-compatible device that includes a cloud service that enables applications like the Pi Remind to remotely execute code on the device. In this case, that code sets the color for an illuminated LED on the device - Red for busy, Yellow for Tentative, and Green for free.
The settings described in this section describe how to configure Pi Remind to work with the device.
Note: As I write this, the Remote Notify device is still under development. Check the company web site for availability.
{
"use_remote_notify": true,
"access_token": "",
"device_id": "",
"use_working_hours": true,
"work_start": "8:00",
"work_end": "17:30"
}
By default, Pi Remind disables support for Remote Notify using the following setting:
"use_remote_notify": false,
When you have a Remote Notify device configured and operational on your local Wi-Fi network, enable it in Pi Remind using the following setting:
"use_remote_notify": true,
Pi Remind requires a couple of settings in order to be able to communicate with the Particle Cloud service: access_token
and device_id
. Enabling Remote Notify support doesn't complete the configuration.
The Particle Cloud uses an Access Token to grant access to REST API calls; this is described in detail in Authentication. So, with that in mind, you'll need to provide Pi Remind with an access token for your particle account:
"access_token": "",
You used to be able to obtain the access token from the Particle developer portal, but that option no longer appears. I think perhaps its because you can now have multiple access tokens, which didn't use to be the case. Where you used to be able to access the Access Token now has the following text:
To create an access token for use with the Particle API, install the Particle CLI and use the token create command.
Follow those instructions to obtain an access token and add it to the configuration file, replacing YOUR-PARTICLE-ACCESS-TOKEN
below with your account's Access Token.
"access_token": "YOUR-PARTICLE-ACCESS-TOKEN",
The Particle Cloud interacts with a specific device using its device ID. When an app makes a call to the API, it passes in the device ID for the target device and the method name to execute on the device. For that reason, Pi Remind needs the device ID for the Particle device running the Remote Notify.
To obtain the device ID, login to the Particle Console, select the devices tab, and copy the device ID from the page. An example device is shown in the following figure. Populate the device_id
configuration value with the copied value as shown in the following example:
"device_id": "YOUR-PARTICLE-DEVICE-ID",
Note: Your Device ID won't be a readable string, I just replaced my device ID with the string so you could see what it looked like.
Note: Working Hours is an experimental feature (which means I've not completed coding it yet). It doesn't work, so don't try it. Actually, it does work - you can enable it and when it's enabled the LED on the Remote Notify device will turn off instead of turning Green when there's no active appointment. What doesn't work is checking the current appointment against working hours
To keep the Remote Notify LED from staying on all day, I added a working hours option which, when enabled, turns the LED off during non-working hours. However, if you have an appointment during non-working hours, the LED will turn on (Red or Yellow) depending on your meeting status.
To enable working hours, set the value to true
as shown below:
"use_working_hours": true,
To disable it, set the value to false
as shown below.
"use_working_hours": false,
This feature works with the work_start
and work_end
configuration settings described below. If you enable working hours, you must populate those configuration variables with your work start and work end times.
When you enable working hours, you must also tell Pi Remind when work hours begin using the work_start
configuration value:
"work_start": "8:00",
work_start
uses the hour:minute
format in military (sometimes called European) time. The example above shows a start time of 8:00 AM. If your work hours started at 1:00 PM, then you'd use the following
"work_start": "13:00",
When you enable working hours, you must also tell Pi Remind when work hours end using the work_end
configuration value:
"work_end": "17:30",
work_end
uses the hour:minute
format in military (sometimes called European) time. The example above shows a end time of 5:30 PM
Chislic beef turkey, biltong ham venison brisket beef ribs picanha alcatra leberkas shank jerky. Ribeye tongue pork bacon buffalo salami biltong doner pancetta, beef ribs pork chop turkey chuck t-bone. T-bone kielbasa beef sausage fatback. Spare ribs porchetta swine jowl alcatra turkey. Beef ribs tenderloin landjaeger meatloaf, ham beef ribeye sausage bresaola spare ribs buffalo alcatra chislic turkey.
debug is cool because it outputs everything the app is doing Since the Google Calendar uses it as well, you get output from that library as well
Chislic beef turkey, biltong ham venison brisket beef ribs picanha alcatra leberkas shank jerky. Ribeye tongue pork bacon buffalo salami biltong doner pancetta, beef ribs pork chop turkey chuck t-bone. T-bone kielbasa beef sausage fatback. Spare ribs porchetta swine jowl alcatra turkey. Beef ribs tenderloin landjaeger meatloaf, ham beef ribeye sausage bresaola spare ribs buffalo alcatra chislic turkey.
Chislic beef turkey, biltong ham venison brisket beef ribs picanha alcatra leberkas shank jerky. Ribeye tongue pork bacon buffalo salami biltong doner pancetta, beef ribs pork chop turkey chuck t-bone. T-bone kielbasa beef sausage fatback. Spare ribs porchetta swine jowl alcatra turkey. Beef ribs tenderloin landjaeger meatloaf, ham beef ribeye sausage bresaola spare ribs buffalo alcatra chislic turkey.
Chislic beef turkey, biltong ham venison brisket beef ribs picanha alcatra leberkas shank jerky. Ribeye tongue pork bacon buffalo salami biltong doner pancetta, beef ribs pork chop turkey chuck t-bone. T-bone kielbasa beef sausage fatback. Spare ribs porchetta swine jowl alcatra turkey. Beef ribs tenderloin landjaeger meatloaf, ham beef ribeye sausage bresaola spare ribs buffalo alcatra chislic turkey.
If you find this code useful, and feel like thanking me for providing it, please consider making a purchase from my Amazon Wish List. You can find information on many different topics on my personal blog. Learn about all of my publications at John Wargo Books.