# Can I use a function to make the alarm sound every minute?

**URL:** <https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540>\
**Category:** General\
**Created:** [2 November 2023 01:41 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540 "2023-11-02T01:41:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomi](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Tomi](https://discourse.nodered.org/u/Tomi)\
**Post date:** [2 November 2023 01:41 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540/1 "2023-11-02T01:41:49Z")

</div>

Hello

I set an alarm on my wireless device to go off every five minutes.

function using  
Can I set an alarm to sound every minute?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [2 November 2023 06:04 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540/2 "2023-11-02T06:04:03Z")

</div>

First off, can I ask why you would set off an alarm every minute? It would seem to me that anyone near the alarm would be tempted to destroy it after a short amount of time.

Assuming you can send something from NR to your wireless device to set off the alarm, why not use [node-red-contrib-cron-plus](https://flows.nodered.org/node/node-red-contrib-cron-plus) and set a schedule?

---

<div class="post-metadata">

**Author:** ![Tomi](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Tomi](https://discourse.nodered.org/u/Tomi)\
**Post date:** [2 November 2023 06:33 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540/3 "2023-11-02T06:33:31Z")

</div>

Currently, the minimum time a sensor can send an alarm is 5 minutes.  
5 minutes is too long and I want the alarm to go off every minute.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [2 November 2023 06:45 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540/4 "2023-11-02T06:45:45Z")

</div>

If the sensor can only send the alarm every 5 minutes, does it shut off at some time or does it continue to ?  
You could setup a cascade of trigger nodes like this

 ![Screenshot 2023-11-02 at 2.45.14 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cfbbe00a8d93a2c8196c33f30a843958be45636e.png)

```auto
[{"id":"519d3f8f82eea79a","type":"trigger","z":"b1ed59b1c9e6d6ef","name":"","op1":"1","op2":"1","op1type":"str","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":310,"y":140,"wires":[["040ab8dfea136f9d"],["efc505b84271cab9"]]},{"id":"c164de0873ae1dac","type":"inject","z":"b1ed59b1c9e6d6ef","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":140,"wires":[["519d3f8f82eea79a"]]},{"id":"040ab8dfea136f9d","type":"debug","z":"b1ed59b1c9e6d6ef","name":"debug 501","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":200,"wires":[]},{"id":"efc505b84271cab9","type":"trigger","z":"b1ed59b1c9e6d6ef","name":"","op1":"1","op2":"1","op1type":"str","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":310,"y":180,"wires":[["040ab8dfea136f9d"],["176ddb2da6ece2f7"]]},{"id":"176ddb2da6ece2f7","type":"trigger","z":"b1ed59b1c9e6d6ef","name":"","op1":"1","op2":"1","op1type":"str","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":310,"y":220,"wires":[["040ab8dfea136f9d"],["005e3d72abb036b4"]]},{"id":"005e3d72abb036b4","type":"trigger","z":"b1ed59b1c9e6d6ef","name":"","op1":"1","op2":"1","op1type":"str","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":310,"y":260,"wires":[["040ab8dfea136f9d"],["052e914485424cf2"]]},{"id":"052e914485424cf2","type":"trigger","z":"b1ed59b1c9e6d6ef","name":"","op1":"1","op2":"1","op1type":"str","op2type":"str","duration":"1","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":310,"y":300,"wires":[["040ab8dfea136f9d"],[]]}]

```

---

<div class="post-metadata">

**Author:** ![Tomi](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Tomi](https://discourse.nodered.org/u/Tomi)\
**Post date:** [2 November 2023 06:51 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540/5 "2023-11-02T06:51:05Z")

</div>

It continues to operate with an alarm sounding every 5 minutes.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [2 November 2023 06:54 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540/6 "2023-11-02T06:54:23Z")

</div>

Does my example solve your issue?  
does the alam send something to NR?

---

<div class="post-metadata">

**Author:** ![Tomi](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Tomi](https://discourse.nodered.org/u/Tomi)\
**Post date:** [2 November 2023 07:15 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540/7 "2023-11-02T07:15:44Z")

</div>

It didn't solve the problem.  
Repost your question.

Data is received from the wireless sensor every 5 minutes.  
Is it possible to fix every 1 minute? I wonder.

 ![스크린샷 2023-11-02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/90e206a0c0463a6790b3cd90d2be8d69408616ef.png)  
 ![스크린샷 2023-11-02 160540](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/4/845600a149e5ab174ffa82165993e3e559f0001e.png)

```auto
[
    {
        "id": "d9a43cbc15734973",
        "type": "ncd-wireless-node",
        "z": "46b5a43b90df2a1a",
        "name": "",
        "connection": "f4bdf3f4b5cd3511",
        "config_comm": "f4bdf3f4b5cd3511",
        "addr": "00:13:a2:00:42:0c:5a:95",
        "sensor_type": "80",
        "auto_config": true,
        "on_the_fly_enable": false,
        "node_id_delay_active": "",
        "node_id": 0,
        "delay": 300,
        "form_network": false,
        "destination_active": "",
        "destination": "0000FFFF",
        "power_active": "",
        "power": 4,
        "retries_active": "",
        "retries": 10,
        "pan_id_active": "",
        "pan_id": "7FFF",
        "change_enabled": "",
        "change_pr": "0",
        "change_interval": "0",
        "cm_calibration": "60.6",
        "bp_altitude": "0",
        "bp_pressure": "0",
        "bp_temp_prec": "0",
        "bp_press_prec": "0",
        "amgt_accel": "0",
        "amgt_mag": "0",
        "amgt_gyro": "0",
        "impact_accel_active": false,
        "impact_accel": "0",
        "impact_data_rate_active": false,
        "impact_data_rate": "4",
        "impact_threshold_active": false,
        "impact_threshold": 25,
        "impact_duration_active": false,
        "impact_duration": 1,
        "activ_interr_x": 1,
        "activ_interr_y": 2,
        "activ_interr_z": 4,
        "activ_interr_op": 8,
        "force_calibration_co2_auto_config": "",
        "force_calibration_co2": 400,
        "filtering": 0,
        "data_rate": 5,
        "time_series": 0,
        "reading_type": 1,
        "mode_80_active": "",
        "mode_80": 0,
        "measurement_mode_80_active": "",
        "measurement_mode_80": 0,
        "on_request_timeout_80_active": "",
        "on_request_timeout_80": 1,
        "sensor_boot_time_420ma_active": "",
        "sensor_boot_time_420ma": 0,
        "sensor_boot_time_78_active": false,
        "sensor_boot_time_78": "0",
        "deadband_80_active": "",
        "deadband_80": 0,
        "filter_80_active": "",
        "filter_80": 0,
        "output_data_rate_p1_81_active": "",
        "output_data_rate_p1_81": 0,
        "output_data_rate_p2_81_active": "",
        "output_data_rate_p2_81": 0,
        "sampling_duration_p1_81_active": "",
        "sampling_duration_p1_81": 0,
        "sampling_duration_p2_81_active": "",
        "sampling_duration_p2_81": 0,
        "led_alert_mode_84_active": "",
        "led_alert_mode_84": 0,
        "led_accelerometer_threshold_84_active": "",
        "led_accelerometer_threshold_84": "",
        "led_velocity_threshold_84_active": "",
        "led_velocity_threshold_84": "",
        "acceleration_interrupt_threshold_84_active": "",
        "acceleration_interrupt_threshold_84": "",
        "set_rtc_101": 0,
        "current_calibration_82": "",
        "current_calibration_82_active": false,
        "current_calibration_c1_80": 178,
        "current_calibration_c1_80_active": "",
        "current_calibration_c2_80": 178,
        "current_calibration_c2_80_active": "",
        "current_calibration_c3_80": 178,
        "current_calibration_c3_80_active": "",
        "output_data_rate_101_active": true,
        "output_data_rate_101": "9",
        "output_data_rate_101_m2_active": "",
        "output_data_rate_101_m2": 0,
        "sampling_duration_101_active": true,
        "sampling_duration_101": "20",
        "sampling_interval_101_active": true,
        "sampling_interval_101": "0",
        "full_scale_range_101_active": "",
        "full_scale_range_101": 1,
        "full_scale_range_101_m2_active": "",
        "full_scale_range_101_m2": 1,
        "x_axis_101": "",
        "y_axis_101": "",
        "z_axis_101": "",
        "low_pass_filter_80_active": "",
        "low_pass_filter_80": 0,
        "high_pass_filter_80_active": "",
        "high_pass_filter_80": 0,
        "low_pass_filter_81_p2_active": "",
        "low_pass_filter_81_p2": 0,
        "high_pass_filter_81_p2_active": "",
        "high_pass_filter_81_p2": 0,
        "roll_angle_threshold_47": 0,
        "roll_angle_threshold_47_active": "",
        "pitch_angle_threshold_47": 0,
        "pitch_angle_threshold_47_active": "",
        "counter_threshold_35": 50,
        "counter_threshold_35_active": "",
        "payload_length_80_active": "",
        "payload_length_80": 3,
        "motion_threshold_46_active": false,
        "motion_threshold_46": "100",
        "low_calibration_420ma_active": false,
        "low_calibration_420ma": "68805",
        "mid_calibration_420ma_active": false,
        "mid_calibration_420ma": "68724",
        "high_calibration_420ma_active": false,
        "high_calibration_420ma": "68714",
        "x": 390,
        "y": 2600,
        "wires": [
            [
                "8f78cd5d4683cefe",
                "c6dec8cd401e3218",
                "a3061da52a1c9e97",
                "2d74c10476e7d3d8",
                "2d49768ccc387898",
                "c72c045b04fd321c",
                "0caecc1e57b93397",
                "71b6c94169467695",
                "97a7aaeb1f44039f",
                "d0d6d542b5cba1b5",
                "c0620fd4dca1801f",
                "2e3cad06c7d4f551"
            ]
        ]
    },
    {
        "id": "f4bdf3f4b5cd3511",
        "type": "ncd-gateway-config",
        "name": "usb - do",
        "comm_type": "serial",
        "ip_address": "",
        "tcp_port": "2101",
        "port": "COM3",
        "baudRate": "9600",
        "pan_id": "7fff",
        "rssi": false
    }
]

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [2 November 2023 07:27 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540/8 "2023-11-02T07:27:10Z")

</div>

If you are asking `Can node-red make the wireless sensor send an alarm every minute?` the answer is it depends on the wireless device. You will have to look at the wireless devices API to see if you can change the timing.

Did you put the series of `trigger nodes` after the wireless device's node? It should receive a msg and forward it on every minute five times. If you need to send the msg that came from the sensors node, you need change the `trigger` nodes to send `the existing msg object` in both places in the `trigger` node.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 November 2023 07:27 UTC](https://discourse.nodered.org/t/can-i-use-a-function-to-make-the-alarm-sound-every-minute/82540/9 "2023-11-16T07:27:43Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
