Google Custom Device Action Giving Error on Raspberry Pi Google Assistant
Internet of Things
IoT Frameworks
2 years ago
5
Star Rating
1
Rating
_x000D_
_x000D_
I'm creating a google assistant on my Raspberry Pi 3 and I'm trying to create a custom device action to eventually open my garage door. All it does is play with an LED at this point in time.
Here is my actions.json file:
{
"manifest": {
"displayName": "Garage door",
"invocationName": "Garage door",
"category": "PRODUCTIVITY"
},
"actions": [
{
"name": "me.custom.actions.GarageDoor",
"availability": {
"deviceClasses": [
{
"assistantSdkDevice": {}
}
]
},
"intent": {
"name": "me.custom.intents.GarageDoor",
"trigger": {
"queryPatterns": [
"open the garage door",
"close the garage door"
]
}
},
"fulfillment": {
"staticFulfillment": {
"templatedResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Okay"
}
},
{
"deviceExecution": {
"command": "me.custom.commands.GarageDoor"
}
}
]
}
}
}
}
],
"types": []
}
But when I run the command I get this error:
INFO:root:Transcript of user request: "open the garage door".
INFO:root:Playing assistant response.
WARNING:root:Error during command execution
Traceback (most recent call last):
File "/home/pi/assistant-sdk-python/google-assistant-sdk/googlesamples/assistant/grpc/device_helpers.py", line 94, in dispatch_command
self.handlers[command](**params)
TypeError: gdoor() argument after ** must be a mapping, not NoneType
Here's my handler:
@device_handler.command('me.custom.commands.GarageDoor')
def gdoor(*args):
print(args)
global g_open
if g_open:
GPIO.output(18, 0)
g_open = 0
else:
GPIO.output(18, 1)
g_open = 1
I was playing around with the *args to see if it fixed anything - it didn't. I've changed my package names to custom just for privacy. I'm quite confused here. Any help appreciated!
Thanks!
Posted on 16 Aug 2022, this text provides information on IoT Frameworks related to Internet of Things. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Take Quiz To Earn Credits!
Turn Your Knowledge into Earnings.