Dumb question that I’m sure has a simple answer. In the json file for a device, there is a ToggleButton statement. If it is set to 1, it basically allows a toggle functionality for the device when the device’s image is clicked. For example, if you have a motion sensor, and you click on the icon of the little man, it toggles between armed and bypassed state. If you create a custom luup device, however, clicking on the little icon gives you a no implentation error. How do I implement this functionality?
Don’t know the answer, but can give you a few ways you can probably find out:
a) Run Firefox with the Firebug Plugin, and watch the URL sent when you click the Toggle Action.
The Firebug Pluigin will show you the URL Requested, headers (etc, and and JSON response.
b) Look in [tt]LuaUPnP.log[/tt] with Verbose Logging enabled.
All of these URL-based actions are recorded in there, and typically “actions” against a UPnP object have the same type of incoming URL. This will show you what’s actually being called in this case.
c) There’s a [tt]ToggleState[/tt] action in [tt]urn:micasaverde-com:serviceId:HaDevice1[/tt]
Unfortunately my Vera’s not up at the moment, but I was looking at the DSC Alarm code last night, and came across this:
http://code.mios.com/trac/mios_dscalarmpanel/browser/I_DscAlarmPanel2.xml#L406
Unfortunately there doesn’t appear to be a similar hookup in the .json file.
It would be a WAG, but you could try implementing this if the above tests fail (or if you just want to roll the dice ![]()
Just for closure, it’s (c). There’s a [tt]ToggleState[/tt] action that’s called from [tt]HaDevice1[/tt]