Handleiding Scripts - aanvulling

Johan Swinnen
Johan Swinnen Specialist
November 2016 aangepast in Native scripts
Hoi
Heeft iemand een up-to-date handleiding met de mogelijkheden bij SCRIPTS.
De laatste tijd zijn er veel opties bijgekomen (zeker voor de beta firmware).
Ik krijg steeds netjes de updates van Harm, maar ik weet niet zeker of ik per ongeluk misschien wat mails heb verwijderd.
Alvast bedankt
Johan

Reacties

  • Harm Elzinga
    Harm Elzinga Administrator
    Beste Johan,

    Hieronder een lijst met de functies en opdrachten die niet in de handleiding staan. De meeste hiervan zijn nog in beta, vandaar dat ze nog niet in de handleiding staan. We zullen deze binnenkort updaten. De beschrijving hieronder is in het Engels, vertaling volgt in de vernieuwde handleiding.

    Commands:
    CALL [alert] INCLUDE [camera]
    CALL [alert] INCLUDE [camera] WITH [value]
    MAKE SNAPSHOT [camera]

    This allows you to create snapshot from a script and optionally include the snapshot in an alert call.

    SET PRESENCE SIMULATION TO ...
    This allows control of the presence simulation from within scripts, possible actions are: PLAY, RECORD, STOP

    Functions:

    CONCAT("abc", "def", ....)

    Concatenates texts together, for example: CONCAT("abc", "def", "ghi") results into "abcdefghi"


    FORMAT(format, parameters....)

    With this function text can formatted, the format parameter describes how, the following parameters can be used in this format.
    Normal text in the format parameter will be copied to the result, there are some special format options you can use:

    - use %s to include another text into the text, for example: FORMAT("Now it is %s.", "dry") results into "Now it is dry."
    - use %d to include an integer value in the text, for example: FORMAT("At this moment it is %d degrees.", 10) results into "At this moment it is 10 degrees."
    - use %f to include a floating point value in the text, for example: FORMAT("At this moment it is %f degrees.", 10.12345) geeft "At this moment it is 10.12345 degrees."
    %f can be used with a decimal precision, use %.xd in the format parameter where x is the number of decimals.
    for example: FORMAT("At this moment it is %.2f degrees.", 10.12345) results into "At this moment it is 10.12 degrees."
    - use %% to display a % symbol, for example: FORMAT("The livingroom window is now %d%% closed.", 10) results into "The livingroom window is now 10% closed."


    SUBSTR(text, startindex)
    SUBSTR(text, startindex, length)

    You can subtract a portion of a text with this function. The startindex starts at 0 !
    Without the length parameter, the function returns with the text will the end of the text.

    For example: SUBSTR("abcdef", 3) results into "def"
    For example: SUBSTR("abcdef", 3, 1) results into "d"


    STRLEN(text)

    This function returns the length of the text given, for example STRLEN("abcdef") results into 6


    new text operator "."

    This operator can be used to concatenate texts, for example: "abc"."def"."ghi" results into "abcdefghi"