I would like to trigger 2 IFTTT events with my Puck.js, the first IFTTT event, turns on a wifi plug and the second event turns off the wifi plug, all this done in node-red.
I’m using the following code on the Puck.js, it send a different number each time the button is pressed, a 1 or an 11.
in the node-red input mqtt node, I use the following as the Topic:
/ble/advertise/ca:c2:42:7c:05:dc/ffff
using a function node, I was trying to test for the 2 pressCount value I was sending each time I pressed the puck.js
I could not figure how to test for the pressCount value so I ended up testing for the length.
The following is the code I ended up using in the node fuction:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I would like to trigger 2 IFTTT events with my Puck.js, the first IFTTT event, turns on a wifi plug and the second event turns off the wifi plug, all this done in node-red.
I’m using the following code on the Puck.js, it send a different number each time the button is pressed, a 1 or an 11.
in the node-red input mqtt node, I use the following as the Topic:
/ble/advertise/ca:c2:42:7c:05:dc/ffff
using a function node, I was trying to test for the 2 pressCount value I was sending each time I pressed the puck.js
I could not figure how to test for the pressCount value so I ended up testing for the length.
The following is the code I ended up using in the node fuction:
It worked out OK testing for the length, but if someone could show me how I could test for the pressCount value that would be appreciated.
Thanks