Example of Controlling Sockets of a NetPing Power Distribution Units from Google Calendar

  • Published In: Tutorial
  • Created Date: 2018-03-26
  • Hits: 821

In the firmware of NetPing power distribution units it is possible to configure only weekly schedule (with several exceptions for holidays). In addition, there is a feature of switching on/switching off sockets according to the schedule but no more than four times a day. To bypass such limitation in the firmware, there is a need to organize a random schedule for controlling sockets in the firmware using the chain Google Calendar and IFTTT service, i.e. configure switching on/switching off sockets the unlimited number of times in a day, configure a random monthly and yearly schedule, get a possibility to control sockets from several devices (PC, tablet, smartphone) through a common schedule.

What Is Google Calendar?

Google Calendar is a service used to plan meetings, events, and actions. It allows setting the time for meetings, creating repeated events, installing reminders, as well as inviting other members, to whom a notification is sent via email.

Reminders about events can be received via email and through Push-notifications. A calendar operates in a browser window through a web interface, and all data are stored on the servers of Google, therefore it is possible to access the schedule from any computer connected to the Internet.

What Is IFTTT?

IFTTT is a so-called mashup service that can combine different network applications in a single tool. Using this service, it is possible to configure that one event in one service automatically triggers another event in another service. The acronym IFTTT stands for «If this, than that», and this is how this service works. This service automates the execution of the given sequence of actions.

Task

There is a need to automatically switch on at 9:00 and switch off at 21:00 the «Sale» signboard on certain dates of a month, which are 5th, 10th, 15th and 25th day of every month.

Let us consider the example of solving the task using a NetPing power distribution units and a chain of a Google Calendar and IFTTT service.

Requirements to Equipment:

To solve the task, it is possible to use any device from power distribution units (PDU), via Internet/Ethernet from the list:

In our example, we will use a power distribution unit NetPing 2/PWR-220 v3/ETH. There is a need to configure a power distribution unit so that it is available on the Internet. It is possible to read about how to do this here.

Let's consider our power distribution unit NetPing 2/PWR-220 v3/ETH is available on the Internet with the next configuration:

  • Address: 89.179.183.169
  • Port: 8021
  • Login: visor
  • Password: ping

Configuring a NetPing 2/PWR-220 v3/ETH Power Distribution Unit

After plugging the signboard «Sale» to the relay 1 of a NetPing 2/PWR-220 v3/ETH power distribution unit, there is a need to configure parameters of a relay and necessary notifications in a web interface of a device.

Let's go to the page «RELAYS» (1) and fill in parameters for Relay 1 (2):

  • Memo – «Signboard Sale»;
  • Source of control – we set the value «Manual Off» because we plan to switch on and off the signboard automatically through the use of our power distribution unit NetPing 2/PWR-220 v3/ETH according to the schedule specified in the service «Google Calendar», and the signboard should be switched off by default.

Then, click the button «Setup» in the field «Notification» (3):

NetPing 2 PWR-220 v3ETH socket configuration

In a window that opens, we can configure the types of necessary notifications. After making necessary changes, click the button «Save».

NetPing 2 PWR-220 v3ETH configuring notifications

After configuring notifications, save all parameters by clicking the button «Apply changes» (4) on the page «RELAYS». When done, a configuration of a NetPing 2/PWR-220 v3/ETH power distribution unit for switching on and off the signboard is completed.

Configuring a Schedule in the Service Google Calendar

To work with Google Calendar, a browser must have cookie files and JavaScript switched on.

Google Calendar works in most browsers of latest or previous versions including:

  • Google Chrome;
  • Internet Explorer;
  • Microsoft Edge;
  • Firefox;
  • Safari

How to Install Google Calendar?

  1. Open Google Calendar on a computer.
  2. If you already have Google account, then sign in. If you have no such account, create it.
  3. After signing in, your Google Calendar will open.

Configuring a Schedule

Now, when a calendar is created, there is a need to create events for switching on and off the signboard «Sale».

Let's click the button of adding the event in the right low corner of a calendar (1):

Google Calendar appearance

And in a window that opens, fill in the data for the event of switching on the signboard «Sale» as in the example (1):

Google Calendar creating the event

Expand the list «Does not repeat» (2) and select the item «Custom»:

Google Calendar Choosing the Item Custom

In a window that opens, fill in parameters (1) for a monthly repeat of switching on the signboard on 10th and click the button «Done» (2):

Configuring of the repeat event in Google Calendar

Then, click the button «Save» on a previous screen of creating the event in calendar (3):

Using this algorithm, create events for switching off the signboard in 21:00 on the 10th with the repeat in every month:

Event of switching off the signboard

In the same way, create events for switchign on and off the signboard «Sale» for other necessary days.

A general appearance of a schedule:

General view of a schedule in Google Calendar

At this point, the work with Google Calendar on configuring a schedule is completed.

Configuring IFTTT to Control a Relay of a NetPing 2/PWR-220 v3/ETH Power Distribution Unit According to the Schedule from the Service Google Calendar

Now, let's pursue with configuring the service IFTTT that is going to control a relay of a NetPing 2/PWR-220 v3/ETH power distribution unit according to the schedule that we specified in Google Calendar.

Let's go to the site of the service https://ifttt.com/ and click the button «Sign up» to sign up the service. If you already have an account, than click the button «Sign in»:

IFTTT landing page

A system offers to get authorised using Google or Facebook accounts. Let's choose the button «Continue with Google» and sign up with the account for which we configured the calendar.

Signing up IFTTT

Account selection

A welcome screen can omitted by clicking the cross in the upper right corner.

Welcome to IFTTT

Then, go to the section «My Applets» by clicking a corresponding link in the heading of a website.

Switching to the Section My Applets

In the section «My Applets», click the button «New Applet»:

Creating a new applet

In a dialogue for creating a new applet, click the button «+ this»:

Creating a trigger

In a dialogue for choosing a service, write Google Calendar (1) in the entry field and choose a necessary service by clicking its icon (2):

Choosing Google Calendar

Then, choose the event in Google Calendar «Any event starts»:

Selecting a condition of a trigger

In the next dialogue, it is possible to indicate a calendar from the service «Google Calendar» that will be used as a schedule  as well as the time for launching the action after the beginning of the event in «Google Calendar». After entering necessary configurations click the button «Create trigger»

Indicating Google Calendar for the use as a trigger

On the next screen, click the button «+ that»:

Creating an action

In a dialogue for choosing a service for the action, write Webhook (1) in the entry field and choose a necesssary service by clicking its icon (2):

Choosing webhook

Then, select the action «Make a web request»:

Choosing the action webhook

Then, set action parameters as in the example:

Task of url encoded command for NetPing 2 PWR-220 v3ETH

Here, an URL-encoded command is entered in the field «URL» to switch the status of the relay. More detailed information about similar commands can be read in the firmware description of a NetPing 2/PWR-220 v3/ETH power distribution unit. Let's apply configurations by clicking the button «Create action» (2).

On the next screen, confirm creating the applet by clicking the button «Finish».

Confirmation for creating the applet

If there is a need to change a schedule for switching on/switching off the sockets of a NetPing 2/PWR-220 v3/ETH power distribution unit, it is enough to change the events in Google Calendar.

At this point, the implementation of the task on the automatic switching on and off the signboard «Sale» on certain dates of the month can be considered completed.


comments powered by Disqus