# Set blinking state for LED while door is closing

**URL:** <https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282>\
**Category:** General\
**Created:** [5 July 2024 06:06 UTC](https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282 "2024-07-05T06:06:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![delei](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@delei](https://discourse.nodered.org/u/delei)\
**Post date:** [5 July 2024 06:06 UTC](https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282/1 "2024-07-05T06:06:03Z")

</div>

Hello

I want to set the blinking state of a LED on a dashboard while the garagen door is closing / opening.

I am using Meross nodes to get the state of the door (is closed, is opened, it is opening, it is closing). My issue is following:

At the moment I show the end state of the door (is open/closed) by LED. But, while the door is moving I can't see the state of the door - until the end positions are arived. The idea was to show a blinking LED while the door is moving.

I get the payload from the Meross node: [payload.state: "open"] at the moment the movement starts and the payload from the Meross node: [payload.digest.garageDoor[0].open] at the moment the door is in the open position.

I want the LED to flash during this time. How can I achieve this?

---

<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:** [5 July 2024 07:10 UTC](https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282/2 "2024-07-05T07:10:28Z")

</div>

Which dashboard are you using - node-red-dashboard (AKA Dashboard 1) or @flowfuse/node-red-dashboard (AKA Dashboard v2)?

---

<div class="post-metadata">

**Author:** ![delei](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@delei](https://discourse.nodered.org/u/delei)\
**Post date:** [5 July 2024 07:44 UTC](https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282/3 "2024-07-05T07:44:10Z")

</div>

I am using:

node-red-dashboard  
3.6.5  
([node-red-dashboard (node) - Node-RED](https://flows.nodered.org/node/node-red-dashboard))

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [5 July 2024 08:34 UTC](https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282/4 "2024-07-05T08:34:00Z")

</div>

I built a control system for my garage door 4-years ago using a Finite State Machine (FSM).

I installed two microswitches to detect when the door was fully open or fully closed. These signals were detected by a Wemos D1 Mini which sent the "state" to Node-RED using MQTT.

I also re-purposed a broken key-fob and connected it an output pin on the Wemos so I could "simulate" someone pressing the key-fob. My garage door is a bit dumb as once you have told it to "open" it will continue that operation until the door is fully open. If during that time you press the key-fob it will "stop" and if you press the key-fob again it will reverse its direction of travel and start "closing". A similar sequence happens when I tell the door to close. I think this is for safety reasons so if the door encounters an obstacle it will "stop" immediately. I mimicked that behaviour in the FSM mainly so I could also use Alexa to control the door.

Here's a screenshot of the state diagram showing the transitions.

 ![FSM_garage_door](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/0/40baedd6730475b557441ef0cec109a59fac8206.png)  
If I was tackling the project again, I dare say I could arrange to flash an LED during state S1 or S3 using a non-blocking delay or equivalent.

I think I may have written this up as a Project and shared it on the forum.

EDIT: Found it...

> [@One-button garage - help](https://discourse.nodered.org/t/one-button-garage-help/66354/3):
>
> Thanks for the reply. I try to be clearer. The garage is operated by a single button, which if pressed When closed, opens the garage. When open it closes it. From the state of opening or closing it stops it. so: if during opening or closing I press the button, it stops. the following action on the door closing or opening button (reverses the previous command). I would like to open and close the garage and monitor the status (at least to know that it is open) and for this purpose I have p…

---

<div class="post-metadata">

**Author:** ![delei](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@delei](https://discourse.nodered.org/u/delei)\
**Post date:** [5 July 2024 09:16 UTC](https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282/5 "2024-07-05T09:16:49Z")

</div>

Thanks for your response!  
The system is already running and I actually wont install additional hardware. I just looking for a possibility to modify my dashboard with the blinking LED for the working state.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [7 July 2024 23:49 UTC](https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282/6 "2024-07-07T23:49:25Z")

</div>

If you get 4 states from the door, why not just have 4 colours for the led, 1 for each state ?

---

<div class="post-metadata">

**Author:** ![delei](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@delei](https://discourse.nodered.org/u/delei)\
**Post date:** [8 July 2024 04:33 UTC](https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282/7 "2024-07-08T04:33:53Z")

</div>

You are right. But, the question was how I get the LED flash for two states and the same LED (at the same position on the dashboard) with two different colors for each "end-position" state.  
In the meantime I solved the issue.  
I prepared the payload and all other states (colors, blink, text) in advance before I handed over it to the dashboard template.

---

<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:** [6 October 2024 04:34 UTC](https://discourse.nodered.org/t/set-blinking-state-for-led-while-door-is-closing/89282/8 "2024-10-06T04:34:28Z")

</div>

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