please check the API Docs,
https://shelly-api-docs.shelly.cloud/gen2/Overview/RPCChannels
(related section is MQTT)
that was very helpfull, thank you!
- we managed to setup MQTT server connection
- we are getting events info on events/rpc topic
but next question appeared:
- we are able to send RPC commands (via MQTT as JSON, src: user_1) to device (topic shellypro4pm-84cca87e3eb8/rpc) , and we are listening to topic "user_1/rpc" for responce
we are getting response right after command sent, but its an error response
"{"id":1,"src":"shellypro4pm-84cca87e3eb8","dst":"user_1", "error": {"code":401, "message":"{\"auth_type\": \"digest\", \"nonce\": 1630447058, \"nc\": 1, \"realm\": \"shellypro4pm-84cca87e3eb8\", \"algorithm\": \"SHA-256\"}"}}"
Please advice how to handle it
Commands we are sending are taken from your docs like:
{"id":1,"src":"user_1","method":"Switch.GetStatus","params":{"id":0}}
or
{"id":123,"src":"user_1","method":"Switch.Set","params":{"id":0,"on":true}}
or
{"id":1,"src":"user_1","method":"Switch.Toggle","params":{"id":0}}
or
{ "jsonrpc":"2.0", "id": 1, "src":"user_1", "method":"Switch.GetConfig", "params": { "id":2 } }
Cheers, Alex