radinsky / broadlink-http-rest

Broadlink RM/RM2/RM Pro/RM3/BlackBean/A1 Web server with REST API (like..)
MIT License
156 stars 47 forks source link

Could you please provide an example of how to make a simple Macro Command? #20

Closed kevinshane closed 6 years ago

kevinshane commented 6 years ago

Hey all gurus, pretty noob here, please help! Based for the readme

Added simple Macro language Any Command can start with the word MACRO followed by a list of other commands. Each command will be done in order. You may repeat a command (useful for navigating menus) by putting a comma followed a repeat count after the command. For example, "right,5" will send the "right" command 5 time. You can use also use "sleep1", "sleep2", "sleep3", etc. to insert a pause. In this case, a comma is optional.

Could you please show an example of how to make a macro command? It confused me a bit. I would like to open the curtain for about 10 seconds and send a stop curtain command, I've already learn the curtainopen and curtainstop, and where to "put" those macro with what syntax? I try this code but looks like it won't work:

test = MACRO curtainopen,1 sleep10 curtainstop,1

Please help, thanks!

radinsky commented 6 years ago

@uudruid74 Can you please provide a working macro command example? Thanks!

uudruid74 commented 6 years ago

Sorry I didn't see this before.

test = MACRO curtainopen sleep10 curtainstop

That should do the trick. After that sendCommand/test will perform the macro