# Send or intercept inject node only when required

**URL:** <https://discourse.nodered.org/t/send-or-intercept-inject-node-only-when-required/96473>\
**Category:** General\
**Created:** [8 April 2025 13:17 UTC](https://discourse.nodered.org/t/send-or-intercept-inject-node-only-when-required/96473 "2025-04-08T13:17:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![F11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/f11/32/73913_2.png) [@F11](https://discourse.nodered.org/u/F11)\
**Post date:** [8 April 2025 13:17 UTC](https://discourse.nodered.org/t/send-or-intercept-inject-node-only-when-required/96473/1 "2025-04-08T13:17:42Z")

</div>

Hello,  
I have the following question.  
an Inject Node should trigger my AVR amplifier every few seconds to get the status. But when the amplifier is off, I get error messages all the time.  
Can I set up the Inject Node so that the payload only goes through when a ping arrives?

Thank you very much for your support  
Roland

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/3400b62dd612ef85145427cf040318986bbd1103.png)

somehow between Inject and Get Node as an example

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b1431435fcb71d2cfd0a5a0e8973b80942d02f0a.png)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [8 April 2025 13:33 UTC](https://discourse.nodered.org/t/send-or-intercept-inject-node-only-when-required/96473/2 "2025-04-08T13:33:34Z")

</div>

The ping node will return: a number if it gets a response, or else false.

Use a switch node to only pass the message if msg.payload is a number, then a change node to setup whatever you need for your get zone status node.

Since the ping node can fire at specified intervals, no need for an inject node.

---

<div class="post-metadata">

**Author:** ![F11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/f11/32/73913_2.png) [@F11](https://discourse.nodered.org/u/F11)\
**Post date:** [8 April 2025 15:12 UTC](https://discourse.nodered.org/t/send-or-intercept-inject-node-only-when-required/96473/3 "2025-04-08T15:12:33Z")

</div>

Hello jbudd,  
yes, that's what I thought too ...  
I think it could work like this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3edfab0b5f528f860221514bb7549eb9ea458757.png)

---

<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:** [22 April 2025 15:13 UTC](https://discourse.nodered.org/t/send-or-intercept-inject-node-only-when-required/96473/4 "2025-04-22T15:13:31Z")

</div>

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