1) Try to manually delete the 'WC' key from registry and try again
2) Or change the code in the script as below (I'm not sure it will help)
Code: Select all
res = eg.plugins.System.RegistryQuery(const1, const2+var1, const3, int(var2), const4)
Code: Select all
res = eg.plugins.System.RegistryQuery(const1, const2+var1, const3, int(var2), const4)
is expecting a stringnewValue = eg.ParseString(newValue)
Code: Select all
def SetReg(var1, var2):
const1 = 2147483649L
const2 = u'Software\\Automatisering\\Styring av ovner\\'
const3 = u'Modus'
res = eg.plugins.System.RegistryChange(const1, const2+var1, const3, 0, None, var2)
return res
def GetReg(var1, var2):
const1 = 2147483649L
const2 = u'Software\\Automatisering\\Styring av ovner\\'
const3 = u'Modus'
const4 = u''
res = eg.plugins.System.RegistryQuery(const1, const2+var1, const3, var2, const4)
return res
myRes = SetReg(u'WC',u'3')
print myRes
myRes = GetReg(u'WC',1)
print myRes
Code: Select all
def SetReg(var1, var2):
const1 = 2147483649L
const2 = u'Software\\Automatisering\\Styring av ovner\\'
const3 = u'Modus'
res = eg.plugins.System.RegistryChange(const1, const2+var1, const3, 0, None, var2)
return res
def GetReg(var1, var2):
const1 = 2147483649L
const2 = u'Software\\Automatisering\\Styring av ovner\\'
const3 = 1
const4 = u''
res = eg.plugins.System.RegistryQuery(const1, const2+var1, var2, const3, const4)
return int(res)
myRes = SetReg(u'WC',u'3')
#print myRes
myRes = GetReg(u'WC',u'Modus')
print myRes
Code: Select all
eg.globals.SetReg = SetReg
eg.globals.GetReg = GetReg
Code: Select all
myRes = eg.globals.SetReg(u'WC',u'3')Code: Select all
myRes = eg.globals.GetReg(u'WC',u'Modus')Code: Select all
myRes = eg.globals.GetReg(u'WC',u'Modus')
print myRes+100Correct, it will run sequentially and RFXtrx will not provide two events at exactly the same time, there will be at least a small time diff in between which means that your script will run once for every event. If it is a very heavy script, it could be good to think twice about having everything in one or keep them splitted. I have had very big scripts running without a problem.EG does run everything sequentially, right? So if two temps comes from the RFXtrx at the same time it won't mess up the script by running anything at the same time?
Code: Select all
if eg.event.payload[0] = 4337:
Rom = WC
if eg.event.payload[0] = 13312:
Rom = GjesteromAnd then I get WC instead of 4337 as the output.Rom = eg.event.payload[0]
Print Rom
Code: Select all
conv_table = {4337:"WC", 13312:"Gjesterom"}
Rom = conv_table[eg.event.payload[0]]Code: Select all
Sensor = eg.eventString.split(' ')
VikingID = [Sensor[4]]Code: Select all
my_data = eg.event.payload_copy.split(' ')
rom_temp = my_data[2] #temperature
rom_signal = my_data[6] #signalCode: Select all
RFXtrx.Type: Viking 02811 id: 32768Code: Select all
[u'RFXtrx.Type:', u'Viking', u'02811', u'id:', u'13312']In the example above, we need first to understand what data types we have and then what operations we are applying. Your event string looks something like this:Sensor = eg.eventString.split(' ')
VikingID = [Sensor[4]]
Code: Select all
RFXtrx.Type: Viking 02811 id: 32768Code: Select all
[u'RFXtrx.Type:', u'Viking', u'02811', u'id:', u'32768']you get what you ask forSensor = eg.eventString.split(' ')
VikingID = [Sensor[4]]
Sensor = eg.eventString.split(' ')
VikingID = Sensor[4]
#or if you want an int
VikingID = int(Sensor[4])