Documentation

Toggle Menu

Switch

The switch is a simple tile which is best used for on/off functions.

Settings

Tag

This is a unique String ID assigned to this tile and is used (by you) to identify what tile sent what data by your script.
Note that this is case sensitive, and cannot contain any white space.

Input

This tile accepts input so you can use the send message function built into the server to send a value to this tile. This tile only accepts Boolean. If you send False, the switch will set to OFF and vice versa.

  • BooleanTrue → Set switch to ON.

  • BooleanFalse → Set switch to OFF.

  • Boolean0 → Set switch to OFF.

  • Boolean1 → Set switch to ON.

Usage Demo

Set the switch to the ON state.

                            self.force.sendMessage("Jordan's iPhone", "lightSwitch", True)
                            

Output

The following is what data is sent from this tile to the server/your script. It is in the format:
Action → Data TypeValue

  • Switch ON → BooleanTrue

  • Switch OFF → BooleanFalse

Note that a tile's tag is always sent to the server for identification purposes.

Usage Demo

Toggle the state of lights according to the input from the switch tile.

                            def forceServerDidReceiveData(self, deviceName, senderTag, data):
                                if senderTag == "lightSwitch":
                                    if data:
                                        self.lightsOn()
                                    else:
                                        self.lightsOff()