﻿<script type="text/javascript">
// namespace : HG.Ext.ZWave
// info      : -
// TODO: move this to a proper location
{include ext/zwave/_nodesetup.js}
</script>

<div id="configurepage_OptionZWave" data-role="page">
    <div data-role="header" data-position="fixed" data-tap-toggle="false">
        <h3>
            ZWave Node <span data-module-prop="Address"></span>
        </h3>
    </div>

    <div class="ui-content">

        <div id="zwave_configure_advanced">
        
            <h3 data-module-prop="Name"></h3>
            <input id="configurepage_OptionZWave_id" type="hidden" />
            <ul data-role="listview" data-inset="false" id="opt-zwave-options-list">
                <li data-role="list-divider">Node Informations</li>
                <li>
                    <label id="opt-zwave-manufacturerspecs-label">Manufacturer Specific = ?</label>
                    <label id="opt-zwave-versionreport-label">SW Version: ?</label>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td style="padding-right:30px">
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.ZWave_NodeInfoRequest()">Get</a>
                            </td>
                        </tr>
                    </table>
                    <div id="opt-zwave-nodeinformation-overview"></div>
                    <div id="opt-zwave-pepper1-link" style="position:absolute;top:3px;right:10px;font-size:10pt;"><a href="http://www.pepper1.net/zwavedb/" target="_blank">Powered by Pepper-One</a></div>
                </li>
            </ul>

            <ul id="opt-zwave-associations-box" data-role="listview" data-inset="false">
                <li data-role="list-divider">Associations</li>
                <li>
                    <label>Group Id</label>
                    <table id="opt-zwave-association-groupinput" style="margin-bottom:15px;">
                        <tr>
                            <td>
                                <input style="min-width:60px" type="number" value="1" min="0" max="255" id="configassoc-gid" ___onchange="_zwavedelayupdate($('#configurepage_OptionZWave_id').val());" data-module-prop="AssociationId" placeholder="group id" />
                            </td>
                        </tr>
                    </table>
                    <table id="opt-zwave-association-grouplist" style="margin-bottom:15px;">
                        <tr>
                            <td valign="top" style="min-width: 100px">
                                <select id="opt-zwave-association-groupselect"></select>
                            </td>
                            <td style="padding-left: 10px; font-size: 11pt; font-weight: normal" id="opt-zwave-association-groupdescription"></td>
                        </tr>
                    </table>
                    <label id="opt-zwave-association-label">Nodes Id in this group = ?</label>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td style="padding-right:30px;">
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.ZWave_AssociationGet();">Get</a>
                            </td>
                        </tr>
                    </table>
                    Add or remove a node in this group
                    <p style="margin-top:2px">
                        <em>
                            (add node <b>1</b> if you want HomeGenie receive events for this group)
                        </em>
                    </p>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td>
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:zwave_AssociationSet($('#configurepage_OptionZWave_id').val(), $('#configassoc-gid').val(), $('#configassoc-value').val());">Add</a>
                            </td>
                            <td style="padding-left:5px">
                                <input style="max-width:100px" type="text" id="configassoc-value" data-module-prop="AssociationValue" placeholder="node id" />
                            </td>
                            <td style="padding-left:5px">
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:zwave_AssociationRemove($('#configurepage_OptionZWave_id').val(), $('#configassoc-gid').val(), $('#configassoc-value').val());">Remove</a>
                            </td>
                        </tr>
                    </table>
                </li>
            </ul>

            <ul id="opt-zwave-configuration-box" data-role="listview" data-inset="false">
                <li data-role="list-divider">Configuration Variables</li>
                <li>
                    <label>Variable Id</label>
                    <table id="opt-zwave-configuration-varinput" style="margin-bottom:15px;">
                        <tr>
                            <td>
                                <input style="min-width:60px" type="number" value="1" min="0" max="255" id="configvar-id" __onchange="_zwavedelayupdate($('#configurepage_OptionZWave_id').val());" data-module-prop="VariableId" placeholder="parameter id" />
                            </td>
                        </tr>
                    </table>

                    <table id="opt-zwave-configuration-varslist" style="margin-bottom:15px;">
                        <tr>
                            <td valign="top" style="min-width: 100px">
                                <select id="opt-zwave-configuration-varselect"></select>
                            </td>
                            <td style="padding-left: 10px; font-size: 11pt; font-weight: normal; white-space: normal;" id="opt-zwave-configuration-vardescription"></td>
                        </tr>
                    </table>

                    <label id="opt-zwave-configvar-label">Variable Value = ?</label>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td style="padding-right:30px;">
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.ZWave_ConfigVariableGet()">Get</a>
                            </td>
                            <td>
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:zwave_ConfigurationParameterSet($('#configurepage_OptionZWave_id').val(), $('#configvar-id').val(), $('#configvar-value').val())">Set</a>
                            </td>
                            <td>
                                <input style="min-width:60px" type="text" id="configvar-value" data-module-prop="VariableValue" placeholder="value" />
                            </td>
                        </tr>
                    </table>

                </li>
            </ul>

            <ul id="opt-zwave-wakeup-box" data-role="listview" data-inset="false">
                <li data-role="list-divider">Wake Up</li>
                <li>
                    <label id="opt-zwave-wakeup-label">Wake Up Interval = ?</label>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td style="padding-right:30px">
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.ZWave_WakeUpGet()">Get</a>
                            </td>
                            <td>
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:zwave_WakeUpSet($('#configurepage_OptionZWave_id').val(), $('#wakeupset-value').val())">Set</a>
                            </td>
                            <td>
                                <input style="min-width:60px" type="text" id="wakeupset-value" data-module-prop="WakeUpInterval" placeholder="seconds" />
                            </td>
                        </tr>
                    </table>
                </li>
            </ul>

            <ul id="opt-zwave-heal-box" data-role="listview" data-inset="false">
                <li data-role="list-divider">Heal Node / Routing Info</li>
                <li>
                    <label id="opt-zwave-heal-label">Routing Info = ?</label>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td style="padding-right:30px">
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.ZWave_NodeNeighborUpdate()">Heal Node</a>
                            </td>
                        </tr>
                    </table>
                </li>
            </ul>

            <ul id="opt-zwave-basic-box" data-role="listview" data-inset="false">
                <li data-role="list-divider">Basic</li>
                <li>
                    <label id="opt-zwave-basic-label">Basic Value = ?</label>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td style="padding-right:30px">
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.ZWave_BasicGet()">Get</a>
                            </td>
                            <td>
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:zwave_BasicSet($('#configurepage_OptionZWave_id').val(), $('#basicset-value').val())">Set</a>
                            </td>
                            <td>
                                <input style="min-width:60px" type="text" id="basicset-value" data-module-prop="BasicCommandValue" placeholder="value" />
                            </td>
                        </tr>
                    </table>
                </li>
            </ul>

            <ul id="opt-zwave-multiinstance-box" data-role="listview" data-inset="false">
                <li data-role="list-divider">Multi Instance/Channel</li>
                <li>
                    <label>Instance/Channel Num.</label>
                    <table style="margin-bottom:15px;">
                        <tr>
                            <td>
                                <input style="min-width:60px" type="number" value="1" min="0" max="255" id="instancevar-id" __onchange="_zwavedelayupdate($('#configurepage_OptionZWave_id').val());" data-module-prop="InstanceId" placeholder="parameter id" />
                            </td>
                        </tr>
                    </table>
                    <div id="opt-zwave-switchbinary-opt">
                        <label id="opt-zwave-switchbinary-label">Switch Binary = ?</label>
                        <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                            <tr>
                                <td style="padding-right:30px;">
                                    <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.SwitchBinaryParameterGet()">Get</a>
                                </td>
                                <td>
                                    <a rel="external" class="ui-btn ui-corner-all" href="javascript:zwave_SwitchBinaryParameterSet($('#configurepage_OptionZWave_id').val(), $('#instancevar-id').val(), 0)">Off</a>
                                </td>
                                <td>
                                    <a rel="external" class="ui-btn ui-corner-all" href="javascript:zwave_SwitchBinaryParameterSet($('#configurepage_OptionZWave_id').val(), $('#instancevar-id').val(), 255)">On</a>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="opt-zwave-switchmulti-opt">
                        <label id="opt-zwave-switchmulti-label">Switch MultiLevel = ?</label>
                        <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                            <tr>
                                <td style="padding-right:30px">
                                    <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.SwitchMultiLevelParameterGet()">Get</a>
                                </td>
                                <td>
                                    <a rel="external" class="ui-btn ui-corner-all" href="javascript:zwave_SwitchMultilevelParameterSet($('#configurepage_OptionZWave_id').val(), $('#instancevar-id').val(), $('#instancevar-value').val())">Set</a>
                                </td>
                                <td>
                                    <input style="min-width:60px" type="text" id="instancevar-value" data-module-prop="InstanceValue" placeholder="value" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="opt-zwave-sensorbinary-opt">
                        <label id="opt-zwave-sensorbinary-label">Sensor Binary = ?</label>
                        <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                            <tr>
                                <td style="padding-right:30px">
                                    <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.SensorBinaryParameterGet()">Get</a>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="opt-zwave-sensormulti-opt">
                        <label id="opt-zwave-sensormulti-label">Sensor MultiLevel = ?</label>
                        <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                            <tr>
                                <td style="padding-right:30px">
                                    <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.SensorMultiLevelParameterGet()">Get</a>
                                </td>
                            </tr>
                        </table>
                    </div>

                </li>
            </ul>
            
            <ul id="opt-zwave-meter-box" data-role="listview" data-inset="false">
                <li data-role="list-divider">Meter</li>
                <li>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td style="padding-right:30px">
                                <div data-role="controlgroup" data-type="horizontal">
                                    <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.ZWave_MeterGet($('#opt-zwave-meter-typeselect').val())">Get</a>
                                    <select id="opt-zwave-meter-typeselect">
                                    <option value="0">kWh</option>
                                    <option value="1">kVAh</option>
                                    <option value="2">Watt</option>
                                    <option value="3">Pulses</option>
                                    <option value="4">AC Volt</option>
                                    <option value="5">AC Current</option>
                                    <option value="6">Power Factor</option>
                                    </select>
                                </div>
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.ZWave_MeterReset()">Reset</a>
                            </td>
                        </tr>
                    </table>
                </li>
            </ul>
            
            <ul id="opt-zwave-battery-box" data-role="listview" data-inset="false">
                <li data-role="list-divider">Battery</li>
                <li>
                    <label id="opt-zwave-battery-label">Battery Level = ?</label>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td style="padding-right:30px">
                                <a rel="external" class="ui-btn ui-corner-all" href="javascript:HG.WebApp.GroupModules.ZWave_BatteryGet()">Get</a>
                            </td>
                        </tr>
                    </table>
                </li>
            </ul>

            <ul id="opt-zwave-door-lock" data-role="listview" data-inset="false">
                <li data-role="list-divider">Door Lock</li>
                <li>
                    <label id="opt-zwave-doorlock-label">Door Lock Status = ?</label>
                    <table style="border-left:dotted 4px;padding-left:10px;margin-left:5px;margin-bottom:15px;">
                        <tr>
                            <td style="padding-right:30px">
                                <a rel="external" data-role="button" href="javascript:HG.WebApp.GroupModules.ZWave_DoorLockGet()">Get</a>
                            </td>
                        </tr>
                    </table>
                </li>
            </ul>
            
        </div>

    </div>
    <div data-role="footer" data-position="fixed" data-tap-toggle="false">
        <div data-role="navbar" data-iconpos="right">
            <ul>
                <li>
                    <a class="ui-btn ui-icon-back ui-btn-icon-left" href="#" data-locale-id="bottombar_button_back" data-rel="back">
                        Back
                    </a>
                </li>
                <li>
                    <a class="ui-btn ui-icon-home ui-btn-icon-left" href="#page_control" data-locale-id="bottombar_button_home">
                        Home
                    </a>
                </li>
                <li>
                    <a class="ui-btn ui-icon-none ui-btn-icon-none" href="javascript:$(this).blur();void(0);">
                    &nbsp;
                    </a>
                </li>
            </ul>
        </div><!-- /navbar -->
    </div>

    <div id="no-device-found-dialog-popup" class="ui-corner-all" data-position-to="window" data-transition="pop" data-overlay-theme="b">
        <a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
        <div class="ui-content ui-corner-bottom">
            <p>
                <span data-locale-id="no_device_found_for_manufacturerId">No device info was found for manufacturer ID</span>
                 = 
                 <span id="no-device-found-manufacturerId"></span>.
            </p>
        </div>
    </div>

</div>
<script type="text/javascript">
</script>

