Announcement

Collapse
No announcement yet.

Callback Trigger

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Callback Trigger

    Hi Guys,

    This is just an understanding question, but I was having a read through the example / sample plugin, and note that it presents the precheck trigger function, as well as a callback trigger function.

    Am i correct in thinking that the purpose of the callback trigger is to allow a plugin to submit an action, that it causes (or detects) to homeseer, so that homeseer can then determine which (if any) events trigger on that action (or detection) from the initial plugin.

    So in my example, if my plugin were listening to sockets and detected an OnPlay, i would potentially be passing through

    "XBMC_PI" & Chr(2) & "PlayerAction" & Chr(2) & "Master Bedroom" & Chr(2) & "OnPlay" & Chr(2) & �*�

    This would then cause homeseer to search through events that were set that have the trigger as being the XBMC_PI, the TriggerName being PlayerAction, and the paramaters (for that trigger) being Master Bedroom, and OnPlay?



    In terms of the prechecktrigger, is there much value in using that when values are not specifically used, e.g. most of my triggers would be around OnPlay, OnPause, OnStop, OnScreenSaverActivate,OnScreenSaverDeactivate,OnOnline,OnOff line


    Thanks Guys
    HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

    Facebook | Twitter | Flickr | Google+ | Website | YouTube

    #2
    The callback triggers still are a bit of a mystery to me but I use the precheck trigger for comparing values. This is my understanding:

    An alarm could be ringing or not ringing (limited number of states), the .checktrigger is used for devices that have a defined number of states. .prechecktrigger is used when you want to check whether there are any events which match the sort of idea what your trigger is set to and the value you are checking could be any number of possible values.

    Device 1 greater than 1.21 gigawatts

    Call .prechecktrigger with "Device 1 (y) than (x) gigawatts" and it will reply with "Device 1 greater than 1.21 gigawatts". You then split this reply back up and test it again in vb code and then if that condition is then met then you make a further call with .checktrigger with "Device 1 greater than 1.21 gigawatts" and the event will fire correctly.

    That is the way I am doing things anyway.

    Comment

    Working...
    X