[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
Re: Floorplan Sripting Help
NightMode script doesn't run. Log returns:
02/11/2006 21:30:57 Not matched
02/11/2006 21:30:57 AlarmState is -mode: security off, user 1-
02/11/2006 21:30:57 Starting
max
James Traynor wrote:
>
> Hi,
>
> The debug window shows the last error that has occurred, the only
> thing that clears it, other than a restart, is a new error message. It
> would be very hard to debug things if it did clear everytime a script
> ran as there could be quite a lot of scripts running at once a heavily
> used Floorplan.
>
> Try this script:
>
> Sub Main()
> x=xap.LogDebug("Starting")
>
AlarmState=xap.GetText("mi4.homeseer.server.93:comfortplugin.modedesc")
> x=xap.LogDebug("AlarmState is -" & AlarmState &
"-")
>
> if AlarmState = "Mode: security off, user 1" then
> x=xap.LogDebug("Matched")
> xap.ScriptRun "NightMode"
> else
> x=xap.LogDebug("Not matched")
> end if
>
> End Sub
> noting the space between ScriptRun and "NightMode"
> Run the script and look at the script debug log especially the line
> that says
> AlarmState is -Mode: security off, user 1-
> What i am wondering is that there may be a space before or after the
> data, hence adding the -- to highlight it.
> If you mail back with what the log says, as this should at least
> highlight where the issue is.
> Thanks
> James
>
> max wrote:
>> Found a bug I think, the error persisted with and without the
quotes,
>> didn't clear until I restarted Floorplan. Is the debug not
refreshing,
>> or holding onto the original, unmodified script?
>>
>> Still having a problem with the script, using your corrections
>>
>> Sub Main()
>> '
>>
AlarmState=xap.GetText("mi4.homeseer.server.93:comfortplugin.modedesc")
>> if AlarmState = "Mode: security off, user 1" then
>> xap.ScriptRun"NightMode"
>> else
>> end if
>> '
>> End Sub
>> The script runs through debugger with no errors, but doesn't run
the
>> script when AlarnState is correct. I've tried changing
xap.ScriptRun to
>>
x=xap.SendBSCState("ersp.x10.server:loungelamp","off")
as a test, and
>> that runs fine through debugger but doesn't appear to work either.
>>
>> Max
>>
>> Using
>> James Traynor wrote:
>>
>>> Hi,
>>> Could you check this line
>>>
>>>
AlarmState=xap.GetText("mi4.homeseer.server.93:comfortplugin.modedesc")
>>>
>>> as the error seems to show it without quotes:
>>>
>>>
AlarmState=xap.GetText(mi4.homeseer.server.93:comfortplugin.modedesc)
>>>
>>> with quotes being correct
>>> also
>>>
>>> xap.ScriptRun(NightMode)
>>>
>>> should be
>>>
>>> x=xap.ScriptRun("NightMode")
>>>
>>> as it is a function and returns data, also as you are passing
a string
>>> of text to the function that string needs to be in quotes.
Actually
>>> since you really dont want the data that it would return you
could just:
>>>
>>> xap.ScriptRun "NightMode"
>>>
>>> hth
>>>
>>> James
>>>
>>> max wrote:
>>>
>>>> I've have being trying to write Raw script to check the
alarm status of
>>>> Comfort and run an autoscript dependent on the outcome.
The autoscript
>>>> is working fine, but Scipt Debug gives the following
error:
>>>>
>>>> Script error : *AlarmStateChecking* : 01/11/2006 21:11:46
>>>> Line : 11
>>>> Error Text :
>>>>
AlarmState=xap.GetText(mi4.homeseer.server.93:comfortplugin.modedesc)
>>>> Error Description :Expected ')'
>>>>
>>>> Here is my raw script:
>>>>
>>>> Sub Main()
>>>> '
>>>> ' gets alarm state, runs NightMode script if security is
off
>>>> '
>>>> '
>>>>
AlarmState=xap.GetText("mi4.homeseer.server.93:comfortplugin.modedesc")
>>>> '
>>>> if AlarmState = "Mode: security off, user 1"
then
>>>> '
>>>> xap.ScriptRun(NightMode)
>>>> else
>>>> end if
>>>> '
>>>> End Sub
>>>>
>>>> My scripting experience is next to none, but I just can't
see where I'm
>>>> going wrong with this one.
>>>>
>>>> Max
>>>>
>>>>
>>>>
>
xAP_Automation Main Index |
xAP_Automation Thread Index |
xAP_Automation Home |
Archives Home
|