Förstår inte vad felet beror på...?
Skickar även över mitt script...
Code: Select all
try:
dummy
#print systemState
except NameError:
dummy = 0
systemState = [0, 0, 0, 0, 0, 0] #initierar status för datakällorna
#sätter status för datakällorna
if eg.event.string.find('house:13619034;unit:10;group:0;method:turnon')>0:
systemState[0] = 1 #RV Trappa
if eg.event.string.find('OffDelay.RV Stairs Off')>0:
systemState[0] = 0 #RV Trappa
if eg.event.string.find('house:15418338;unit:10;group:0;method:turnon')>0:
systemState[1] = 1 #RV Kök
if eg.event.string.find('OffDelay.RV Kitchen Off')>0:
systemState[1] = 0 #RV Kök
if eg.event.string.find('house:15663946;unit:10;group:0;method:turnon')>0:
systemState[2] = 1 #RV Vardagsrum
if eg.event.string.find('OffDelay.RV Livingroom Off')>0:
systemState[2] = 0 #RV Vardagsrum
if eg.event.string.find('house:15281850;unit:10;group:0;method:turnon')>0:
systemState[3] = 1 #RV Toalett
if eg.event.string.find('OffDelay.RV Toilet Off')>0:
systemState[3] = 0 #RV Toalett
if eg.event.string.find('house:13545650;unit:2;group:0;method:turnon')>0:
systemState[4] = 1 #LARM
if eg.event.string.find('house:13545650;unit:2;group:0;method:turnoff')>0:
systemState[4] = 0 #LARM
if eg.event.string.find('OnDelay.Larm On')>0:
systemState[5] = 1 #LARM EG
if eg.event.string.find('OffDelay.Larm Off')>0:
systemState[5] = 0 #LARM EG
if eg.event.string.find('house:15630902;unit:10;group:0;method:turnon')>0:
systemState[6] = 1 #SOVRUMSDÖRR
if eg.event.string.find('house:15630902;unit:10;group:0;method:turnoff')>0:
systemState[6] = 0 #SOVRUMSDÖRR
#utvärderar systemstatus och sätter datakälla i SK
#print systemState
if (systemState[0] == 0 and systemState[1] == 0 and systemState[2] == 0 and systemState[3] == 0 and systemState[4] == 1 and systemState[5] == 0 and systemState[6] == 1):
eg.plugins.SwitchkingTellStick.DSSet(u'Scenario BORTA: TurnOn', u'Scenario BORTA', u'TurnOn', 7)
if (systemState[0] == 1 and systemState[4] == 0):
eg.plugins.SwitchkingTellStick.DSSet(u'Scenario BORTA: TurnOff', u'Scenario BORTA', u'TurnOff', 7)