Skip to content

Commit

Permalink
Plugin Edimax: uppercase ON/OFF fix by Olaf Straube <olaf.straube@mai…
Browse files Browse the repository at this point in the history
…lbox.org>
  • Loading branch information
dexterbg committed Jul 22, 2023
1 parent 105e47c commit d844398
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 13 deletions.
6 changes: 4 additions & 2 deletions plugin/edimax/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Edimax: Smart Plug Control

**Smart Plug control for Edimax models SP-1101W, SP-2101W et al**

Version 2.0 by Michael Balzer <dexter@dexters-web.de>
Version 2.3 by Michael Balzer <dexter@dexters-web.de>

Note: may need ``HTTP.request()`` digest auth support to work with newer Edimax firmware (untested)
Note: currently requires Edimax firmware version 2.x, as version 3.x requires digest auth
(not yet supported by ``HTTP.request()``). Workaround: downgrade a newer Edimax to firmware
version 2.x, which can be found on the internet. (Thanks to Olaf Straube for testing!)

The smart plug can be bound to a defined location. Automatic periodic recharging or charge stop can
be configured via main battery SOC level and/or 12V battery voltage level. The plugin can also
Expand Down
2 changes: 1 addition & 1 deletion plugin/edimax/edimax-status.htm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
Web UI plugin for page /status hook body.post:
Add Edimax power control button to Vehicle panel
Version 1.0 Michael Balzer <dexter@dexters-web.de>
Edimax Plugin Version 2.3 Michael Balzer <dexter@dexters-web.de>
-->

<script>
Expand Down
2 changes: 1 addition & 1 deletion plugin/edimax/edimax.htm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
Web UI page plugin:
Control & configuration frontend for Edimax module plugin (edimax.js)
Version 2.0 Michael Balzer <dexter@dexters-web.de>
Edimax Plugin Version 2.3 Michael Balzer <dexter@dexters-web.de>
Recommended installation:
- Page: /usr/edimax
Expand Down
7 changes: 5 additions & 2 deletions plugin/edimax/edimax.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/**
* Module plugin:
* Smart Plug control for Edimax models SP-1101W, SP-2101W et al
* Version 2.2 by Michael Balzer <dexter@dexters-web.de>
* Version 2.3 by Michael Balzer <dexter@dexters-web.de>
* Note: may need digest auth support to work with newer Edimax firmware (untested)
*
* History:
* - v2.3: uppercase ON/OFF fix by Olaf Straube <olaf.straube@mailbox.org>
*
* Installation:
* - Save as /store/scripts/lib/edimax.js
* - Add to /store/scripts/ovmsmain.js: edimax = require("lib/edimax");
Expand Down Expand Up @@ -99,7 +102,7 @@ function setPowerState(onoff) {
url: "http://" + cfg.user + ":" + cfg.pass + "@" + cfg.ip + ":10000/smartplug.cgi",
headers: [{ "Content-Type": "text/xml" }],
post: '<?xml version="1.0" encoding="utf-8"?>'
+ '<SMARTPLUG id="edimax"><CMD id="setup"><Device.System.Power.State>' + onoff
+ '<SMARTPLUG id="edimax"><CMD id="setup"><Device.System.Power.State>' + onoff.toUpperCase()
+ '</Device.System.Power.State></CMD></SMARTPLUG>',
done: function(resp) {
if (resp.statusCode == 200) {
Expand Down
6 changes: 4 additions & 2 deletions plugins/edimax/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Edimax: Smart Plug Control

**Smart Plug control for Edimax models SP-1101W, SP-2101W et al**

Version 2.0 by Michael Balzer <dexter@dexters-web.de>
Version 2.3 by Michael Balzer <dexter@dexters-web.de>

Note: may need ``HTTP.request()`` digest auth support to work with newer Edimax firmware (untested)
Note: currently requires Edimax firmware version 2.x, as version 3.x requires digest auth
(not yet supported by ``HTTP.request()``). Workaround: downgrade a newer Edimax to firmware
version 2.x, which can be found on the internet. (Thanks to Olaf Straube for testing!)

The smart plug can be bound to a defined location. Automatic periodic recharging or charge stop can
be configured via main battery SOC level and/or 12V battery voltage level. The plugin can also
Expand Down
2 changes: 1 addition & 1 deletion plugins/edimax/edimax-status.htm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
Web UI plugin for page /status hook body.post:
Add Edimax power control button to Vehicle panel
Version 1.0 Michael Balzer <dexter@dexters-web.de>
Edimax Plugin Version 2.3 Michael Balzer <dexter@dexters-web.de>
-->

<script>
Expand Down
2 changes: 1 addition & 1 deletion plugins/edimax/edimax.htm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
Web UI page plugin:
Control & configuration frontend for Edimax module plugin (edimax.js)
Version 2.0 Michael Balzer <dexter@dexters-web.de>
Edimax Plugin Version 2.3 Michael Balzer <dexter@dexters-web.de>
Recommended installation:
- Page: /usr/edimax
Expand Down
7 changes: 5 additions & 2 deletions plugins/edimax/edimax.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/**
* Module plugin:
* Smart Plug control for Edimax models SP-1101W, SP-2101W et al
* Version 2.2 by Michael Balzer <dexter@dexters-web.de>
* Version 2.3 by Michael Balzer <dexter@dexters-web.de>
* Note: may need digest auth support to work with newer Edimax firmware (untested)
*
* History:
* - v2.3: uppercase ON/OFF fix by Olaf Straube <olaf.straube@mailbox.org>
*
* Installation:
* - Save as /store/scripts/lib/edimax.js
* - Add to /store/scripts/ovmsmain.js: edimax = require("lib/edimax");
Expand Down Expand Up @@ -99,7 +102,7 @@ function setPowerState(onoff) {
url: "http://" + cfg.user + ":" + cfg.pass + "@" + cfg.ip + ":10000/smartplug.cgi",
headers: [{ "Content-Type": "text/xml" }],
post: '<?xml version="1.0" encoding="utf-8"?>'
+ '<SMARTPLUG id="edimax"><CMD id="setup"><Device.System.Power.State>' + onoff
+ '<SMARTPLUG id="edimax"><CMD id="setup"><Device.System.Power.State>' + onoff.toUpperCase()
+ '</Device.System.Power.State></CMD></SMARTPLUG>',
done: function(resp) {
if (resp.statusCode == 200) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/edimax/edimax.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"group": "Development",
"info": "https://www.openvehicles.com/",
"maintainer": "Michael Balzer <dexter@dexters-web.de>",
"version": "2.1",
"version": "2.3",
"prerequisites": ["ovms>=3.2.010"],
"elements": [
{
Expand Down

0 comments on commit d844398

Please sign in to comment.