Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wandmalfarbe/edimax-smart-plug-java
A Java library for controlling the Edimax Smart Plug SP-1101W and SP-2101W.
https://github.com/wandmalfarbe/edimax-smart-plug-java
command-line command-line-tool edimax edimax-smartplug library plug smart-plug
Last synced: 9 days ago
JSON representation
A Java library for controlling the Edimax Smart Plug SP-1101W and SP-2101W.
- Host: GitHub
- URL: https://github.com/wandmalfarbe/edimax-smart-plug-java
- Owner: Wandmalfarbe
- License: bsd-3-clause
- Created: 2017-03-17T17:07:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-04T01:00:13.000Z (over 3 years ago)
- Last Synced: 2025-01-11T06:31:14.642Z (11 days ago)
- Topics: command-line, command-line-tool, edimax, edimax-smartplug, library, plug, smart-plug
- Language: Java
- Homepage:
- Size: 51.8 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# EdimaxSmartPlugJava
A Java library for controlling the Edimax Smart Plug SP-1101W and SP-2101W.
## Usage
Create a SmartPlug object to control your plug.
```java
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.
```java
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
- [x] switch on and off
```java
smartPlug.switchOn();
smartPlug.switchOff();
```
- [x] get current state (on and off)
```java
State state = smartPlug.getState()
```
- [x] toggle the current state (sends two requests)```java
smartPlug.toggle()
```### History
- [ ] get the history (partially)
```java
float[] history = smartPlug.getHistory(SmartPlug.TimeUnit.HOUR, LocalDateTime.now().minusHours(3), LocalDateTime.now().plusHours(1));
```### Schedule
- [x] get the schedule
```java
ScheduleDay[] schedule = smartPlug.getSchedule();
```
- [ ] change the schedule### System and Power Information
- [x] get the power information
```java
PowerInformation powInfo = smartPlug.getPowerInformation();
```
- [x] get the system information (including the name)```java
SystemInformation sysInfo = getSystemInformation();
```
- [x] change the plug name
```java
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
- [x] send messages
- [x] 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](LICENSE.md) for more information.