How to set Google home device in “listen mode” with node red - speech-to-text

Is there a way to make a node where you can "make" a conversation with google home mini device?
You already can send TTS and it will anounce whatever you type, but is there a way to wait for a response from the end user and receive (his response) STT back into node red?
The end goal is to let Google home mini ask you for input and based on the response you can activate a flow within Node red. But for that you need to activate your speaker into some kind of "listen mode", like you do when saying "hey google"

That depends on what you want the flow to do
If it can be triggered by trying to control a "device" e.g. " hey Google, turn on kitchen light" then there are 3 or 4 nodes/services that will do that. e.g. node-red-contrib-googlehome (full disclosure I wrote and run this one)
There are also some nodes to help with none smart home actions e.g. node-red-contrib-gactions-fulfillment
But you will have to trigger it, you cannot have the device initiate the interaction iirc

Workaround:
When triggered, cast "Are you ok?" and store a flag saying what triggered it and when.
Expect user to say either "OK Google, I'm fine" or "OK Google, I'm not feeling okay"
This triggers actions that look at the flag, and if its not too long ago since it was set, do the appropriate thing.
You could add a timeout to ask again if no reply was given, or to raise an alarm if no response after a number of retries, but that might be prone to false alarms.
This doesn't open google home to listens, it just expect the user to make an ordinary command to google home, that doesn't know that something was casted to it seconds ago.

Related

Building a response in Dialogflow using multiple responses

Please excuse me if this is a really basic question - I'm very much still learning, and I just cannot find a solution.
I'm trying to use the standard basic text responses in Dialogflow, which from what I understand, should work.
What I want to do, is have a set statement (Okay, let's see what I can find), then a random pick from a list, then another set statement, essentially stacking the responses in Dialogflow (see screenshot).
It works absolutely fine in Dialogflow's test console - however, it doesn't do what I want when I take it into the Google action simulator.
Have I made a stupid error, missed a toggle switch somewhere, or am I trying to do something unsupported?
To surface text responses defined in Dialogflow's default response tab go to the Google Assistant response tab and turn on the switch that says "Use response from the DEFAULT tab as the first response.":

How to remove simple response when displaying list card in actions on google for phone surface

Hi i'm having facing a problem that i have selected phone surface where returning both simple response and list card.But in display i'm getting both in simulator.How to remove the simple response when using or displaying list card.
This requirement is for both google home mini and assistant in phone.
Here i need to clear that their is no request from user by clicking
list card.It is only meant for display purpose.
whether my way of implementation is wrong or not don't know correct me if i am wrong.But is it possible to remove or any other way to get rid of the simple response?
Keep in mind that you must have at least one SimpleResponse, in addition to any other RichResponses you may send. This SimpleResponse can contain a blank space - but it must exist. (It should, however, probably include more than a blank space.)
Use following code to detect the Surface
const screenAvailable = conv.available.surfaces.capabilities.has('actions.capability.SCREEN_OUTPUT');
If Surface present, only use UI based response.
If Surface is not present, only use simple response.
Test on a real mobile device and home as simulator shows extra information during simulation.

Google retiring "ranking" email action...how to replace Gmail/Schema.org actions

I'm wondering how I can replace the functionality of the Google ranking action.
I'm sending out email at the end of a ticket/support issue and want to be able to let customers state whether they are happy or not with the service they are getting without opening a web browser(inline button/link) or another method. I was trying to hijack the RSVP method however it appears as if the only answers you can set are "Yes, No, and, Maybe"
Looks like there is a lot in SCHEMA.ORG seems like Google has given up on any additions to the basic 3(Yes,No,Maybe) buttons with no real options.
Thanks

telegram bot prefill text for user to edit

Telegram bot sends me a message with a text snippet, which I want to edit, and send back to the bot for further processing.
Copy and paste takes time. Typing message anew takes time.
Ideally I'd like to press an inline button "Edit" on the bot's message and get the message text appear in my reply input box for editing.(A message id attached to my reply somehow would be a plus).
I tried to use deep linking with parameters other than /start*, but that doesn't seem to work.
Can I use bot API (or any other telegram API) to have text ready for editing in my input box?
It's impossible in official apps yet. Your question is about working with drafts - there are no methods in both API to create them or clear.
Nevertheless, you could fork any official app stored on GiHub and implement what you need if you would prefer a hard way, but compared to that copy/past solution seems much more easier, isn't it?
UPD
I can offer to you a new idea how to solve your problem - hope it will be helpful.
This is about switch_inline_query_current_chat field of InlineKeyboardButton. Just attach an inline button to messages you need to edit. Set a text for this field gotten from recieved message and after pressing you will get this text to your input area. All seems good, but you will take bot's username before the text also.

notify-send only if not already

I'm running linux mint 12 (package base is Ubuntu Oneiric). I essentially want to have a script run every minute or so which does some stuff, and will give me true or false. If true I want a pop-up notification. I'm considering notify-send as this appears to do what I want to do, in a nice unobtrusive way. There are a couple of problems I've encountered though.
I don't want the notifications to stack up. If it returns true and I do not attend to it, it will return true the next time and current this causes the notifications to stack up. Is there any way to check if the notification has already been issued, and thus not send another one (perhaps send the notification again after 10 minutes in case I didn't notice it the first time). The job is currently set up as a cronjob, but I can think of a 'hacky' way of getting this functionality if I was to have the script running constantly and using sleep, but I'd rather avoid that root.
Additionally, how can I make it so that when I click the notification it will launch an application/script of my choosing? This appears to be possible as Dropbox etc issue notifications that behave in this manor, but I'm not sure if that is done through notify-send or not.
Anything to point me in the right direction would be great. Thanks.
From a quick perusal of the libnotify API, it does not appear that the daemon returns anything to the client identifying an outstanding notification. In other words, it's a "fire and forget" API -- once you've sent the request to display a popup you have no way to determine if the popup is still there. I'm afraid you're out of luck, at least with notify-send.
One simple trick is to use the -t option such that the notification expires at the next check. So, for example, if you check via crontab every 10 minutes then you would use
notify-send -t 600000 "You need to update your caffeine level".
This would remove the old notification at the exact time the new one is being issued.

Resources