Monitoring your Internet connection
Posted: Thu Jun 02, 2016 6:07 am
There are several ways you can monitor that your internet connection is alive and functioning. This guide describes how you can achieve this with existing plugins and if the internet connection fails, it will power off/on your router using a rf controlled mains power switch device.
The following plugins are used for this setup:
- SchedulGhost
- MQTT Client
- TellStickDuo (or the RFXtrx or any other plugin able to operate a main power switch)
This is part of a configuration tree showing the actual sample configuration needed
In essence, it works like this:
0) When EventGhost starts up, a power on command is sent to the mains power switch and the macro for the 5 min check is enabled
1) Every 15 seconds (this can be altered of course) a message is published to a specific topic on the MQTT broker somewhere on Internet
2) A response is received more or less instantly and this is received by the MQTT Client that is subscribing to the same topic on the same broker
3) The response is stopping an egg timer and then restarting the same egg timer again as well as disabling the macro for the 5 minute check
4) If the responses stops coming, the egg timer will fire and the TellStickDuo will cycle the power supply to the router. In addition the macro for the 5 minute check will be enabled again
5) Hopefully the internet connection will be re-established when the router has booted up again and then also the macro for the 5 minute check once again will be disabled
In the sample configuration seen above, we are publishing a message to the MQTT broker every 15 seconds and the egg timer will fire if it doesn't get stopped within 1 minute. This can of course be configured differently if you prefer. Maybe publishing once a minute with an egg timer running for 5 minutes is good enough.
Also, when publishing to a public broker, define a topic name that is rather unique to you and your needs
The following pictures will show you the individual settings needed
SchedulGhost: the 2 timers you need to configure
MQTT Client:
The guide is continued in the next post....
The following plugins are used for this setup:
- SchedulGhost
- MQTT Client
- TellStickDuo (or the RFXtrx or any other plugin able to operate a main power switch)
This is part of a configuration tree showing the actual sample configuration needed
In essence, it works like this:
0) When EventGhost starts up, a power on command is sent to the mains power switch and the macro for the 5 min check is enabled
1) Every 15 seconds (this can be altered of course) a message is published to a specific topic on the MQTT broker somewhere on Internet
2) A response is received more or less instantly and this is received by the MQTT Client that is subscribing to the same topic on the same broker
3) The response is stopping an egg timer and then restarting the same egg timer again as well as disabling the macro for the 5 minute check
4) If the responses stops coming, the egg timer will fire and the TellStickDuo will cycle the power supply to the router. In addition the macro for the 5 minute check will be enabled again
5) Hopefully the internet connection will be re-established when the router has booted up again and then also the macro for the 5 minute check once again will be disabled
In the sample configuration seen above, we are publishing a message to the MQTT broker every 15 seconds and the egg timer will fire if it doesn't get stopped within 1 minute. This can of course be configured differently if you prefer. Maybe publishing once a minute with an egg timer running for 5 minutes is good enough.
Also, when publishing to a public broker, define a topic name that is rather unique to you and your needs
The following pictures will show you the individual settings needed
SchedulGhost: the 2 timers you need to configure
MQTT Client:
The guide is continued in the next post....