nutechsoftware / alarmdecoder-smartthings

AlarmDecoder webapp support for the SmartThings home automation platform.
Apache License 2.0
25 stars 43 forks source link

ZoneTracked is limited to 12 zones even if we make 20. #47

Closed f34rdotcom closed 3 years ago

f34rdotcom commented 5 years ago

Because the translation of zones to virtual zone device numbers is limited to 20 that are typed into the settings page of the Network Appliance device handler and that section is not possible to make dynamic I need to find a better way. Having to modify code to go beyond 20 is a pain and adding 40 zones so enough are created to trap any zone number is not good when 90% of the devices will be not used.

It is also not very intuitive on how the ZoneTracker preferences work. It would be better to allow the user to create individual virtual zones on demand and not provide some mass input screen for all the tracked zones.

jasonsf commented 5 years ago

Just as an example of how I've been handling this, I created a map of my sensors: def getSensorMap() { return ['10':'Front Door', '11':'Dining Room S.G.D', '12':'Garage Entry Door', '13':'Laundry Rm Bath Window', '14':'Kitchen Window', '15':'Kitchen Nook Window', '16':'Family Rm Door','17':'Master Bd Rm Window 1', '18':'Master Bd Rm Window 2', '19':'Master Bath Door', '20':'Hall Bathroom Window', '21':'Guest Room Window', '22':'Bedroom 3 Window', '23':'Bedroom 4 Window','24':'Bedroom 5 Window', '25':'Motion - Hallway']; } def sensorMap = getSensorMap();

And then when I need to iterate through the sensors I something like this: for (def i = 1; i <= sensorMap.size(); i++) sendEvent(name: "zoneStatus${i}", value: "", displayed: false)

I also hardcoded the inputs to match my zones: input("zonetracker1zone", "number", title: "10: " + sensorMap['10'], description: "Zone number to associate with this contact sensor.")

f34rdotcom commented 5 years ago

Got it mostly working using Properties on the device. It will create "MAX_SENSORS" then go to each one and set the zone #. It allows the zone to be on multiple devices. Not sure why I did that but I figured a use case may show up :). I was able to remove all of the zonetrackerXXzone inputs.

I could make a "mgt" screen to allow easy setting of the ZOne # but for now using the devices settings gear to change them. The code for this update is going to be crazy :( many thousands of lines and a top to bottom cleanup and improvements.

Also to set the zone Name. Would you not just change the device name on this same screen?

Thanks!

Screenshot_20190928-164750_SmartThings

f34rdotcom commented 5 years ago

patch now in dev.