[SOLVED] Dummy Switch SendCommand

Hello me again :slight_smile:
My work of inclusion finish, my things, my items and sitemaps done now the rules.

I’m block with the updating of a virtual switch

My rule


when
    Item Salon_Motion changed from OFF to ON
then
	Reveil.SendCommand(ON)
...

My error

The method SendCommand(OnOffType) is undefined for the type SwitchItem

My item simple :
Switch Reveil

And I have also a another question, what the best practice:
Multiple files rules, or just one for all ?

tHX

AutoSolve : postUpdate(Reveil, ON)

Reveil.postUpdate(ON) is the recommended syntax
If Reveil is a Switch item then Reveil.sendCommand(ON) should work

You can have multiple. As your rules develop in number, you’ll probably find it easier to manage if you split them by function e.g. lighting.rules. alarm.rules

1 Like