# Node-red automations not working after reboot

**URL:** <https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176>\
**Category:** eWeLink CUBE\
**Created:** [October 10, 2024, 11:41am UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176 "2024-10-10T11:41:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elvys](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/elvys/32/5548_2.png) [@Elvys](https://forum.ewelink.cc/u/Elvys)\
**Post date:** [October 10, 2024, 11:41am UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/1 "2024-10-10T11:41:32Z")

</div>

We’ve been experiencing power shortages lately due to bad weather, and I’ve noticed that I need to enter the Noder-RED docker container and manually re-deploy my flows, otherwise automations don’t work.  
Is this normal behavior?

Thanks

---

<div class="post-metadata">

**Author:** ![john.e.dixon](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/john.e.dixon/32/1626_2.png) [@john.e.dixon](https://forum.ewelink.cc/u/john.e.dixon)\
**Post date:** [October 10, 2024, 2:58pm UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/2 "2024-10-10T14:58:55Z")

</div>

If they are routines using the inject node be sure to tick the initial checkbox so that it starts again automatically. In other cases using “context” variables if set up to use the “localfilesystem module” in your “settings.js” also helps.

---

<div class="post-metadata">

**Author:** ![Elvys](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/elvys/32/5548_2.png) [@Elvys](https://forum.ewelink.cc/u/Elvys)\
**Post date:** [October 10, 2024, 11:42pm UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/3 "2024-10-10T23:42:35Z")

</div>

I’m almost clueless about node-RED 😅.  
I don’t think I’m using any kind of variables, just some basic button-turns-on-light automations

 ![Captura de pantalla 2024-10-11 a las 1.41.43](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/a/a97ffce9668569666e8a79a655dacf0d458c8e16.png)

---

<div class="post-metadata">

**Author:** ![john.e.dixon](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/john.e.dixon/32/1626_2.png) [@john.e.dixon](https://forum.ewelink.cc/u/john.e.dixon)\
**Post date:** [October 11, 2024, 5:37am UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/4 "2024-10-11T05:37:35Z")

</div>

This example you give should not need redeploying after an outage, as the trigger is your switch.  
What do you see to make you need to redeploy?

---

<div class="post-metadata">

**Author:** ![Elvys](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/elvys/32/5548_2.png) [@Elvys](https://forum.ewelink.cc/u/Elvys)\
**Post date:** [October 11, 2024, 11:11am UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/5 "2024-10-11T11:11:34Z")

</div>

It just doesn’t work, I push any button but lights don’t respond…

---

<div class="post-metadata">

**Author:** ![john.e.dixon](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/john.e.dixon/32/1626_2.png) [@john.e.dixon](https://forum.ewelink.cc/u/john.e.dixon)\
**Post date:** [October 11, 2024, 12:23pm UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/6 "2024-10-11T12:23:29Z")

</div>

What makes you think that this is the Node-red flow? When you go to deploy do you see anything there? Maybe it’s simply the devices offline? The Node-red addon on the iHost shows as running when you start up after an outage?  
Just for interest, because I don’t know if we can discover anything here, but what is not logical is that you need to redeploy a node-red flow.

---

<div class="post-metadata">

**Author:** ![Elvys](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/elvys/32/5548_2.png) [@Elvys](https://forum.ewelink.cc/u/Elvys)\
**Post date:** [October 11, 2024, 9:28pm UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/7 "2024-10-11T21:28:32Z")

</div>

At first I suspected of connection issues, but I have a couple of simple automations made with the iHost scene editor and those do work after the outages.  
Then I tried to check if the buttons were reporting pushes correctly like this:

 ![Captura de pantalla 2024-10-11 a las 23.23.17](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/2/267d6107c456c09c9a7cd4557f26efa9a14e0aa2.png)

After deploying every automation was working correctly. Since then same thing happens on each outage and it’s fixed by just re-deploying.

---

<div class="post-metadata">

**Author:** ![john.e.dixon](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/john.e.dixon/32/1626_2.png) [@john.e.dixon](https://forum.ewelink.cc/u/john.e.dixon)\
**Post date:** [October 12, 2024, 7:00am UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/9 "2024-10-12T07:00:21Z")

</div>

Maybe @ward who knows all about Node-red can shed some light on this.

---

<div class="post-metadata">

**Author:** ![ward](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/ward/32/10437_2.png) [@ward](https://forum.ewelink.cc/u/ward)\
**Post date:** [October 14, 2024, 3:16am UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/10 "2024-10-14T03:16:26Z")

</div>

I have pinged a staff for a closer look, thx

---

<div class="post-metadata">

**Author:** ![SuiKa](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/suika/32/8656_2.png) [@SuiKa](https://forum.ewelink.cc/u/SuiKa)\
**Post date:** [October 14, 2024, 9:45am UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/11 "2024-10-14T09:45:19Z")

</div>

I setup a flow like this and it’s working fine after reboot.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/8/8209b71d6d354984f78711c8b3ecf1cf1bcda07a.png)

There are some info we are curious about:

1. Is the problem happens only on some of your devices or all your devices are the same?
2. What’s the type of your device? Are they from smart-home add-on or just zigbee device?

---

<div class="post-metadata">

**Author:** ![Elvys](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/elvys/32/5548_2.png) [@Elvys](https://forum.ewelink.cc/u/Elvys)\
**Post date:** [October 14, 2024, 9:55pm UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/12 "2024-10-14T21:55:44Z")

</div>

I conducted a test, and the problem only occurs during power outages. If I restart the iHost manually everything works as expected.

1. Yes, it happens with all devices
2. Mostly sonoff zbmini and aqara buttons

---

<div class="post-metadata">

**Author:** ![SuiKa](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/suika/32/8656_2.png) [@SuiKa](https://forum.ewelink.cc/u/SuiKa)\
**Post date:** [October 17, 2024, 3:27am UTC](https://forum.ewelink.cc/t/node-red-automations-not-working-after-reboot/72176/13 "2024-10-17T03:27:50Z")

</div>

We fail to reproduce the problem, reboot the iHost or just unplug it.  
All the automation works fine.  
Can you add a debug node after your event-state node and see if the state report correct?
