Closed ChopsKingsland closed 4 years ago
@ChopsKingsland
This error occurs when the deviceId pattern is wrong. Can you share the code snippet by hiding your
I’ve got it working now by changing the device type to light. How do I make it do something when it turns on/off?
def onPowerState(did, state):
# Alexa, turn ON/OFF Device
if did == "<your deviceId>" and state=="ON":
# Do something
elif did == "<your deviceId>" and state=="OFF":
# Do something
return True, state
You can define logic like this.
I did that, and I now get an error about indentation. I've tried every single combination of indentations and it still doesn't work >:(
elif did == lightId and state=="OFF":
^
IndentationError: expected an indented block```
Which editor do you use?
Thonny on RPi
Don't copy the code. Try typing it from scratch.
it doesnt show an error anymore, but when i turn it on/off, nothing happens. How can I make it work?
Just put a print statement and check what data you are getting.
only on and off as i should be. i tried it printing 1 & 2 but nothing happened
Did you try with web console?
Or mail me your code at dhanushdazz@gmail.com . I'll check whats wrong
@ChopsKingsland
Code is fine
Just change "ON" --> "On" and "OFF"-->"Off"
THANKS! 😁 it works!
I try to run the python script example with all the necessary IDs in it, but I get the following error
2020-03-31 19:16:15.095 | ERROR | sinric._sinricpro:__init__:34 - Device Id verification failed
Any ideas on how to fix this?