Adding string commands in rule engine

Hi i have recently started moving my home automation all over to sharp tools. I was wondering how to set up string commands to turn my lights on at certain times to a specific colour and brightness? i have tried setting the action to colour, picked the colour and added a string command of turn on, with a number command for the brightness. This didnt work so tried an action to turn on then a separate action for colour with a number command for brightness but they dont seem to work either. I have had it set up previously in smartthings but want to use to presence option in sharp tools so it only happens when we are home.

Welcome to the community and thanks for posting, @Shane_Dorey!

Can you share a screenshot of what you’ve tried so far in your rule? Also, what type of lights are these? Some lights accept a ‘level’ parameter when setting the color whereas with most lights you’ll have to use a separate setLevel() command to change the dim level.

For example, in the following rule I set the color to the desired color then separately set the level to the desired level:


This is what I have set up so far. I have one with the presence reversed too. So basically want it at 9pm if myself of my girlfriend are home the living room and dining room lights will change to 30% and 40% and change to the colour specified. Also turn on if not on already

1 Like

Thanks for sharing the screenshots! Am I understanding correctly that you’ve used the Advanced switch and customized the setColor command to add an additional argument?

Adding arbitrary arguments to a command won’t work unless the device handler explicitly allows those additional arguments. By default, the Rule Engine will expose the arguments that the device handler reports it needs. (Though occasionally, devices report that they need a wrong set of arguments)

In the case of setColor, generally you can only send a single argument which is a special Color Map type.

If you also want to change the level, it’s probably easiest to just add a second command (Action) as shown in the screenshot in my post above.

1 Like

yes that is correct. I have set one up which I will test tonight that has each common now seperate. a seperate on to turn on, a seperate one to change colour, and a seperate on to set brightness. Hopefully this sorts it out. Thanks!

Glad we could help! One other thing you might test is if the on() command is even needed. A lot of lights will automatically turn on when the level is adjusted.

thanks mate I will have a look at that too