Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

looking for an plugin.

If you have a question or need help, this is the place to be.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: looking for an plugin.

Post by krambriw »

Lets think about the following scenarios:

a) You have power in your house and internet is working, EvenGhost is running and checking the connection, everything is ok

b) You get a mains power failure

In scenario a) I believe the check is working since the egg timer will fire if internet connection is lost and the power to the modem will be recycled

In scenario b) we face a problem since both the modem and the computer running EventGhost will stop. Once power is restored, the computer with EventGhost will boot and autostart EventGhost. Unfortunately the power to the modem will not be restored due to the "nature" of the Nexa switch. This has then the effect that the check can never be started initially and therefore the recycling of the power to the modem will never happen.

The conclusion is that at EventGhost startup, we need to assure that the Nexa switch gets powered ON. We can do this by adding an additional macro with an event and action inside. The macro should look similar to this:
Skärmklipp.JPG
Skärmklipp.JPG (13.24 KiB) Viewed 2557 times
tjabas
Experienced User
Posts: 98
Joined: Sun Feb 07, 2016 6:28 pm

Re: looking for an plugin.

Post by tjabas »

krambriw wrote:Lets think about the following scenarios:

a) You have power in your house and internet is working, EvenGhost is running and checking the connection, everything is ok

b) You get a mains power failure

In scenario a) I believe the check is working since the egg timer will fire if internet connection is lost and the power to the modem will be recycled

In scenario b) we face a problem since both the modem and the computer running EventGhost will stop. Once power is restored, the computer with EventGhost will boot and autostart EventGhost. Unfortunately the power to the modem will not be restored due to the "nature" of the Nexa switch. This has then the effect that the check can never be started initially and therefore the recycling of the power to the modem will never happen.

The conclusion is that at EventGhost startup, we need to assure that the Nexa switch gets powered ON. We can do this by adding an additional macro with an event and action inside. The macro should look similar to this:
Skärmklipp.JPG

the computer thar runs evenghost is using an ups, so evenghost will never stop, its actually an old asus eee laptop, so it uses the battery if power fails,

The strange thing is that , as i said earlier, if i kill the nexa switch, so the internet connection is lost, your config wont send the on/off command to the nexa switch again, that is very strange, it shouldnt matter.

but im thinking of adding an on command to the nexa/modem once per hour, so if the power stops and returns, the modem will eventually get an on command and eventghost should work as expected.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: looking for an plugin.

Post by krambriw »

I think I have found the reason ....It can be also be verified by just inactivating your network card (NIC) in the pc.

When the network is lost, the MQTT starts trying to re-connect. This happens so frequently that no other events are received and therefore power cycling of the modem never happens. So I have made a modification to the MQTT Client plugin that works as expected in my tests. You can try this instead (just replace with this one below, put it in the MQTT Client plugin folder, normally in C:\Program Files (x86)\EventGhost\plugins\MQTT Client)

__init__.py
(32.94 KiB) Downloaded 110 times
Sem;colon
Plugin Developer
Posts: 625
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: looking for an plugin.

Post by Sem;colon »

tjabas wrote: yes i tried to change that, so as for now the settings are for alive event is set to 1 and dead is set to 12.

another thing i have noticed is that even if the internet seems down the ping goes trough anyway, someone told me that it might be that the dns is down, and the connection is still up, i think that is our main problem here at our house, the site i send the ping to is google.com.

when that happen the whole house looses the internet connection, but its still possible to ping google, and the reboot wont happen.
Well, then your Problem is clearly the alive event - don't set it to 1, use something like 5.
Oh, and use the IP of Google.com, DNS sucks.
If you like my work, Image me a drink :wink:
tjabas
Experienced User
Posts: 98
Joined: Sun Feb 07, 2016 6:28 pm

Re: looking for an plugin.

Post by tjabas »

Sem;colon wrote:
tjabas wrote: yes i tried to change that, so as for now the settings are for alive event is set to 1 and dead is set to 12.

another thing i have noticed is that even if the internet seems down the ping goes trough anyway, someone told me that it might be that the dns is down, and the connection is still up, i think that is our main problem here at our house, the site i send the ping to is google.com.

when that happen the whole house looses the internet connection, but its still possible to ping google, and the reboot wont happen.
Well, then your Problem is clearly the alive event - don't set it to 1, use something like 5.
Oh, and use the IP of Google.com, DNS sucks.

i have changed it to 5, and im now testing it with google ip instead. im going to try it out for some days.

thank you
tjabas
Experienced User
Posts: 98
Joined: Sun Feb 07, 2016 6:28 pm

Re: looking for an plugin.

Post by tjabas »

krambriw wrote:I think I have found the reason ....It can be also be verified by just inactivating your network card (NIC) in the pc.

When the network is lost, the MQTT starts trying to re-connect. This happens so frequently that no other events are received and therefore power cycling of the modem never happens. So I have made a modification to the MQTT Client plugin that works as expected in my tests. You can try this instead (just replace with this one below, put it in the MQTT Client plugin folder, normally in C:\Program Files (x86)\EventGhost\plugins\MQTT Client)

__init__.py
Now it works, i guess youre right, nothing else came trough when MQTT tries to reconnect, and now it was possible turn of the nexa switch and wait for a minute, and then eventghost turned the modem back on, one thing that came to my mind was that, if no connection is made for let say 5 minutes, is it possible to make another restart of the modem again, and so on.

it was just a thought..

thanks once again.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: looking for an plugin.

Post by krambriw »

if no connection is made for let say 5 minutes, is it possible to make another restart of the modem again, and so on
Yes, this can be made. See picture below (Also, check the updated guide!). What I have added is

- one additional 5 minute timer (configured in SchedulGhost)
- a macro for the 5 minute check
- some enable and disable actions to control when the 5 minute check may apply

As you see, I also enable the 5 minute check when Eventghost starts up in case there should be an initial problem with internet

PS If you think that the configuration tree now is starting to look too messy/complex, you can always create a folder 'Internet Check' and move all those macros inside
Skärmklipp.JPG
tjabas
Experienced User
Posts: 98
Joined: Sun Feb 07, 2016 6:28 pm

Re: looking for an plugin.

Post by tjabas »

Thank you, this works very well :)
skribb
Experienced User
Posts: 228
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Re: looking for an plugin.

Post by skribb »

Interesting thread.

This is a dummy post so that i can subscribe to this thread ;)
Automation is life.

Win7 64bit
EG: v0.5.0-rc4
Post Reply