Google Calendar Scheduler send string

Hi,

in the docu (https://github.com/openhab/openhab1-addons/wiki/Google-Calendar-Scheduler) there is a descrition how to send ON/OFF to a item:

start {
  send|update <item> <state>
}
end {
  send|update <item> <state>
}

It it possible to send a string to a item?

**items:**
String TEXTNACHRICHT 

like:

start {
  send TEXTNACHRICHT "!!birthday!!" 
}

regards dimes

That should work without issues as far as I know.

it works! (without start{…)
only the send command:

send TEXTNACHRICHT "!!birthday!!" 

Looking at the wiki, it says you must use this construct:

start {
  send|update <item> <state>
}
end {
  send|update <item> <state>
}

or this construct:

send|update <item> <state>

The pattern used to match the calendar content seems to confirm that you must have both start and end clauses.

private static final Pattern EXTRACT_STARTEND_CONTENT = Pattern
            .compile("start\\s*?\\{(.*?)\\}\\s*end\\s*?\\{(.*?)\\}\\s*", Pattern.DOTALL);

@watou Am I reading this correctly?

No. :smile: It should work as documented in the wiki page.

The whole code here shows that if the start/end construct isn’t matched, then parse the content as start commands.

Right. So the construct in the original post (just the start clause) won’t match the start/end pattern, and will be treated as a command, which will not execute because it’s not a command (i.e. it’s a start clause containing a command).

Oh gosh, Mark, I was dead wrong in my assessment when I said “That should work without issues as far as I know.” It is not legal to only have the start block without the end block, just as the wiki page says it’s not legal.

I’m sorry that my probable haste (or dirty :eyeglasses:) led me to give false assurance, contrary to the correct documentation of the wiki page.

No worries. :wink:

It actually looks like a standalone start clause (without end clause) could be added pretty easily, which would eliminate the issue the OP experienced (although it looks like a warning would’ve been logged when the command failed to execute).

Could that be addressed by somehow improving the wiki page?

Yes, and I would be happy to make some edits to clarify. :wink: