node-red-contrib-ewelink
node-red-contrib-ewelink copied to clipboard
Sonoff RF sensor name on event listener response
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?
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?
Will #95 solve this?