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.
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.
Boolean → True → Set switch to ON.
Boolean → False → Set switch to OFF.
Boolean → 0 → Set switch to OFF.
Boolean → 1 → Set switch to ON.
Set the switch to the ON state.
self.force.sendMessage("Jordan's iPhone", "lightSwitch", True)
The following is what data is sent from this tile to the server/your script. It is in the format:
Action → Data Type → Value
Switch ON → Boolean → True
Switch OFF → Boolean → False
Note that a tile's tag is always sent to the server for identification purposes.
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()