The purpose of the announcements plugin is to create custom strings for use with audio announcements. It's compatible with Indigo 7 only. For example, you can use it to combine custom text, device states and variable values to create real-time custom announcements for use with your favorite audio interface. This is somewhat of a more advanced plugin to set up but once you get the hang of it, it's not too bad. But if you're not familiar with Indigo substitutions and Python format specifiers, you may want to proceed with caution.
Here is an example to understand what the plugin does. Using an Announcements Device, you create a formatting string that looks something like this:
- Code: Select all
%%d:24058256:intro%%. It's <<now, dt:%A>> at <<now, ct:%-I:%M%p>>. The current temperature is <<%%d:1149686816:temp%%, n:0>> degrees.
The plugin then converts this formatting string into something that looks like this:
- Code: Select all
Good evening. It's Tuesday at 9:27PM. The current temperature is 42 degrees.
It may look a bit complicated, but it's really pretty simple once you understand what's going on. The plugin supports Indigo substitutions for device states and variable values. That accounts for the bits that look like %%d:24058256:intro%% or %%d:1149686816:temp%%. However, there are instances where a device state is a float (i.e., 42.1) where you would rather have an integer (i.e., 42). That's where the format specifier comes in. By turning this:
- Code: Select all
%%d:1149686816:temp%%
into this:
- Code: Select all
<<%%d:1149686816:temp%%, n:0>>
42.1 becomes 42 (n:2 would become 42.10, n:10 would become 42.1000000000, and so on).
There are currently three types of format specifiers:
- current time (ct:),
- datetime (dt:) and
- numeric (n:2).
Once the strings are converted, they're saved to Announcement device states that can then be referred to by your audio interface (the plugin is audio interface agnostic.)
If this all sounds a little tough, I've added a simple tool to create the Indigo substitution string, and the format specifiers (datetime, numeric, etc.) are based on standard Python format specifiers (there are examples in the configuration dialog). Once you use the Substitution Generator to create the Indigo Substitution, you can copy and paste it into the announcement string. Lastly, once you've created your announcement string, click the Save button under the text fields to add it to the list of saved announcements. If you exit the configuration dialog without clicking Save, your changes will be lost.
There is a second optional device type called Salutations. This is a "time-aware" device for creating custom Intros and Outros that can be added to announcement strings (for example, the 'Good evening' bit above). You control the messages and the time of day for each message (presently, there are four of them -- morning, afternoon, evening, and night). This device should be pretty self explanatory. Just refer to the custom state of the Salutations device in your Announcements string.
This is an introductory alpha version which means that it may change dramatically in the future so use with caution. To get tips for how to complete various fields you can also hover over a control to get help bubbles with further details. If all that didn't scare you away, you can download the Alpha here:
https://github.com/DaveL17/Announcements
Advanced Users:
The announcement dictionary format:
- Code: Select all
{announcements_device_id: { # Indigo dev id of the custom device (int)
announcement_id: { # Unique number, can be any int as long as it's unique (int)
"Announcement": "", # Announcements plugin formatting string
"nextRefresh": "YYYY-MM-DD HH:MM:SS", # No microseconds
"Name": "", # Announcement name: must be Indigo state name compatible (not start with a number, etc.)
"Refresh": "" # Refresh interval in minutes
}
}
}
{1710896037: {
4526314416: {
'Announcement': u"I'm good enough, and I'm smart enough, and doggone it; people like me.",
'nextRefresh': '2017-06-23 07:12:24',
'Name': u'Stuart Smalley',
'Refresh': u'10'
}
},
1990702686: {
4610683824: {
'Announcement': u'It is <<now, ct:%A>>; <<now, ct:%-H:%M%p>>.',
'nextRefresh': '2017-06-23 07:12:24',
'Name': u'Current Datetime',
'Refresh': u'1'
},
4526314416: {
'Announcement': u"%%d:24058256:intro%%. It's <<%%v:1289138982%%, dt:%A>> at <<now, ct:%-I:%M%p>>. The current temperature is <<%%d:1149686816:temp%%, n:0>> degrees.",
'nextRefresh': '2017-06-23 07:12:24',
'Name': u'Current Weather',
'Refresh': u'1'
}
}
}