Author Topic: AD2USB plugin created motion sensors instead of Door sensors  (Read 2440 times)

Offline wsyaeger

  • Sr. Newbie
  • *
  • Posts: 45
  • Karma: +0/-2
AD2USB plugin created motion sensors instead of Door sensors
« on: January 27, 2016, 01:48:17 am »
I have this plugin on ui7 controlling my vista 20p. all but one of my physical sensors (originally hardwired to the alarm panel) are door/window contacts. however, in the vera ui they appear as motion sensors.

Is there a way to modify the motion sensor devices that were created by the plugin to graphically appear and act/respond as door sensors?

Thank you for all the effort on this plugin- it is incredibly useful.

Offline CheckedOut

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +1/-0
Re: AD2USB plugin created motion sensors instead of Door sensors
« Reply #1 on: March 29, 2016, 10:06:44 pm »
Did you ever find a solution? I tried to rename the sensors and change the device xml/json and category subtype through the UI and they disappear momentarily and come back with another name.
« Last Edit: March 29, 2016, 10:09:31 pm by CheckedOut »

Offline tamorgen

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +1/-0
Re: AD2USB plugin created motion sensors instead of Door sensors
« Reply #2 on: April 08, 2016, 11:13:01 am »
I called tech support, and they say they have a third party plugin, but they've done it for me.  Or, at least they initially set them up as motion sensors.  I've asked them to change them to Door/Window sensors, and I'm still waiting on them to do this.  I'd like to know how to do it myself.

Also, I have a glass break detector and a smoke/heat detector connected to alarm panel.  They're telling me that the sensors can only be motion or door/window sensors, and it has to be all or none.  Seems like there has to be a better way.

Offline CheckedOut

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +1/-0
Re: AD2USB plugin created motion sensors instead of Door sensors
« Reply #3 on: April 14, 2016, 04:59:48 pm »
I am wondering if I delete the zone cheat sheet list items if I can then change the device types to the appropriate sensor type through the device files. Seems that that cheat sheet is tied to the auto recreation of the devices. We definitely need a how to with this plugin.

Offline tamorgen

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +1/-0
Re: AD2USB plugin created motion sensors instead of Door sensors
« Reply #4 on: April 14, 2016, 05:55:40 pm »
I am wondering if I delete the zone cheat sheet list items if I can then change the device types to the appropriate sensor type through the device files. Seems that that cheat sheet is tied to the auto recreation of the devices. We definitely need a how to with this plugin.

Well, I haven't been able to get tech support to respond to me since they screwed up my system this past Sunday morning.  Whatever they did made my whole system unresponsive.  I had to restore to a previous config.  I'd rather learn how to do it myself and not have to rely on support.

Offline CheckedOut

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +1/-0
Re: AD2USB plugin created motion sensors instead of Door sensors
« Reply #5 on: November 28, 2016, 02:01:46 pm »
Couple updates on this thread.

1) I had an issue with the device not being detected a couple months ago (Vera Plus UI 7 Latest FW) and support updated me to a newer version. I have attached it.

2) I tried to update the device category, files and uri using the device categories show in http://wiki.micasaverde.com/index.php/Luup_Device_Categories . This fails and the device disappears and gets recreated on the next luup restart.

Offline CheckedOut

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +1/-0
Re: AD2USB plugin created motion sensors instead of Door sensors
« Reply #6 on: November 28, 2016, 02:09:58 pm »
Taking a deeper look it appears that the problem lies in this function:

Code: [Select]
local function appendZones (rootPtr, zones)
for zoneNo, zoneAddress, zoneChannel, zoneName in zones:gmatch("(%d+)-(%d*)-?(%d*)-?([^;]+)") do
debug("(VistaAlarmPanel::appendZones) Appending zone #"..zoneNo.." with address ["..zoneAddress.."] and channel ["..zoneChannel.."]")
local parameters = SID.SECURITY_SENSOR..",Armed=1\n"..SID.SECURITY_SENSOR..",Tripped=0"
luup.chdev.append(lug_device, rootPtr, "vista_zone_"..zoneNo, "Zone #"..zoneNo.." - "..zoneName, "urn:schemas-micasaverde-com:device:MotionSensor:1", "D_MotionSensor1.xml", "", parameters, false)
zoneNo = tonumber(zoneNo, 10)
local zoneType = ZONE_TYPE.UNKNOWN
if (zoneAddress:len() == 2 and zoneChannel:len() == 1) then
zoneType = ZONE_TYPE.WIRED
elseif (zoneAddress:len() == 7 and zoneChannel:len() == 1) then
zoneType = ZONE_TYPE.RF
end
g_zones[zoneNo] = {
address = zoneAddress, -- keep address as string because RF serial # "0000012" != address "12"
channel = tonumber(zoneChannel, 10),
type = zoneType
}
end
end

There may be a few ways to fix this. One way would be to change the device type to doorswitch. However this would make all zones door's. What I would like to do is have the ability to change the zone type in the zone list as I mentioned earlier. I need to take a look at how that list is being handled to see if that is possible.