def __call__(self, device, deviceValue, deviceName): if deviceValue == 0: powered = "False" else: powered = "True" self.adress = 'http://' + self.plugin.host + '/zwave/setDeviceState?NODEID=' + device + '&Powered=' + powered + '&Level=' + str( deviceValue) + '&Password=' + self.plugin.password r = self.plugin.getCmd(self.adress) eg.StopMacro(ignoreReturn=False)
def __call__(self, scene): url = 'http://' + self.plugin.host + '/zwave/activateScene' payload = { "password": self.plugin.password, "sceneName": scene, "activate": 1 } send = self.plugin.putCmd(url, payload) eg.StopMacro(ignoreReturn=True)
def __call__(self, device, deviceName): url = 'http://' + self.plugin.host + '/zwave/setDevicePower' payload = { "password": self.plugin.password, "deviceId": device, "powered": "false" } send = self.plugin.putCmd(url, payload) eg.StopMacro(ignoreReturn=True)
def __call__(self, device, deviceName): url = 'http://' + self.plugin.host + '/zwave/setDevicePower' cmd = self.plugin.getDevices() state = self.plugin.outletdict[deviceName]['value'] if state == "255": powered = "false" else: powered = "true" payload = { "password": self.plugin.password, "deviceId": device, "powered": powered } send = self.plugin.putCmd(url, payload) eg.StopMacro(ignoreReturn=True)