hardillb / node-red-contrib-alexa-home-skill

A Node-RED node to control things via Amazon Alexa
https://alexa-node-red.bm.hardill.me.uk/
Apache License 2.0
89 stars 42 forks source link

Locks are not working #91

Closed blackylion closed 3 years ago

blackylion commented 3 years ago

After adding lock Alexa says, that "server is not responding". May be I have done something wrong, but can't also find any manual.

hardillb commented 3 years ago

From the docs:

For Lock device support, both the SetLockState and GetLockState can be answered with a msg.extra.lockState of either "LOCKED" or "UNLOCKED" as follows:

msg.extra = {
    lockState: "LOCKED"
};
msg.paylaod = true;
return msg;

You can not use "Auto Acknowledge" with lock devices, you need to build a message as described in the docs and send it via a response node.

blackylion commented 3 years ago

I have readed this, but, i Assume, this should be done after sending command to the lock to open or close it. Bit i have got "Server not responding" immediately after discovering new devices in Alexa app. I try to redicover it, but nothing helps.

hardillb commented 3 years ago

You are going to have to supply a LOT more detail about exactly what you have done.

blackylion commented 3 years ago

So. I have added one device here https://alexa-node-red.bm.hardill.me.uk/devices with "lock/unlock" ability. After that I have discovered new devices with Alexa app and Alexa founded my lock.

And directly after that on this device I got error message in Alexa app "Server does not respond". But only within this lock. All other devices are working properly.

hardillb commented 3 years ago

No, still not enough detail.

Have you added any nodes to the node-red flow yet? Did you ask Alexa to lock the device?

blackylion commented 3 years ago

No, I haven't ask alexa to do something with lock. Yes, I have added 2 nodes - one is Alexa Home with selected lock and one is response node with injected data regarding docs. but still in alexa app "Server not responding" and "Problem with lock, please check your lock"

hardillb commented 3 years ago

The Alexa-Response node needs to be connected to the Alexa-input node (usually with some logic between).

You can NOT just directly inject things into the response node, it has to be triggered by the message that came from the Alexa-input node.

Screenshot from 2020-11-17 21-02-34

Here the switch node forks the path based on the request:

  1. first path is for SetLockStateRequest
  2. second is for GetLockStateRequest
blackylion commented 3 years ago

Of course they are connected. After 3-4 times of deployment it stops showing me "server not responding" error. But, have no idea why, now it has state "Lock is locked. Alexa can not open this smart device." Where I can find all states, which I can give to response node?

hardillb commented 3 years ago

They are in the docs I pointed to in the first answer.

You can not unlock the device via voice as it is not secure

blackylion commented 3 years ago

Understood. Anyway, thank you for your help! You are awesome!