Help porting alarm system bridge

Yes, with a help from a friend, i changed this:

addChildDevice(“smartthings”, “Motion Detector”, “alarmchildzone${curzone.zoneid}”, device.hub.id, [name: thiszonename])

To this:

addChildDevice(“hubitat”, “Motion Detector”, “alarmchildzone${curzone.zoneid}”, [name: thiszonename])

This is now in the code:

case ["Magnet", "Contact", "Entry/Exit"]:
// If it is a magnetic sensor then add it as a contact sensor
addChildDevice("Hubitat", "Open/Closed Sensor", "alarmchildzone${curzone.zoneid}", [name: thiszonename]) 
log.debug "Created contact zone child device"
						break

case ["Motion", "Interior", "Wired"]:
// If it is a motion or interior sensor then add it as a motion detector device
addChildDevice("hubitat", "Motion Detector", "alarmchildzone${curzone.zoneid}", [name: thiszonename])
log.debug "Created motion zone child device"
break

But I'm getting an error now that says:

Couldnt add device, probably already exists:

com.hubitat.app.exception.UnknownDeviceTypeException: Device type 'Motion Detector' in namespace 'hubitat' not found

Yet, as can be seen from the code above, there is a device type: motion detector, in namespace hubitat?

the ST name space probably has a "Motion Detector" DTH … may be the HE name space does not have a default "Motion Detector" driver?

How would I go about adding one in the HE or the Device Code?

i am speculating … @chuck.schwer is probably the best person to address this.

but if you wanted to try copy the code from ST -> My Device Handlers -> Create New Device Handler -> From Example -> Motion Detector.

with that code create a new driver in HE after making the necessary HE adjustments.

then give it a try?

2 Likes

@bangali is correct there isn’t an out of the box driver called Motion Detector but there is one called Virtual Motion Sensor which should work for you. I use this in one of my apps. So try:

addChildDevice(“hubitat”, “Virtual Motion Sensor”, “alarmchildzone${curzone.zoneid}”, null, [name: thiszonename])

Also noticed a missing parameter in the addChildDevice function call where I am passing null.

1 Like

Yes, that is the one to use.

You might have a look at my Envisalink Integration app. I do similar for contacts and motion, you're trying to do with your integration. Feel free to pilfer if it works for you.

https://community.hubitat.com/t/envisalink-integration-application-and-connection-driver/3123

Hello Mike,
I have the same alarm system bridge. Were you able to get this working?
Thanks

Welcome to the community!

Yes I did get it working. I'll post it shortly. It's not pretty, but it works.

You'll need to go into your Alarm System Bridge and change the IP address to the hubitat, then install the driver, and create a device (using the Alarm System Bridge driver), then set all the IP addresses, passwords etc.

It may take some playing around. I'm loathe to touch mine, as it's working perfectly...faster than ST by a mile.

As I said, code is not pretty, but it works.

Awesome! Thanks Mike. Looking forward to trying this out.

Hello Mike,
Thank you for the driver. I was able to connect to my Alarm System Bridge, get zone names, and create child devices. The connection is working because I can arm my alarm from Hubitat, but the child devices don't register any activity. I am using the virtual motion sensor and virtual contact sensor device types, but have also tried the generic component device types. Do you know what I'm doing wrong?
Thank you

We'd need to know more about your setup, how are you connecting to the bridge, what's the brand? Do you have an API or TPI?

With much help, I implemented the Envisalink Integration app and driver. We needed to parse the payload coming down the telnet pipe and take action on the child devices (contacts and motion sensors).

Have a look and see if it helps you get started.
https://community.hubitat.com/t/envisalink-integration-application-and-connection-driver/3123

Hmm, I'm not sure. Is there anything in the logs?

Is the Alarm system bridge receiving data? So, if you move about the house, go the ASB, and check that it's gettting data.

Thanks everyone,
I am using mike's driver from above. That talks to an alarm system bridge (originally developed for smart things) that communicates to a Networx NX-V2 panel via an NX-584e automation module. The bridge is communicating with the panel, and I am able to connect the bridge to Hubitat with the driver. Hubitat is able to see the state of the alarm (armed/disarmed) and to arm it. It is able to read the device names from the panel and generate child devices. The child devices are all automatically assigned the type virtual motion sensor.

The problem is that the virtual motion sensors that it creates don't work. I checked the logs, and I get this when I activate one of the physical motion sensors.

headers:UE9TVCAvIEhUVFAvMS4xDQpDb25uZWN0aW9uOiBjbG9zZQ0KSG9zdDogMTkyLjE2OC4zLjIxODozOTUwMQ0KU2VydmVyOiBBbGFybSBTeXN0ZW0NCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04DQo=, body:

dev:6092019-04-22 11:34:28.361 am debugNot valid json response/message

dev:6092019-04-22 11:34:20.937 am debugmac:4E6574777278, ip:c0a8030f, port:c04f, headers:UE9TVCAvIEhUVFAvMS4xDQpDb25uZWN0aW9uOiBjbG9zZQ0KSG9zdDogMTkyLjE2OC4zLjIxODozOTUwMQ0KU2VydmVyOiBBbGFybSBTeXN0ZW0NCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04DQo=, body:

dev:6092019-04-22 11:34:20.930 am debugNot valid json response/message

dev:6092019-04-22 11:34:19.787 am debugmac:4E6574777278, ip:c0a8030f, port:c04e, headers:UE9TVCAvIEhUVFAvMS4xDQpDb25uZWN0aW9uOiBjbG9zZQ0KSG9zdDogMTkyLjE2OC4zLjIxODozOTUwMQ0KU2VydmVyOiBBbGFybSBTeXN0ZW0NCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04DQo=, body:

dev:6092019-04-22 11:34:19.781 am debugNot valid json response/message

dev:6092019-04-22 11:34:19.230 am debugmac:4E6574777278, ip:c0a8030f, port:c04d, headers:UE9TVCAvIEhUVFAvMS4xDQpDb25uZWN0aW9uOiBjbG9zZQ0KSG9zdDogMTkyLjE2OC4zLjIxODozOTUwMQ0KU2VydmVyOiBBbGFybSBTeXN0ZW0NCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04DQo=, body:

dev:6092019-04-22 11:34:19.224 am debugNot valid json response/message

dev:6092019-04-22 11:34:14.631 am debugmac:4E6574777278, ip:c0a8030f, port:c04c, headers:UE9TVCAvIEhUVFAvMS4xDQpDb25uZWN0aW9uOiBjbG9zZQ0KSG9zdDogMTkyLjE2OC4zLjIxODozOTUwMQ0KU2VydmVyOiBBbGFybSBTeXN0ZW0NCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04DQo=, body:

dev:6092019-04-22 11:34:14.625 am debugNot valid json response/message

dev:6092019-04-22 11:34:04.926 am debugmac:4E6574777278, ip:c0a8030f, port:c04b, headers:UE9TVCAvIEhUVFAvMS4xDQpDb25uZWN0aW9uOiBjbG9zZQ0KSG9zdDogMTkyLjE2OC4zLjIxODozOTUwMQ0KU2VydmVyOiBBbGFybSBTeXN0ZW0NCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04DQo=, body:

dev:6092019-04-22 11:34:04.920 am debugNot valid json response/message

dev:6092019-04-22 11:33:50.185 am debugmac:4E6574777278, ip:c0a8030f, port:c04a, headers:UE9TVCAvIEhUVFAvMS4xDQpDb25uZWN0aW9uOiBjbG9zZQ0KSG9zdDogMTkyLjE2OC4zLjIxODozOTUwMQ0KU2VydmVyOiBBbGFybSBTeXN0ZW0NCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04DQo=, body:

dev:6092019-04-22 11:33:50.180 am debugNot valid json response/message

Thanks everyone

Did you get this working. Recently I moved my Alarm system bridge to a second HE hub, to get it off my main HE hub, and I got it working very quickly. I've changed a few things as well in the current driver to remove 99% of the chatty logs. It should help speed up your single hub remarkably. Let me know if you need any help.

Also, if you check the smartthings thread, there is an update for the ASB firmware (by the author), that also helps deal with some of the chattiness of the logs (especially for the way Aussie installers tend to setup the system).

Both these have helped reduce the number of logs for the ASB from tens of thousands per day, down to ~1,000 per day for my use case scenario.

Hello Mike,
I had given up on getting this to work. I got your driver to partially work, but it never responded to my motion or contact sensors. I will try the updated asb firmware from the smart things thread. Would you mind sharing your updated hubitat driver with me?
Thanks
John

Sure,

It's here: ASB/Driver at master · GeorgeCastanza/ASB · GitHub

Thanks for your help Mike! I was able to get this working today. I had to play around with a few things, but it's working perfectly now.

Glad you were able to get it working.