UNPKG

smithtek-nodered-sms

Version:

A Node-RED node for sending SMS via ZTE USB modem.

66 lines (59 loc) 2.38 kB
<script type="text/javascript"> RED.nodes.registerType("zte-sms-reset", { category: "ZTE", color: "#B9B6B8", defaults: { modemIp: { value: "192.168.0.1", required: true }, password: { value: "Admin", required: true } }, inputs: 1, outputs: 1, icon: "icon.png", label: function () { return "ZTE SMS Reset"; } }); </script> <script type="text/html" data-template-name="zte-sms-reset"> <div class="form-row"> <label for="node-input-modemIp"><i class="fa fa-globe"></i> Modem IP</label> <input type="text" id="node-input-modemIp" placeholder="192.168.0.1"> </div> <div class="form-row"> <label for="node-input-password"><i class="fa fa-key"></i> Password</label> <input type="password" id="node-input-password" placeholder="Admin"> </div> </script> <script type="text/html" data-help-name="zte-sms-reset"> <p> <b>ZTE SMS Reset Node</b><br> This node is used to delete all stored SMS messages from a ZTE USB modem. </p> <h3>Configuration</h3> <ul> <li><b>Modem IP</b> - Enter the same modem IP as used in your <b>ZTE SMS</b> node. Default is <code>192.168.0.1</code>.</li> <li><b>Password</b> - Enter the same password as your <b>ZTE SMS</b> node. Default is <code>Admin</code>.</li> </ul> <h3>How It Works</h3> <p> Injecting any payload into this node will trigger it to: </p> <ol> <li>Log in to the modem using the provided credentials.</li> <li>Retrieve a list of all stored SMS messages.</li> <li>Delete each message one by one.</li> <li>Output a message to the debug window indicating how many messages were deleted.</li> </ol> <h3>Output</h3> <p> The node will output a message containing the number of SMS messages deleted. Example output: </p> <pre> { "payload": "Deleted 5 messages." } </pre> <h3>Notes</h3> <ul> <li>This node <b>does not</b> differentiate between received and sent messages—it deletes everything.</li> <li>Ensure you enter the correct <b>Modem IP</b> and <b>Password</b>, as incorrect values will cause login failures.</li> </ul> </script>