Author Topic: PLUGIN: Wifi/UDP Switch Controller  (Read 512 times)

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1002
  • Karma: +96/-5
PLUGIN: Wifi/UDP Switch Controller
« on: September 06, 2017, 05:01:29 pm »
Wifi UDP Switch Controller Plugin
---------------------------------

Note: This plugin works with Vera Lite (UI5 or UI7), Vera 3 (UI5 or UI7), Vera Edge (UI7) or VeraPlus (UI7).

Supported Devices:
------------------------
ECO Plugs
  - designed/manufactured by KAB Cables Inc (now going by the name ECO Plugs Inc.).
     Sold under various brand names at WalMart, HomeDepot, Amazon and eBay.
  - Eco Plugs
  - Woods WiOn
  - Workchoice WiFi Smart Switch
  - Vivitar SmartPlug

TP-LINK Smart Devices
  - HS100 Smart Switch
  - HS110 Smart Switch (no energy monitoring implemented)
  - HS200 Smart Light Switch
  - LB100 White Smart Bulb
  - LB120 Tunable White Smart Bulb
  - LB130 Color Smart Bulb

SengLED Boost
  - SengLED Light bulb with built-in WiFi extender

LIFX light bulbs
   - All LIFX bulbs - Basic Local Control (LIFX API access not required - Cloud features not available)

Yeelight WiFi light bulbs
   - All Yeelight bulbs and lightstrips

D-Link Smart Plugs
   - DSP-W110 Smart Plug
   - DSP-W215 Smart Plug


Features:
------------
Automatic detection and configuration of supported devices
Local control of configured devices
Color and Color Temperature control of capable devices


Version History:
---------------------

v1.73     (Version ID: 34541) September 24, 2017
-- fixed - minor bugfixes
-- changed - code optimization to enable functionality with openLuup
-- changed - poll Sengled boost to get device name/id during device detection

v1.68     (Version ID: 34532) September 22, 2017
-- fixed - minor bugfixes in Yeelight support
-- changed - create less debug output with debug mode disabled

v1.65     (Version ID: 34526) September 22, 2017
-- added - support for D-Link Smart Plug devices

v1.60     (Version ID: 34520) September 20, 2017
-- fixed - full support for Yeelight devices

v1.45     (Version ID: 34502) September 14, 2017
-- added - experimental support for Yeelight devices

v1.40     (Version ID: 34501) September 14, 2017
-- added - set device category/subcategory for Amazon Alexa compatibility

v1.38     (Version ID: 34491) September 13, 2017
-- added - support for dimmer SetStepDelta, StepUp and StepDown actions

v1.36     (Version ID: 34460) September 12, 2017
-- changed - fixes for minor TP-LINK API changes due to bulb firmware update
-- fixed - various minor bugfixes

v1.30     (Version ID: 34411) September 6, 2017
-- added - Support for LIFX bulbs (using lan access api)
-- added - various minor bugfixes for Color / Tunable bulbs

v1.20     (Version ID: 34376) September 4, 2017
-- added - Rework device discovery routines
-- changed - Allow network scan for devices to be optional (enabled in device setup)
-- changed - Allow control of debug mode (enabled in device setup)
-- added - various minor bugfixes

v1.09     (Version ID: 33871) June 20, 2017
-- added - Support for SengLED and TP-Link devices
-- added - various minor bugfixes

v1.00     (Version ID: 33186) February 23, 2017
-- Initial release
-- Support for ECO switch devices.
« Last Edit: September 24, 2017, 05:33:28 pm by cybrmage »
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - MyQGateway

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1002
  • Karma: +96/-5
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #1 on: September 06, 2017, 05:06:54 pm »
**** PLEASE NOTE #1****
Once the plugin is installed, it wil **NOT** automatically create devices in the UI for the devices detected on the network!!

To configure a device for control by the plugin, go to the setup page for the plugin device (the one with the cute wifi/lightbulb/outlet icon) and click on the configure button. This will take you to a page showing the devices that the plug has configured (at the top of the page) and ALL the supported devices on your network that were detected.

From this page you can "add" a device to the configuration list- this creates a vera device to allow monitoring and control of the device, or "remove" a device - this deletes the configured vera device.

Not that once you select "add" or "remove", the LuaUPnP engine will be reloaded. After the engine reloads, you MUST refresh your browser!!

You can only add/remove a single device at a time.

It is HIGHLY RECOMMENDED that you configure your router to provide a static address for each of your devices prior to adding them to the plugin.



**** PLEASE NOTE #2****

If you have problems, and expect any support.... you MUST post LuaUPnP logs showing the operation of the plugin.
« Last Edit: September 09, 2017, 07:39:22 pm by cybrmage »
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - MyQGateway

Offline Majimus

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +3/-0
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #2 on: September 09, 2017, 05:48:29 pm »
Tried the plugin but it did not detect my LIFX products.

Offline cybrmage

  • Hero Member
  • *****
  • Posts: 1002
  • Karma: +96/-5
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #3 on: September 09, 2017, 07:29:36 pm »
You are not using the LATEST version (as it has not yet been approved by mios).

You may force an upgrade to a specific version (including noy yet approved versions) by entering:
Code: [Select]
http://<your.vera.ip.address>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8901&Version=<Version ID>
You can find the VersionID for a specific version in the Version History  (in this specific case, it is 34411 for version 1.30 of the plugin)
« Last Edit: September 09, 2017, 07:41:32 pm by cybrmage »
EVL3Vista - Wink Connect - Caseta Connect - Venstar Colortouch - WiFi UDP Switch Controller - MyQGateway

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2330
  • Karma: +32/-44
  • Life Moves Pretty Fast....
    • Node Central
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #4 on: September 10, 2017, 03:51:25 pm »
Hi @cybrmage

I've not got any compatible devices at the moment, but I wanted to quickly ask if your plug in is able to dynamically check the status of any lights or switches in the event they may have been turned on/off by another means ?

Offline Majimus

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +3/-0
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #5 on: September 11, 2017, 02:05:16 am »
You are not using the LATEST version (as it has not yet been approved by mios).

You may force an upgrade to a specific version (including noy yet approved versions) by entering:
Code: [Select]
http://<your.vera.ip.address>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=8901&Version=<Version ID>
You can find the VersionID for a specific version in the Version History  (in this specific case, it is 34411 for version 1.30 of the plugin)

Tried it and was able to list and add the lights but not control them.  If it's okay with you I would like to adapt your LAN protocol code for the lifx for use with the other plugin. The end goal would be to route some commands locally when possible to avoid the lag of the cloud but still retain cloud functionality/control of remote lights.

Nice work BTW.


Offline Jim McGhee

  • Jr. Member
  • **
  • Posts: 80
  • Karma: +1/-1
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #6 on: September 11, 2017, 10:13:39 pm »
So glad to see you back!!!  Lots of folks missed you.

Moving right along...
Installed 1.30 on an empty Vera Lite running the latest firmware.
My ECO and Tplink Switches work OK but my Tplink BL100 doesn't.
Here is the log:

https://drive.google.com/open?id=156nVrMxXVX2jXspv9AKwCsYeEMlUHueVzBYAsAuP4FM

This is from turning the light on.  The light doesn't turn on.  Let me know if you need any more info.

Thanks again for all your hard work on this.
And cybrmage, please check your mail...

« Last Edit: September 12, 2017, 12:58:20 am by Jim McGhee »

Offline jmedemar

  • Jr. Member
  • **
  • Posts: 89
  • Karma: +0/-0
  • Vera 3
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #7 on: September 14, 2017, 08:00:45 am »
Hi cybrmage, I installed v1.38 and everything went great. The plugin found my Lifx bulbs and I was able to add them successfully. The devices on the dashboard seem to work well.

It looks like the devices your plugin creates don't show up in the Vera Amazon Alexa Skill. They are using a device type of:
urn:schemas-upnp-org:device:DimmableRGBLight:1

Is there a way to have the created devices use a device type that would show up on the Amazon Alexa skill?
I have some Aeon Labs colored bulbs that do show up in Alexa that use a device type of:
urn:schemas-upnp-org:device:DimmableRGBLight:2

I'm not sure if this is the issue or not, just thought I'd run it by you and see if it's possible to have them show up. Thank you.

Offline holdmade

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #8 on: September 17, 2017, 03:19:19 pm »
@cybrmage,

Thanks for the heads up to Yeelight support on your plugin.

I tried to install v1.45 but the "Lua Engine Failed to Load" (v1.40 installs fine)

The device number is 471 on my Vera.

Hope you can iron this out !

Cheers

These lines show up in my log:

01   09/17/17 20:12:27.114   IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>
01   09/17/17 20:12:31.118   IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>
01   09/17/17 20:12:34.171   Device_Interface::CreateLuaInterface 471 failed to start engine <0x2aded310>
01   09/17/17 20:12:34.436   LuaInterface::LoadCode: [string "local VERSION = "v1.45"..."]:2159: unexpected symbol near ')' <0x2aded310>
01   09/17/17 20:12:35.123   IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>
01   09/17/17 20:12:39.129   IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>
01   09/17/17 20:12:43.133   IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>

Offline jchiar

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +0/-1
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #9 on: September 21, 2017, 12:24:15 pm »
I get this error when i hit configure.



Error executing function configuration(): JSON Parse error: Unexpected identifier "undefined"

Any ideas? Plugin v1.40

Offline holdmade

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #10 on: September 25, 2017, 05:11:34 am »
Hi,

Still not getting this working again with Yeelight.

I have tried a different bulb but still no go, is not discovering any devices.

Any ideas ?

Log attached

Cheers

Offline holdmade

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #11 on: September 25, 2017, 05:13:00 am »
Says its Finding Configured Devices even though there isn't any, is there a file somewhere that stores old discovered devices ?

Click Configure tab and it is blank

« Last Edit: September 25, 2017, 08:07:59 am by holdmade »

Offline holdmade

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
Re: PLUGIN: Wifi/UDP Switch Controller
« Reply #12 on: September 25, 2017, 05:13:55 am »
I get this error when i hit configure.



Error executing function configuration(): JSON Parse error: Unexpected identifier "undefined"

Any ideas? Plugin v1.40

I had this, you need to upgrade to a later version (see above)