I apologize if this was asked before.
I'm playing around with creating modules and I was wondering if there's a list of default event names for devices somewhere, or what is the best way to capture all events and output them so I can see what's available as I play with the device.
Thanks.
List of possible events for device
-
- Posts: 14
- Joined: 06 Mar 2014 22:14
Re: List of possible events for device
Looks like I was able to capture everything using:
Looks like events are set when the device is manually triggered? I have a Leviton VRI06 switch that supports instant status. Any advice on how to capture a manual toggle?
Code: Select all
this.controller.onAny
Re: List of possible events for device
I've made an module which captures changes in the system. It uses "this.controller.onAny" and saves changes to a mysql db.
But for manual changes, like toggle a switch, status is not sent to the system because of a patent(Lutron). You have to press the update button in the UI. Or make a smart module which compensates for the lack of status reports.
I just copied the value logging module included in the latest install and wrote a python script for mysql access...
this.controller.onAny(function () {
var newArgs = get_values(arguments);
newArgs.unshift(this.event);
self.logEventMysql.apply(self, newArgs);
});
But for manual changes, like toggle a switch, status is not sent to the system because of a patent(Lutron). You have to press the update button in the UI. Or make a smart module which compensates for the lack of status reports.
I just copied the value logging module included in the latest install and wrote a python script for mysql access...
this.controller.onAny(function () {
var newArgs = get_values(arguments);
newArgs.unshift(this.event);
self.logEventMysql.apply(self, newArgs);
});
-
- Posts: 14
- Joined: 06 Mar 2014 22:14
Re: List of possible events for device
As mentioned, the switch I'm using does support Instant Status (which is what the Lutron patent is for) so it does/should report it's status when manually triggered.
Re: List of possible events for device
Instant status, sounds good!
I don´t have a event list but I hope its included in the documentation soon. I solved my problem this way;
var args = get_values(arguments);
//args example: 28,0,48,1,false, = device, ?, commandClass, instance, level,
debugPrint("device" + args[0] + ", reports level " + args[4])
This way I can do what ever I want with reporting devices and its values.
I don´t have a event list but I hope its included in the documentation soon. I solved my problem this way;
var args = get_values(arguments);
//args example: 28,0,48,1,false, = device, ?, commandClass, instance, level,
debugPrint("device" + args[0] + ", reports level " + args[4])
This way I can do what ever I want with reporting devices and its values.