Hi,
I am creating a new Device and Feature templates for the Shelly Plug US. I am just trying to understand the JSON parsing so I can add other devices in the future. This particular plug sends messages to:
shellyplugus-XXXXXXX/events/rpc
And the response for Power on is:
I am thinking to get the power state, I would subscribe to:
I am thinking it's not working because there is a colon in "switch:0". I tried escaping it with a backslash but the editor adds two backslashes. If I can get this working I'll add all the features and share them on this forum.
I am creating a new Device and Feature templates for the Shelly Plug US. I am just trying to understand the JSON parsing so I can add other devices in the future. This particular plug sends messages to:
shellyplugus-XXXXXXX/events/rpc
And the response for Power on is:
PHP Code:
{
"src": "shellyplugus-083af2008e24",
"dst": "shellyplugus-083af2008e24/events",
"method": "NotifyStatus",
"params": {
"ts": 1657556975.63,
"switch:0": {
"id": 0,
"output": true,
"source": "WS_in"
}
}
}
PHP Code:
#TOPIC#/events/rpc:params:switch:0:output
Comment