ottoszika / node-red-contrib-ewelink

NodeRED nodes for eWeLink smart devices
https://ottoszika.github.io/node-red-contrib-ewelink
MIT License
48 stars 28 forks source link

Sonoff RF sensor name on event listener response #87

Open Keltere opened 4 years ago

Keltere commented 4 years ago

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 commented 4 years ago

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?

tyeth commented 4 years ago

Will #95 solve this?