# Blinking Light when one of two entities is sending "on" as message payload

**URL:** <https://discourse.nodered.org/t/blinking-light-when-one-of-two-entities-is-sending-on-as-message-payload/88437>\
**Category:** General\
**Created:** [2 June 2024 12:58 UTC](https://discourse.nodered.org/t/blinking-light-when-one-of-two-entities-is-sending-on-as-message-payload/88437 "2024-06-02T12:58:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebnerjoh](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@ebnerjoh](https://discourse.nodered.org/u/ebnerjoh)\
**Post date:** [2 June 2024 12:58 UTC](https://discourse.nodered.org/t/blinking-light-when-one-of-two-entities-is-sending-on-as-message-payload/88437/1 "2024-06-02T12:58:38Z")

</div>

Hi,

I want to let a Light blinking when one of two entities is sending "on" as message payload.

Both entities are sending every 30 seconds either on or off.

If one entity is sending on, a light should blink (on/off) until both entities are sending again off.

What is the best way to achieve this?

Best Regards,  
Johannes

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [2 June 2024 14:20 UTC](https://discourse.nodered.org/t/blinking-light-when-one-of-two-entities-is-sending-on-as-message-payload/88437/2 "2024-06-02T14:20:45Z")

</div>

> [@ebnerjoh](#):
>
> What is the best way to achieve this?

There are quite a few. Here is one way using just core nodes (a no-code solution)

![chrome_AFTSQcjJqV](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/58edf8830727b4d2a6a7413206cea165049a2204.gif)

### Demo flow

_use CTRL+I to import it_

```auto
[{"id":"e84b862476822156","type":"inject","z":"b80ad2c292e3e84c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sensor1","payload":"on","payloadType":"str","x":1100,"y":140,"wires":[["b019eb8ca2b936e6"]]},{"id":"e9388212763bcc04","type":"inject","z":"b80ad2c292e3e84c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sensor2","payload":"on","payloadType":"str","x":1100,"y":180,"wires":[["b019eb8ca2b936e6"]]},{"id":"45e50b0b5ca3a6e4","type":"inject","z":"b80ad2c292e3e84c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sensor1","payload":"off","payloadType":"str","x":1100,"y":240,"wires":[["9f87af3f400966bc"]]},{"id":"cf1e566bebd0eb6f","type":"inject","z":"b80ad2c292e3e84c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"sensor2","payload":"off","payloadType":"str","x":1100,"y":280,"wires":[["9f87af3f400966bc"]]},{"id":"a9de26fd8c0591ec","type":"change","z":"b80ad2c292e3e84c","name":"","rules":[{"t":"set","p":"blink","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":160,"wires":[[]]},{"id":"232caff9a3ea827a","type":"inject","z":"b80ad2c292e3e84c","name":"every 1s","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1100,"y":380,"wires":[["f2a6f5b98f27c277"]]},{"id":"b2d786238526a076","type":"trigger","z":"b80ad2c292e3e84c","name":"","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"500","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1660,"y":360,"wires":[["2830eb45d3f847ad"]]},{"id":"2830eb45d3f847ad","type":"debug","z":"b80ad2c292e3e84c","name":"output","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1810,"y":360,"wires":[]},{"id":"b8f6e0801d865493","type":"switch","z":"b80ad2c292e3e84c","name":"sensor1 == off?","property":"payload.sensor1","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1420,"y":280,"wires":[["70d106f50ce64b0a"]]},{"id":"b2e241d940565e12","type":"change","z":"b80ad2c292e3e84c","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1490,"y":400,"wires":[["b2d786238526a076"]]},{"id":"70d106f50ce64b0a","type":"switch","z":"b80ad2c292e3e84c","name":"sensor2 == off?","property":"payload.sensor2","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1600,"y":280,"wires":[["7c63a196b43b9511"]]},{"id":"7c63a196b43b9511","type":"change","z":"b80ad2c292e3e84c","name":"reset flow.blink","rules":[{"t":"set","p":"blink","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1780,"y":280,"wires":[[]]},{"id":"f2a6f5b98f27c277","type":"switch","z":"b80ad2c292e3e84c","name":"blink == true?","property":"blink","propertyType":"flow","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1280,"y":380,"wires":[["b2d786238526a076"],["b2e241d940565e12"]]},{"id":"eb1a0ddcf8e84cae","type":"join","z":"b80ad2c292e3e84c","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1330,"y":220,"wires":[["b8f6e0801d865493"]]},{"id":"b019eb8ca2b936e6","type":"junction","z":"b80ad2c292e3e84c","x":1220,"y":160,"wires":[["a9de26fd8c0591ec","eb1a0ddcf8e84cae"]]},{"id":"9f87af3f400966bc","type":"junction","z":"b80ad2c292e3e84c","x":1220,"y":260,"wires":[["eb1a0ddcf8e84cae"]]}]

```

---

<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:** [31 August 2024 14:20 UTC](https://discourse.nodered.org/t/blinking-light-when-one-of-two-entities-is-sending-on-as-message-payload/88437/3 "2024-08-31T14:20:54Z")

</div>

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