Fleet manager can also be used a RPC relay. If Fleet Manager sees that the dst
key of the incoming JSON-RPC request is a shelly device, Fleet Manager will forward the message to the shelly device. When the shelly device responds, the response will be forwarded to the sender. Below are some examples of use cases:
IN:
{"id":1,"dst":"3ce90e30583c","method":"ws.getconfig","src":"kalin"}
OUT:
{"id":1,"src":"shellyplusplugs-3ce90e30583c","dst":"kalin","result":{"enable":true,"server":"ws://192.168.207.6:7011/shelly","ssl_ca":"ca.pem"}}
IN:
{"id":1,"dst":["3ce90e30583c", "a8032abb995c"],"method":"ws.getconfig","src": "kalin"}
OUT:
{"id":1,"src":"shellyplus1pm-a8032abb995c","dst":"kalin","result":{"enable":true,"server":"ws://192.168.207.6:7011/shelly","ssl_ca":"ca.pem"}}
{"id":1,"src":"shellyplusplugs-3ce90e30583c","dst":"kalin","result":{"enable":true,"server":"ws://192.168.207.6:7011/shelly","ssl_ca":"ca.pem"}}
IN:
[{"id":1,"dst":"3ce90e30583c","method":"ws.getconfig","src":"kalin"},{"id":2,"dst":"a8032abb995c","method":"ws.getconfig","src":"kalin"}]
OUT:
{"id":2,"src":"shellyplus1pm-a8032abb995c","dst":"kalin","result":{"enable":true,"server":"ws://192.168.207.6:7011/shelly","ssl_ca":"ca.pem"}}
{"id":1,"src":"shellyplusplugs-3ce90e30583c","dst":"kalin","result":{"enable":true,"server":"ws://192.168.207.6:7011/shelly","ssl_ca":"ca.pem"}}
IN:
"test
OUT:
{"jsonrpc":"2.0","id":null,"src":"FLEET_MANAGER","error":{"code":-32700,"message":"Parse error"}}
IN:
{"id":1,"src":"kalin","method":"config.get"}
OUT:
{"jsonrpc":"2.0","id":null,"src":"FLEET_MANAGER","error":{"code":-32600,"message":"Invalid request"}}
IN:
{"id":1,"dst":"3ce90e30583c","method":"ws.getconfig","src":"kalin"}
OUT:
{"jsonrpc":"2.0","id":1,"src":"FLEET_MANAGER","error":{"code":-32600,"message":"No such device"}}
Example for username admin
and password admin
:
websocat --header="Authorization:Basic YWRtaW46YWRtaW4=" ws://localhost:7011