gablau / node-red-contrib-blynk-iot

Blynk IoT / Blynk 2.0 library implementation for Node-RED using TLS
MIT License
17 stars 7 forks source link

Inconsistencies with the new "Log Event" Node #10

Open Peterkn2001 opened 1 year ago

Peterkn2001 commented 1 year ago

I've just upgraded to release 1.0.0 and done some testing of the Log Event node. The node functions correctly as far as logging the event in Blynk is concerned, but there are some issues with the documentation, the node name, and the "Description" field.

The documentation says...

log event
Blynk logevent node.

For use with Blynk app logevent Widget in merge mode.

To select the color you can use the following methods:

Set msg.hex with hex notation color. (ex. #ff0000 for red)
Set msg.r msg.g msg.b with the relative integer value. (ex. msg.r = 255; msg.g = 0; msg.b = 0; for red)
Set msg.payload to string with rgb values separated by semicolons or "\0". (ex. 255;0;0 for red)
This node also captures write events!

Example output:
{
    "payload":[
        0,
        178,
        77
    ],
    "pin":"0",
    "hex":"#00b24d",
    "r":0,
    "g":178,
    "b":77,
    "rgb":"0;178;77"
}

This appears to be copied from the ZeRGBa node, but makes no sense because there is no "Blynk app logevent Widget", no "merge mode" and no ability to specify the color of the event.

The documentation should probably say that the event needs to be created in the web console. Blynk documentation for this is here: https://docs.blynk.io/en/blynk.console/templates/events/custom-events/events-general-setting

and that msg.payload appears as the event text (limit 300 characters).

Normally in Node-Red the if the "Name" field is populated it appears as the name of the node, but in this case the name of the node is taken from the Event Code field and the Name filed is ignored...

image

Here the node name is "doorbell" rather than "Log Event - Not shown as node name" image

Also, the "Description" field is rather confusing, and doesn't appear to server any purpose. It's confusing because the additional (optional) 300 characters of text that appears in the logged event and/or notification is know as the "Description" in Blynk speak, but this comes from the message payload, not from this field.

It's probably worth mentioning in the documentation that there is a limit of 100 events per 24 hour period, so care should be taken to limit the frequency of event logging, possibly using the standard Node-Red Filter and Limit nodes.

This testing was done using Node-Red v3.0.2

I've not properly tested the new Metadata widget yet, but there seems to be similar issues with the documentation and node name (which always says "by code").

Pete.

gablau commented 1 year ago

Good catch Pete, i will check asap, the help is totally wrong.