Skip to content

Commit

Permalink
various adds
Browse files Browse the repository at this point in the history
1. - added new schema for groups
     There can be up to 8 groups of devices, the names of the groups can be set in config
     Each groups counts the number of devices home (up) and away(down/expired)
       They are shown as  variables
         Unifi_count_groupname_Home  == number of device up
         Unifi_count_groupname_Away  = number of devices not up
         Unifi_count_groupname_lastChange  = datestamp of last count change
     A device can be added/ removed in each devices edit or in menu/manage groups
     The manage group option allows to add eg all wifi or lan devices to a group
      and you can eg add/remove 10 individual devices on one screen faster than editing 10 devices
     There is a a report on the groups, memebers etc in Print parameters
   - several device model texts had typos
   - various menu cosmetic  changes

2. fixes
   - block / unblock wifi devices had a cosmetic error message
   - the site id name was always default, now can be set in config (not test)
  • Loading branch information
kw123 committed Apr 1, 2021
1 parent 09b93d6 commit 7b720e6
Show file tree
Hide file tree
Showing 6 changed files with 1,187 additions and 1,103 deletions.
2 changes: 1 addition & 1 deletion uniFiAP.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>7.38.356</string>
<string>7.39.356</string>
<key>ServerApiVersion</key>
<string>2.0.0</string>
<key>IwsApiVersion</key>
Expand Down
590 changes: 294 additions & 296 deletions uniFiAP.indigoPlugin/Contents/Server Plugin/Devices.xml

Large diffs are not rendered by default.

69 changes: 45 additions & 24 deletions uniFiAP.indigoPlugin/Contents/Server Plugin/MenuItems.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Field id="simpleSeparator1" type="separator"/>

<Field id="confirmprintAllMACs" type="button" tooltip="a lot of lines !! " >
<Label>Print All info for all MAC numbers</Label>
<Label>PRINT All info for all MAC numbers</Label>
<Title>PRINT</Title> <CallbackMethod>buttonprintALLMACsCALLBACK</CallbackMethod>
</Field>

Expand All @@ -35,6 +35,11 @@
<Label>Click to</Label>
<Title>PRINT</Title> <CallbackMethod>buttonConfirmPrintMACCALLBACK</CallbackMethod>
</Field>
<Field id="simpleSeparator4" type="separator"/>
<Field id="printGroups" type="button">
<Label>PRINT Groups </Label>
<Title>PRINT</Title><CallbackMethod>printGroupsCALLBACK</CallbackMethod>
</Field>

</ConfigUI>
</MenuItem>
Expand Down Expand Up @@ -382,18 +387,10 @@ it will make the plugin restart </Label>



<MenuItem id="addToGroups">
<Name>Groups ... Manage</Name>
<MenuItem id="ManageGroupsTypes">
<Name>Groups ... Manage device types</Name>
<ConfigUI>
<Field id="printGroups" type="button">
<Label>PRINT Groups </Label>
<Title>CONFIRM </Title><CallbackMethod>printGroupsCALLBACK</CallbackMethod>
</Field>

<Field id="simpleSeparator00" type="separator"/>

<Field id="simpleSeparator01" type="separator"/>
<Field id="labeladdremovetypes" type="label"> <Label>ADD or remove devices types from to groups:</Label> </Field>
<Field id="labeladdremovetypes" type="label"> <Label>ADD or remove devices TYPES from to groups:</Label> </Field>
<Field id="addRemoveGroupsWhichDevice" type="menu" defaultValue="system">
<Label>select which type of device:</Label>
<List>
Expand All @@ -407,17 +404,22 @@ it will make the plugin restart </Label>
<Label>select which Group you want to add to / remove from:</Label>
<List class="self" filter="" method="filterGroupNoName" dynamicReload="false"/>
</Field>

<Field id="confirmnameSW" type="button" tooltip="" >
<Label>Click to add</Label><Title>CONFIRM </Title> <CallbackMethod>buttonConfirmAddDevGroupCALLBACK</CallbackMethod>
</Field>
<Field id="confirmrem" type="button" tooltip="" >
<Label>Click to remove</Label><Title>CONFIRM </Title> <CallbackMethod>buttonConfirmRemDevGroupCALLBACK</CallbackMethod>
</Field>

<Field id="simpleSeparator10" type="separator"/>
</ConfigUI>
</MenuItem>


<Field id="simpleSeparator11" type="separator"/>
<Field id="labeladdremove01" type="label"> <Label>ADD or remove individual devices from to groups:</Label> </Field>
<MenuItem id="ManageGroupsIndividual">
<Name>Groups ... Manage individual devices</Name>
<ConfigUI>
<Field id="labeladdremove01" type="label"> <Label>ADD or RENMOVE individual devices to from groups:</Label> </Field>

<Field id="selectedGroup" type="menu" defaultValue="">
<Label>select which GROUP:</Label>
Expand All @@ -428,32 +430,39 @@ it will make the plugin restart </Label>
<Title>CONFIRM </Title> <CallbackMethod>buttonConfirmgroupCALLBACK</CallbackMethod>
</Field>
<Field id="simpleSeparator30" type="separator"/>
<Field id="labeladdremove32" type="label"> <Label>REMOVE:</Label> </Field>
<Field id="simpleSeparator31" type="separator"/>
<Field id="labeladdremove32" type="label"> <Label>... REMOVE:</Label> </Field>
<Field id="removeALLGroupMembers" type="button" tooltip="" >
<Label>Click to REMOVE ALL group members</Label>
<Label>...A) Click to REMOVE ALL group members /devices</Label>
<Title>CONFIRM </Title> <CallbackMethod>buttonConfirmremoveALLGroupMembersCALLBACK</CallbackMethod>
</Field>
<Field id="simpleSeparator33" type="separator"/>
<Field id="selectedGroupMemberIndigoIdremove" type="menu" tooltip="" >
<Label>Click to select group MEMBER </Label>
<Label>...B)Click to select device to remove from group</Label>
<List class="self" filter="" method="filterGroupMembers" dynamicReload="false"/>
</Field>
<Field id="removeGroupMember" type="button" tooltip="" >
<Label>Click to REMOVE group member</Label>
<Label>...B)Click to REMOVE device from group</Label>
<Title>CONFIRM </Title> <CallbackMethod>buttonConfirmremoveGroupMemberCALLBACK</CallbackMethod>
</Field>
<Field id="simpleSeparator40" type="separator"/>
<Field id="labeladdremove42" type="label"> <Label>ADD:</Label> </Field>
<Field id="labeladdremove42" type="label"> <Label>...ADD:</Label> </Field>
<Field id="selectedGroupMemberIndigoIdadd" type="menu" tooltip="" >
<Label>Click to select group MEMBER to add </Label>
<Label>...C)Click to select device to add to group</Label>
<List class="self" filter="" method="filterDevicesToAddToGroup" dynamicReload="false"/>
</Field>
<Field id="addGroupMember" type="button" tooltip="" >
<Label>Click to ADD group member</Label>
<Label>Click to ADD device to group</Label>
<Title>CONFIRM </Title> <CallbackMethod>buttonConfirmADDGroupMemberCALLBACK</CallbackMethod>
</Field>

<!--
-->

</ConfigUI>
</MenuItem>


<MenuItem id="dCameras"> <Name>-------------Cameras ----------</Name><CallbackMethod>inpDummy</CallbackMethod></MenuItem>

<MenuItem id="CameraActionsNVR">
Expand Down Expand Up @@ -493,7 +502,7 @@ it will make the plugin restart </Label>

<Field id="sendcmdtoCameraNVR" type="label" fontSize="large"> <Label>Send commands to cameras (rec/LED/IR/Mic/speaker on/off ...)</Label></Field>
<Field id="cameraCmd" type="checkbox" defaultValue="false" > <Label>Show Camera commands:</Label> </Field>
<Field id="msg" type="textfield" defaultValue="msg from plugin will show here" > <Label>ret code from plugin:</Label> </Field>
<Field id="MSG" type="textfield" defaultValue="msg from plugin will show here" > <Label>ret code from plugin:</Label> </Field>

<Field id="cameraDeviceSelected" type="menu" defaultValue="" >
<Label>1. Select ==========> camera device:</Label>
Expand Down Expand Up @@ -734,7 +743,7 @@ it will make the plugin restart </Label>

<Field id="sendcmdtoCameraProtect" type="label" fontSize="large"> <Label>Send commands to cameras (rec/LED/IR/Mic/speaker on/off ...)</Label></Field>

<Field id="msg" type="textfield" defaultValue="msg from plugin will show here" > <Label>ret code from plugin:</Label> </Field>
<Field id="MSG" type="textfield" defaultValue="msg from plugin will show here" > <Label>ret code from plugin:</Label> </Field>
<Field id="simpleSeparatormsg" type="separator"/>

<Field id="confirmProtect" type="button" tooltip="" >
Expand Down Expand Up @@ -1137,6 +1146,9 @@ it will make the plugin restart </Label>
<MenuItem id="reconnectWiFiClient">
<Name>Re-CONNECT a wifi client (kick)</Name>
<ConfigUI>
<Field id="MSG" type="textfield" defaultValue="ok" readonly ="true">
<Label>MSG from plugin:</Label>
</Field>
<Field id="selectedDevice" type="menu" defaultValue="0">
<Label>select client Wifi device:</Label>
<List class="self" filter="" method="filterWiFiDevice" dynamicReload="no"/>
Expand All @@ -1150,6 +1162,9 @@ it will make the plugin restart </Label>
<MenuItem id="blockClient">
<Name>(UN) BLOCK a client</Name>
<ConfigUI>
<Field id="MSG" type="textfield" defaultValue="ok" readonly ="true">
<Label>MSG from plugin:</Label>
</Field>
<Field id="selectedDevice" type="menu" defaultValue="0">
<Label>select UniFi-CLient device:</Label>
<List class="self" filter="" method="filterMACunifiOnly" dynamicReload="no"/>
Expand Down Expand Up @@ -1226,6 +1241,9 @@ it will make the plugin restart </Label>
<MenuItem id="activateSuspendUnifiDevice">
<Name>SUSPEND-ACTIVATE a UniFi system device (effects plugin only)</Name>
<ConfigUI>
<Field id="MSG" type="textfield" defaultValue="ok" readonly ="true">
<Label>MSG from plugin:</Label>
</Field>
<Field id="Label01" type="label">
<Label> This will make the plugin to ignore that unfi system device, will just not use it or change it </Label> </Field>
<Field id="selectedDevice" type="menu" defaultValue="0">
Expand All @@ -1245,6 +1263,9 @@ it will make the plugin restart </Label>
<MenuItem id="APledONoff">
<Name>Set AP LEDs ON/off</Name>
<ConfigUI>
<Field id="MSG" type="textfield" defaultValue="ok" readonly ="true">
<Label>MSG from plugin:</Label>
</Field>
<Field id="confirm1" type="button" tooltip="" >
<Label>Click to switch all LEDs ON</Label><Title>EXECUTE </Title> <CallbackMethod>buttonConfirmAPledONControllerCALLBACK</CallbackMethod>
</Field>
Expand Down
29 changes: 27 additions & 2 deletions uniFiAP.indigoPlugin/Contents/Server Plugin/PluginConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,38 @@
<Label> .. variables:</Label>
</Field>



<Field id="infoLabelGroup" type="label">
<Label>---- group names for devices</Label>
</Field>
<Field id="Group0" type="textfield" defaultValue="Group0" > <Label> .. Group 0 Name:</Label> </Field>
<Field id="Group1" type="textfield" defaultValue="Group1" > <Label> .. Group 1 Name:</Label> </Field>
<Field id="Group2" type="textfield" defaultValue="Group2" > <Label> .. Group 2 Name:</Label> </Field>
<Field id="Group3" type="textfield" defaultValue="Group3" > <Label> .. Group 3 Name:</Label> </Field>
<Field id="Group4" type="textfield" defaultValue="Group4" > <Label> .. Group 4 Name:</Label> </Field>
<Field id="Group5" type="textfield" defaultValue="Group5" > <Label> .. Group 5 Name:</Label> </Field>
<Field id="Group6" type="textfield" defaultValue="Group6" > <Label> .. Group 6 Name:</Label> </Field>
<Field id="Group7" type="textfield" defaultValue="Group7" > <Label> .. Group 7 Name:</Label> </Field>
<Field id="infoLabelinfoLabelGroup" type="label" alignWithControl="true" fontSize="small" fontColor="darkgrey">
<Label>For each group 3 variables will be created in the unifi variables folder
Unifi_Count_grpname_Home
Unifi_Count_grpname_Away
Unifi_Count_grpname_lastChange
You can add devices to a group (in device edit or do a mass change in menu manage groups) and trigger on any change variable UniFi_Count_groupname_Home / Away value ==0 or max or 1
0= non home / away,
0 to 1= one home/ away,
max = all home / away
Or trigger on any change in variable ..lastChange to check if anything device from that group came home or left</Label>
</Field>

<Field id="simpleSeparatorUIDs" type="separator"/>

<Field id="infoLabelUID" type="label">
<Label>== user IDs for systems (leave empty if not used), no ' " GT LT | # in your passwords!! </Label>
</Field>

<Field id="infoLabelDifferentUIDs" type="label" visibleBindingId="unifiCloudKeyMode" fontSize="small" fontColor="darkgrey">
<Field id="infoLabelDifferentUIDs" type="label" fontSize="small" fontColor="darkgrey">
<Label>. There can be several sets of UID-password - They can all be the same depending on YOUR setup on the controller
. 1. the UID-password you use to login via web browser (http) to your UniFi controller
. 2. the unix UID-password when you ssh in terminal to the WiFi-AP, Switch, Router
Expand All @@ -170,7 +195,7 @@ Leave userid and password blank if you want to disable querying the controller</
<Label>... Use strict:true option for login to CONTROLLER webpage</Label>
</Field>

<Field id="infoLabelstrict" type="label" visibleBindingId="unifiCloudKeyMode" alignWithControl="true" fontSize="small" fontColor="darkgrey">
<Field id="infoLabelstrict" type="label" alignWithControl="true" fontSize="small" fontColor="darkgrey">
<Label>This option might be needed for UDM non pro depending on config/setup/version</Label>
</Field>

Expand Down
Loading

0 comments on commit 7b720e6

Please sign in to comment.