I wrote a plugin and I cannot get events in the plugin to trigger commands in scenes. So, I must have missed to place code somewhere. I am looking for a tutorial (or howto) to see where my error is (So far I tried to learn from looking at other plugins how this is done but I must miss a critical part).
The .json file contains the sceneList and eventList sections
The S_ file contains the stateVariables involved
I can specify events from this plugin in scenes (all the information for this seems to be there)
the plugin works fine, it just does not trigger commands in the scenes.
In the logfile I cannot see any error (or evidence anything is triggered)
What am I missing?
The plugin is a simple switch controlled by Google Calendar (you can use entries in Google Calendar to trigger the switch). I want to use this to control my central heating (more precise to allow my wife to define heating periods without having to deal with the vera interface).
Why dont you post the plugin here so we can help test it.
Also it would be easier for those who know how to write plugins to look at your code and try and help out!
Sounds like an interesting plugin to me as i use Google Calendar already…
Henk
[quote=“utz, post:1, topic:168992”]I wrote a plugin and I cannot get events in the plugin to trigger commands in scenes. So, I must have missed to place code somewhere. I am looking for a tutorial (or howto) to see where my error is (So far I tried to learn from looking at other plugins how this is done but I must miss a critical part).
The .json file contains the sceneList and eventList sections
The S_ file contains the stateVariables involved
I can specify events from this plugin in scenes (all the information for this seems to be there)
the plugin works fine, it just does not trigger commands in the scenes.
In the logfile I cannot see any error (or evidence anything is triggered)
What am I missing?
The plugin is a simple switch controlled by Google Calendar (you can use entries in Google Calendar to trigger the switch). I want to use this to control my central heating (more precise to allow my wife to define heating periods without having to deal with the vera interface).[/quote]
I did not post it yet because my code is a mess at the moment (ill put it here as soon as I can). I am also at work and dont have it here. I just dont expect others to look through my code and find an error ; just thought there might be documentation to learn how to do it right (is a bit trial and error at present)
[ul][li]Forgetting to specify the DeviceType in the Static JSON file (D_.json). [/li]
[li]Non-matching DeviceType in Static JSON (D_.json) and deviceType in XML (D_*.xml). Case matters.[/li]
[li]Non-matching serviceId in XML and Static JSON. Case matters.[/li]
[li]Using a service or device type instead of a service or device id. They look deceptively similar, and case matters.[/li]
[li]Setting the wrong variable in Lua code, so that it doesn’t match the one in the Static JSON.[/li][/ul]
or should I make them all “urn:schemas-micasaverde-com:”?
In general, what is the naming convention here (or is there none and it needs to be just a unique name)?
and:
<stateVariable allowRepeats="yes">
<name>Tripped</name>
<sendEventsAttribute>yes</sendEventsAttribute>
<dataType>boolean</dataType>
<shortCode>tripped</shortCode>
</stateVariable>
… does that mean the variable “tripped” is the same as “Tripped” everywhere
It needs to be unique, that’s all. Convention is that you stick something that you own at the beginning (such as a string based on a domain), and that if everyone does that, there won’t be any collisions. So technically you shouldn’t be using “micasaverde-com” or “upnp-org”, unless you work for those companies. But it’s only a convention.
[code]
Tripped
yes
boolean
tripped
[/code]
... does that mean the variable "tripped" is the same as "Tripped" everywhere
I never found out what does. Pretend it’s not there, and use capital-T Tripped everywhere.