Insult your neighbors mom when they come over for drinks?
Bore your kids to sleep with a dad joke when they turn off their bedroom light?
Scare burglars away with insults when your alarm is triggered?
It’s now possible with the Joke Generator Blueprint!
The automation selects a random joke from a list.
There are 3 types of jokes to choose from:
funny insults
yo momma jokes
dad jokes
It speaks 9 of the most common languages in Europe:
English
German
French
Italian
Spanish
Dutch
Portuguese
Turkish
Russian
See how it works
Select a trigger:
This can be anything and the trigger can be further automated in a separate automation in order for the generator to loop for instance.
Select a joke type: Choose between funny insults, yo momma jokes or dad jokes.
Select a language and Text-to-speech entity (these must match for best performance)
Select the media player you want to say the joke on.
That’s very interesting.
I’ll take a look but honestly, I’ve never worked with API’s before so it might be a while before I get the hang of it.
This creates an entity sensor.joke, which you can now use in assist or on a lovelace dashboard in an entities card. I set the scan interval to one hour to avoid overloading the site.
Yes, I did restart HA, I thought it was to get the conversation working, I never seem to have luck loading components of configuration.yaml. But, I really do enjoy asking “Tell me a joke” on my phone, and having it respond (with text to speech as well as display). How do they direct the voice back to the companion app that originated the request? There is no way to set this up in an automation as far as I can tell.
conversation:
intents:
Tellmeajoke:
- "Tell me a joke"
intent_script:
Tellmeajoke:
speech:
text: "Hey Phil {{ states('sensor.joke') }}"
For the api grab, This works great, but I was wondering about an improvement. Is there a way to plug this into a template sensor and only grab a new joke when you have triggered the last one?
I have tied this to my front door presence, so It might get a trigger every 5 minutes while there’s stuff happening and then not another trigger the rest of the day. I’m thinking why burden the server by pulling ever 5 minutes when maybe I can push an HA button when I use a joke, that triggers going to the api and getting a new one?
Any thoughts?
I guess I could use this blueprint and not burden any server but my own, but…
Set the interval to a day or more and then separately create an automation that gets a new joke when the stored one is spoken?
This would limit the polling to once per day (or longer), or when it’s needed.