node-red-contrib-ewelink icon indicating copy to clipboard operation
node-red-contrib-ewelink copied to clipboard

Sonoff RF sensor name on event listener response

Open Keltere opened this issue 5 years ago • 2 comments
trafficstars

Hi, i was wondering if there is something it could be done to add the sensor name to the ewelink response. In the response i currently get this:

{
    "action": "update",
    "deviceid": "",
    "apikey": "",
    "userAgent": "device",
    "ts": 0,
    "params": {
        "cmd": "trigger",
        "rfTrig2": "2020-02-21T21:27:40.000Z"
    },
    "from": "device"
}

Instead of the sensor name i get a rFTringX where X is the index number of the sensor. If i want to retrieve the name i have to get the device object and check tags.zyx_info[X].name Can be done something about it?

Keltere avatar Feb 22 '20 11:02 Keltere

I've tried to send this request to the device node to get the object i need so i can extrapolate the names of the sensors.

{
    "method": "getDevice",
    "params": [
        "10005f35g6"
    ]
}

Unfortunately i can't do it if don't set the device id in the device node, otherwise i get this: {"error":500,"msg":"Device does not exist"}

There is a way to give the device id as an input to the node?

Keltere avatar Feb 22 '20 11:02 Keltere

Will #95 solve this?

tyeth avatar Jun 20 '20 11:06 tyeth