Not exactly sure if this would return a 0 at any time.
Also this is a generic webhook, I use it for multiple webhooks from different organizations/templates in blynk and only for 2 webhooks I get the toggling between value and 0
I enabled the webhooks again, this is the logging from Blynk
To store data for more than 6 months and to be able to provide specific reports for the customer. As an example the yearly kWh readout at the end of each month for all his devices
Presumably at the moment you are using a virtual pin on a device to trigger the server-side datastream to send this data to Node-Red. Is that correct?
You could send data to Node-Red either via the Blynk contrib for Node-Red or via MQTT to Node-Red.
It’s difficult to understand why you need things like Virtual Pin Name as opposed to Virtual Pin Number, so without understanding more it’s difficult to advise in more detail.
For these tests we use MQTT as communication between the device and Blynk (we are moving from another platform that uses MQTT, and I want to keep this as it is generic and much easier to migrate)
Using this I see no option to send data via MQTT from blynk to node-red? Each device has it’s own credentials and Blynk does not allow 2 connections on the same credentials.
I have this installed in node red
But to be honest I still have difficulty understanding how to use this
This requires me to create a input per device as I need to add the auth token for each device? If that is the case it is not manageable
But I also see other Blynk palettes for node red, do I have the wrong one?
Virtual pin name of number is arbitrary, both would work.
So (part of) the use case is:
A customer has 100 devices in houses that measure imported and exported kWh’s
The kWh meter connected to the device reads an additional imported kWh, this is send by the device via a VP data stream “imported kWh” (but obviously also has a vp number)
This value needs to be stored in an external database with
a timestamp
organization name (to be able to create reports per organization)
Device name (to report kWh per device)
Virtual pin number (there are other values like exported kWh values that need to be reported separately)
Sounds like you’d be better having the devices talk directly to an MQTT server, then passing that data to Blynk via Node-Red to give your customers the Blynk app as the front-end.
If you use MQTT wildcards and clever use of Subflows you can make provisioning very simple in Node-Red.
I’d suggest you do some research and testing then.
Obviously as this is a commercial project I’m not going to dedicate lots of time to hand-holding, and just getting up to speed with the concept of what you’re trying to achieve is more time than I’m prepared to offer at this stage.
There are some advantages to using Node-Red when you’re using MQTT, especially when you want to make minor changes to the logic/rules engine side of things. It’s far easier to tweak one subflow in Node-Red rather than push software updates out to 100 devices.
Whilst there may be slightly more work enrolling each new user, that’s fairly insignificant if you build your Node-Red flows well, and much of the work can be pre-populated in advance anyway.
If the zeros appears in your device report - it indicates, that the value was sent either from the Device using Blynk Library/MQTT, either using API, either using Automations.
I ran a new report from blynk and you can see the toggling never happened before I started testing with the webhooks.
And since I disabled the webhook after the last test the toggling did not occur anymore.
So I am pretty sure the device does not send 0, this really only occurs when the webhook is enabled.
I assume enabling a webhook should never have any influence on the device??
My hunch is that when the webhook is triggered it resets the datastream somehow to the default value (which is 0).
@i-connect got it, I’ll try to investigate your case. Are you using Blynk Library or MQTT connection? Can you share some code how you are sending values from your device?