Gestures with HS-WD200+
James Sentman
james at sentman.com
Tue Apr 16 12:15:26 EDT 2019
> On Apr 15, 2019, at 8:04 PM, Tom Yarmas <tom at yarmas.com> wrote:
>
> Trying to get the central scene scripting to work with these HomeSeer switches.
>
> If I put the following in the on script, it works and gives me the proper log message:
> on centralScene( theButton, theGesture)
> write log “central scene processing for “ & thisUnit & “ theButton=“ & theButton & “ theGesture=“ & theGesture
> end centralScene
> However, when I put the more complex example in the on script, it seems to ignore it.
>
> I put this in the on script:
> on centralScene(theButton, theGesture)
> if theButton is equal to 1 then
For some odd reason that I don’t have a handle on yet, theButton value is sometimes sent as a string instead of a number, so you can’t compare it to a number. You can try doing this:
if theButton is equal to “1” then
and that will probably catch it, after you’ve verified that works I would actually do it like this:
if (theButton as number) is equal to 1 then
which will work in the future after I figure out why that is happening and fix it.
>
>
> Also, am I correct that I do not need to trap a single click with the centralScene handler? So I would want the normal on script stuff to follow the end of the centralScene part?
The on/off script will run normally with the reception of a single click, so you can just put your code there. However, they may be called more than once if the ramp rate is long enough that the Vera reports an interim value between the on and off. If you wish to have other things controlled by a single click of the paddle it would be better to put it into the centralScene handler unless it doesn’t matter if it’s triggered more than once.
Thanks,
James
James Sentman http://www.PlanetaryGear.org http://MacHomeAutomation.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20190416/0a2f26ce/attachment.html>
More information about the XTensionList
mailing list