This one is a bit specific but nevertheless if someone has a ZTE LTE USB modem stick lying around (I tested this with model MF79U
), this node might come handy to send SMS notifications to your phone.
Thanks for the contribution @ziga
Just a few small things:
Having a quick look at the code - May I suggest having the recipient be overwritten from say msg.recpient
if it exists? I can imagine a Node like this can be used to address different recipients.
Lastly I would change this.
if (!config.phoneNumber || !modem) {
node.status({ fill: 'red', shape: 'ring' });
send(msg);
done();
return;
}
to
if (!config.phoneNumber || !modem) {
const error = 'Missing configuration, and / or recipient'
node.status({ fill: 'red', shape: 'ring', text: error });
// send(msg); /* Don't propagate */
done(new Error(error)); // If done is called with an error, then it will trigger any āCatchā nodes
return;
}
Just some Constructive feedback - again thanks
Thanks @marcus-j-davies make sense yes.
You can define phone recipient number also through incoming node message instead of defining it in properties, by adding recipientNumber
key.
{
payload: "your payload",
topic: "your topic",
recipientNumber: "123456789"
}
Node status warning also added if configuration is missing.
Published version 1.0.2 where these changes are made.