Skip to content

A Java library for controlling the Edimax Smart Plug SP-1101W and SP-2101W.

License

Notifications You must be signed in to change notification settings

Wandmalfarbe/Edimax-Smart-Plug-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EdimaxSmartPlugJava

A Java library for controlling the Edimax Smart Plug SP-1101W and SP-2101W.

Usage

Create a SmartPlug object to control your plug.

PlugCredentials credentials = new PlugCredentials("admin","1234");
PlugConnection connection = new LocalHTTPConnection(credentials,"192.168.178.34");
SmartPlug smartPlug = new SmartPlug(connection);

Use the various methods of the smartPlug object to get information or toggle the plug state.

ScheduleDay[] schedule = smartPlug.getSchedule();
PowerInformation powInfo = smartPlug.getPowerInformation();

// Toggle your plug on or off depending on the current status.
smartPlug.toggle();

// Switch your plug on.
smartPlug.switchOn();

// get the history
float[] history = smartPlug.getHistory(SmartPlug.TimeUnit.HOUR, LocalDateTime.now().minusHours(3), LocalDateTime.now().plusHours(1));

Implemented Functionality

Switching On and Off

  • switch on and off

    smartPlug.switchOn();
    smartPlug.switchOff();
  • get current state (on and off)

    State state = smartPlug.getState()
  • toggle the current state (sends two requests)

    smartPlug.toggle()

History

  • get the history (partially)

    float[] history = smartPlug.getHistory(SmartPlug.TimeUnit.HOUR, LocalDateTime.now().minusHours(3), LocalDateTime.now().plusHours(1));

Schedule

  • get the schedule

    ScheduleDay[] schedule = smartPlug.getSchedule();
  • change the schedule

System and Power Information

  • get the power information

    PowerInformation powInfo = smartPlug.getPowerInformation();
  • get the system information (including the name)

    SystemInformation sysInfo = getSystemInformation();
  • change the plug name

    smartPlug.setName("My Smart Plug");

Budget Control

  • get budget control information
  • change budget control information

Email Notifications

  • get email notification information
  • change email notification information

Time

  • get the plug time settings
  • change the plug time settings

Communication

  • local communication
    • send messages
    • receive messages
    • plug discovery
  • cloud communication
    • send messages
    • receive messages
    • plug discovery (is this possible with cloud communication?)

Known Bugs

  1. [History] The history values are accumulated values per hour (only when requesting the history for a day).
  2. [Command Line] Not all methods from SmartPlug can be accessed via the command line.
  3. [Command Line] There is no command line help text.

License

This project is open source licensed under the BSD 3-Clause License. Please see the LICENSE file for more information.

Releases

No releases published

Packages

No packages published

Languages