Random Trivia + 'Today in History' Generators

I’ve just finished a write up of my latest project using TTS and notifications and wanted to share it with you all.

Using publicly available APIs I’ve built an automation that generates a random trivia question (with answers) and a second automation that finds a notable event that happened on this same date in history. Both automations include a settings file at the start that allows you to define the user who’s requesting the info and which media player should play the TTS.

Here’s a quick summary of what both automations do:

Trivia:
This automation grabs a random multiple choice question with four possible answers from the open trivia database API. A chosen media player then reads the question along with a list of the possible answers. The possible answers are shuffled so you won’t know which is correct. The automation also sends the question and possible answers to the relevant person’s phone, without revealing the answer. Instead, the notification includes an actionable button that reveals the answer when pressed.

‘Today in History’:
This automation generates a random notable event that happened on this same date in the past using the Wikimedia REST API. A chosen media player plays a readable form of the event. The automation also sends the notable event to the person who requested the automation as a notification.

It’s been a nice addition to my usual morning briefing automations and there’s a lot more you could do with it too. I’ve achieved this all with a few nodes in NodeRED and since it’s all so modular you could easily modify this to work for you. All the changes you would need to make are commented and described in detail in the full write up so this would suit someone who is relatively new to home automation too.

Check out a more detailed write up with lots of comments on how it was all done. I’ve also included a copy of the flow so you can try them for yourself. Let me know what you think and if you can think of any more uses for APIs.

3 Likes