Ive built a custom device handler for managing my alarm system, but I now was to have separate simulated sensors for each of the alarm zones. Ive seen a few cases on these forums about how to do it, but they are quite different in use case and seem to involve tons of complexity which I can’t believe is required…
Basically I have a web enabled device which is sending and receiving JSON strings to a custom device handler (identified by MAC address as its DNI in ST), this is then updating several tiles using various sendEvents. I would like to forward these events to a separate device in order to use more easily with things like CoRE (I have a simulated contact sensor that I have built to support open/close and active/inactive). If you could help with a few questions I feel like I can get back to making some progress myself again, thanks very much in advance!
As I understand it one device cannot communicate with another, unless a SmartApp is involved? I would know the DNI of these sub devices as I would create them, but I cant find a method to search for a device based on a DNI.
Assuming I need a SmartApp, are there any simple examples to show how I can pass a ‘send event style map’ to a custom SmartApp, and then the SmartApp will call the relevant device function (such as open()/close()…)
In order to do the SmartApp based solution I believe I need to select connected devices in the preferences? If there is another option Id be happy to look at that too. I can see creation of childDevices, perhaps the SmartApp can be called with a ‘Setup’ procedure which searches for devices with a certain DNI, and if they do not exist then it creates them? Would that help since then they are childDevices?
Or another options is that I have to subscribe the SmartApp to various events in the Alarm DTH, Im not sure how to do this since each of the tiles is a fairly custom file (I dont know how to specify a tile as a switch/sensor., which can be subscribed to)
Sorry for the basic questions but I find the documentation really hard to understand (partially as my Java skills are limited and Im more used to simple C style code, and partially as I think the documentation is quite spread out and I struggle to follow it).
Thanks again in advance