diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2953173 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,36 @@ +# DeusExMachinaII Change Log # + +## Version 2.8 (stable branch) ## + +* Issue #28: display slider values on sliders; updates during slide (feature request). +* Ability to disable DEMII's automatic timing and issue Activate and Deactivate actions to control cycling. On deactivation, lights are turned off randomly on shorter intervals, in the same way DEMII does with automatic timing previously. Issue #26 +* Support for per-house-mode final scenes. This is a bit hackish, because I don't think it's going to be a widely used feature, but if so, I'll improve it. It works by adding the name of the house mode to the final scene--if a scene by that name exists, it is run in preference to the specified final scene (e.g. if the final scene is called "DeusEnd", then when the house mode changes from Away to Home, DEMII will try to find a scene called "DeusEndAway" to run, and runs it if found, or runs "DeusEnd" otherwise. Issue #23 + +## Version 2.7 (released) ## + +* Bug fix only, fixes issue #25 from a fix attempt in 2.6 to address certain Fibaro and Qubino dimmers. That change was removed and we're back in business. The fix caused DEMII to turn lights on at full brightness rather than the prescribed dimming level inconsistently but with high frequency. + +## Version 2.6 (released) ## + +* Bug fix release only; addresses issue with creating new scene pairs in configuration UI. + +## Version 2.5 (released) ## + +* Incorporates fixed starting time to override sunrise start. If start time and lights-out time are equal, runs continuously (useful for control by scenes or scripting). Allow maximum "on" time to be specified for lights (simulate hallway access or WC use). + +## Version 2.4 (released) ## + +* Controls more devices (including the much-requested Philips Hue, and should also handle X-10, ZigBee, etc., as long as they are known to MiOS and can be controlled either by Status or LoadLevel (issues/enhancements 5 and 12); +* Allows you to set dimming level for dimmers (issue/enhancement 10); +* Support for running scenes--DEMII allows you to specify scene pairs (one scene acts as the "on" scene, the other the "off" scene); +* Support for a "final" scene--a scene that is run when DEMII goes idle after all other devices have been shut off; +* Support to limit the number of targets DEMII will allow turned "on" simultaneously (issue 15); +* DEMII itself is now enabled/disabled using the standard SwitchPower1 service SetTarget action (the old SetEnabled action in the plug-in service still works and will remain until version 3.0 is released). +* Fixes many issues around house modes, in particular, handling house mode changes while Deus is in its "active" time period (issue 16); +* More graceful handling of devices or scenes deleted from the system (but still appearing in DEMII's configuration)--they are now removed from config and the party continues; +* Fixes a possible loss of persistent state information if Luup crashes or the controller reboots during operation, that would sometimes leave DEMII disabled when it was enabled prior to the crash. + +## Version 2.3 (released) ## + +* adds support for house modes; fixes an issue with incorrect operation if DEMII is installed but Lights Out time is never changed +* fixes numerous other issues (see tagged issues). diff --git a/D_DeusExMachinaII1_UI7.json b/D_DeusExMachinaII1_UI7.json index 01b5e97..3062445 100644 --- a/D_DeusExMachinaII1_UI7.json +++ b/D_DeusExMachinaII1_UI7.json @@ -1,6 +1,6 @@ { "_comment": "This file is part of DeusExMachinaII", - "_copyright": "Copyright (c) 2016, 2017 Patrick H. Rigney, All Rights Reserved.", + "_copyright": "Copyright (c) 2016, 2017, 2018 Patrick H. Rigney, All Rights Reserved.", "default_icon": "https://dtabq7xg0g1t1.cloudfront.net/deusII.png", "state_icons": [{ "img": "https://dtabq7xg0g1t1.cloudfront.net/deus-red.png", @@ -23,32 +23,32 @@ }] } ], - "x": "2", - "y": "4", - "inScene": "1", - "ToggleButton": "1", + "x": 2, + "y": 4, + "inScene": 1, + "ToggleButton": 1, "Tabs": [{ "Label": { "lang_tag": "ui7_tabname_control", "text": "Control" }, - "Position": "0", + "Position": 0, "TabType": "flash", "top_navigation_tab": 1, "ControlGroup": [{ - "id": "1", - "isSingle": "1", - "scenegroup": "1" + "id": 1, + "isSingle": 1, + "scenegroup": 1 }], "SceneGroup": [{ - "id": "1", + "id": 1, "top": 0, "left": 0, "x": 4, "y": 2 }], "Control": [{ - "ControlGroup": "1", + "ControlGroup": 1, "ControlType": "multi_state_button", "top": 0, "left": 0, @@ -149,8 +149,8 @@ }, { "ControlType": "variable", - "top": "0", - "left": "0", + "top": 0, + "left": 0, "Display": { "Service": "urn:toggledbits-com:serviceId:DeusExMachinaII1", "Variable": "Message", @@ -162,11 +162,11 @@ }, { "ControlType": "label", - "top": "0", - "left": "0", + "top": 0, + "left": 0, "Label": { "lang_tag": "dem_about", - "text": "DeusExMachina II ver 2.8stable-180729 © 2016 Patrick H. Rigney, All Rights Reserved. For documentation, license, or to report bugs, please go to the DeusExMachina Github repository. Use of this plugin constitutes acceptance of and agreement to the license terms without limitation or exclusion." + "text": "DeusExMachina II ver 2.8stable-181007 © 2016,2018 Patrick H. Rigney, All Rights Reserved. For documentation, license, or to report bugs, please go to the DeusExMachina Github repository. Use of this plugin constitutes acceptance of and agreement to the license terms without limitation or exclusion." }, "Display": { "Top": 90, @@ -191,33 +191,28 @@ } } ], - "Conditions": [ - { + "Conditions": [{ "Trigger": { - "Operands": [ - { - "Service": "urn:toggledbits-com:serviceId:DeusExMachinaII1", - "Variable": "AutoTiming", - "Value": { - "Equals": "1" - } + "Operands": [{ + "Service": "urn:toggledbits-com:serviceId:DeusExMachinaII1", + "Variable": "AutoTiming", + "Value": { + "Equals": "1" } - ] + }] }, "Action": "disable", "Target": "cmd_activate" }, { "Trigger": { - "Operands": [ - { - "Service": "urn:toggledbits-com:serviceId:DeusExMachinaII1", - "Variable": "AutoTiming", - "Value": { - "Equals": "1" - } + "Operands": [{ + "Service": "urn:toggledbits-com:serviceId:DeusExMachinaII1", + "Variable": "AutoTiming", + "Value": { + "Equals": "1" } - ] + }] }, "Action": "disable", "Target": "cmd_deactivate" @@ -229,8 +224,9 @@ "lang_tag": "configure", "text": "Configure" }, - "Position": "1", + "Position": 1, "TabType": "javascript", + "TopNavigationTab": 1, "ScriptName": "J_DeusExMachinaII1_UI7.js", "Function": "DeusExMachinaII.configureDeus" }, @@ -239,7 +235,7 @@ "lang_tag": "ui7_advanced", "text": "Advanced" }, - "Position": "2", + "Position": 2, "TabType": "javascript", "ScriptName": "shared.js", "Function": "advanced_device" diff --git a/J_DeusExMachinaII1_UI7.js b/J_DeusExMachinaII1_UI7.js index 8998d5e..e8a735b 100644 --- a/J_DeusExMachinaII1_UI7.js +++ b/J_DeusExMachinaII1_UI7.js @@ -342,7 +342,7 @@ var DeusExMachinaII = (function(api) { html += 'div.devicelist { }'; html += 'div.scenecontrol { }'; html += '.demslider { display: inline-block; width: 200px; height: 1em; border-radius: 8px; }'; - html += '.demslider .ui-slider-handle { background: url("/cmh/skins/default/img/other/slider_horizontal_cursor_24.png?") no-repeat scroll left center rgba(0,0,0,0); cursor: pointer !important; height: 24px !important; width: 24px !important; margin-top: 6px; }'; + html += '.demslider .ui-slider-handle { background: url("/cmh/skins/default/img/other/slider_horizontal_cursor_24.png?") no-repeat scroll left center rgba(0,0,0,0); cursor: pointer !important; height: 24px !important; width: 24px !important; margin-top: 6px; font-size: 12px; text-align: center; padding-top: 4px; text-decoration: none; }'; html += '.demslider .ui-slider-range-min { background-color: #12805b !important; }'; html += 'ul#scenepairs { list-style: none; }'; html += '.cursor-hand { cursor: pointer; }'; @@ -509,8 +509,14 @@ var DeusExMachinaII = (function(api) { max: 100, step: 5, range: "min", - stop: function ( event, ui ) { + stop: function ( ev, ui ) { DeusExMachinaII.changeDimmerSlider( jQuery(this), ui.value ); + }, + slide: function( ev, ui ) { + jQuery( 'a.ui-slider-handle', jQuery( this ) ).text( ui.value ); + }, + change: function( ev, ui ) { + jQuery( 'a.ui-slider-handle', jQuery( this ) ).text( ui.value ); } }); jQuery('.demslider').slider("option", "disabled", true); diff --git a/L_DeusExMachinaII1.lua b/L_DeusExMachinaII1.lua index 41164d7..01388aa 100644 --- a/L_DeusExMachinaII1.lua +++ b/L_DeusExMachinaII1.lua @@ -6,6 +6,7 @@ module("L_DeusExMachinaII1", package.seeall) local string = require("string") +local _PLUGIN_ID = 8702 local _PLUGIN_NAME = "DeusExMachinaII" local _PLUGIN_VERSION = "2.8stable-180729" local _CONFIGVERSION = 20800 @@ -514,7 +515,6 @@ local function targetControl(targetid, turnOn) return end if luup.device_supports_service("urn:upnp-org:serviceId:VSwitch1", targetid) then - -- PHR 2017-08-14 pass newTargetValue as string for compat w/VSwitch (uses string comparisons in its implementation--needs an update) if turnOn then lvl = 1 end D("targetControl(): handling %1 (%3) as VSwitch, set target to %2", targetid, lvl, luup.devices[targetid].description) luup.call_action("urn:upnp-org:serviceId:VSwitch1", "SetTarget", {newTargetValue=tostring(lvl)}, targetid) @@ -523,10 +523,10 @@ local function targetControl(targetid, turnOn) D("targetControl(): handling %1 (%3) as generic dimmmer, set load level to %2", targetid, lvl, luup.devices[targetid].description) luup.call_action(DIMMER_SID, "SetLoadLevelTarget", {newLoadlevelTarget=lvl}, targetid) -- note odd case inconsistency in word "level" elseif luup.device_supports_service(SWITCH_SID, targetid) then - -- Handle as SwitchPower1 + -- Handle as SwitchPower1. Send string here too, for openLuup. if turnOn then lvl = 1 end D("targetControl(): handling %1 (%3) as generic switch, set target to %2", targetid, lvl, luup.devices[targetid].description) - luup.call_action(SWITCH_SID, "SetTarget", {newTargetValue=lvl}, targetid) + luup.call_action(SWITCH_SID, "SetTarget", { newTargetValue=tostring(lvl) }, targetid) else D("targetControl(): don't know how to control target " .. tostring(targetid)) removeTarget(targetid)