Hello to everyone,
using the TTN Node I’m catching the “button” event to receive a trigget on IFTTT that send me a message on Telegram. Everything is working smoothly excelt the fact that TTN IFTTT Integrations send events also when I don’t press my TTN Node button.
In Payload Format - Converter I’ve this:
function Converter(decoded, port) {
// Merge, split or otherwise
// mutate decoded fields.
var converted = decoded;
converted.trigger = false;
if (port === 1 && (converted.led === 0 || converted.led === 1)) {
converted.led = Boolean(converted.led);
}
if (port == 4) {
converted.trigger = true;
}
return converted;
}
This is the decoder part (that I didn’t modify):
function Decoder(bytes, port) {
var decoded = {};
var events = {
1: ‘setup’,
2: ‘interval’,
3: ‘motion’,
4: ‘button’
};
decoded.event = events[port];
decoded.battery = (bytes[0] << 8) + bytes[1];
decoded.light = (bytes[2] << 8) + bytes[3];
decoded.temperature = ((bytes[4] << 8) + bytes[5]) / 100;
return decoded;
}
Should I put trigger=false also in the “decoder” part too?
Thanks
Alessandro Marzini