Page 33 of 36
Re: RFXtrx
Posted: Wed Oct 07, 2015 6:01 am
by krambriw
Should be up now
Re: RFXtrx
Posted: Wed Oct 07, 2015 9:03 am
by _RIGHT_H
Thank you so much
Re: RFXtrx
Posted: Tue Oct 13, 2015 1:09 pm
by _RIGHT_H
i have been using this plugin for few days with many LightwaveRF sockets ,sensors , remotes and switches and it has been working PERFECTLY so far.
Re: RFXtrx
Posted: Tue Oct 13, 2015 3:02 pm
by krambriw
LightwaveRF
Thank you for this feedback! It is always nice to hear such things, especially since I had no LightwaveRF products available while developing
BR Walter
Re: RFXtrx
Posted: Mon Nov 23, 2015 1:28 pm
by Mastiff
Back again, Walter! I won't tell you details, but this fall will from now on be considered "the lost fall".

Finally I can get my head above water again and start messing around a little bit. So I have (almost) found a way to do what I want with the new sensors, partly based on your suggestions. First of all I have used only "RFXtrx.*" as the trigger in my main temperature control script (which btw still is working perfectly, turning on and off heaters from the sensor). Then I do a couple of lines that checks if it's a Viking sensor or other kind of temp sensor. If it isn't, it just goes eg.Exit() Next step is conversion of the sensor's ID:
Code: Select all
if (eg.eventString.split(' ')[1]) == "Viking":
Rom = eg.globals.Romkonvertering[int(eg.eventString.split(' ')[4])]
else:
print("Dette er ikke en Viking-sensor")
eg.Exit()
Romkonvertering is a lookup to a table (only showing the start of it):
Code: Select all
eg.globals.Romkonvertering = {
43008:"1",
51200:"2",
43776:"3",
57088:"4",
}
Now that's where I am trying to put in the search for new sensors. My plan was to use this code to show a new sensor (usually an old sensor that has new batteries) like this, with the sensor number being what's split out of the event string:
Code: Select all
if not Rom:
print("***********************************")
print("Dette er en ny Viking-sensor:")
print("***********************************")
print (eg.eventString.split(' ')[4])
print("***********************************")
eg.Exit()
The problem is that it errors out before it comes to that. Not so surprising, since it can't do the conversion when there's no corresponding entry in the table:
Code: Select all
14:17:40 Traceback (most recent call last):
14:17:40 Python script "56", line 5, in <module>
14:17:40 Rom = eg.globals.Romkonvertering[int(eg.eventString.split(' ')[4])]
14:17:40 KeyError: 26368
Is there an Err or something (that's LUA) that I can use to avoid that?
Re: RFXtrx
Posted: Mon Nov 23, 2015 4:49 pm
by krambriw
Hey, nice to see you back again!
For the script, I have two variants you could try. The first is a bit rough using try/except statements
Code: Select all
try:
Rom = eg.globals.Romkonvertering[int(eg.eventString.split(' ')[4])]
except:
print("***********************************")
print("Dette er en ny Viking-sensor:")
print("***********************************")
print (eg.eventString.split(' ')[4])
print("***********************************")
eg.Exit()
The second is maybe more elegant and does not cause any exception
Code: Select all
key = int(eg.eventString.split(' ')[4])
Rom = ""
if key in eg.globals.Romkonvertering:
Rom = eg.globals.Romkonvertering[key]
else:
print("***********************************")
print("Dette er en ny Viking-sensor:")
print("***********************************")
print (key)
print("***********************************")
eg.Exit()
Re: RFXtrx
Posted: Mon Nov 23, 2015 5:21 pm
by Mastiff
Thank you master! (It just sounded very appropriate in these days, even though I'm not going to the theater, I'll wait until the Force is on Blu-ray, I tend to get rather pissed on kids yapping and using their phones during the show!) I adjusted the asterixes to make it look a bit better (had to convert the integer to string to be able to print it with asterixes on each side, since it refused to concatenate a string and an integer), and here's the result:
Code: Select all
18:20:52 ********************************
18:20:52 **Dette er en ny Viking-sensor**
18:20:52 ********************************
18:20:52 ************ 26368 *************
18:20:52 ********************************
So it should be no problem finding the new sensor and get it into the translation table now!
Re: RFXtrx
Posted: Mon Nov 23, 2015 5:27 pm
by krambriw
Very good!
Should be useful for all kind of devices changing id's randomly after battery replacement
Best regards
Re: RFXtrx
Posted: Mon Nov 23, 2015 5:39 pm
by Mastiff
Yeah, I can imagine. I ran into a little snag, merging the code with my own code, though. The result I showed was from the test script:
Code: Select all
key = int(eg.eventString.split(' ')[4])
Rom = ""
if key in eg.globals.Romkonvertering:
Rom = eg.globals.Romkonvertering[key]
print (Rom)
else:
print('**********************************')
print("**Dette er en ny Viking-sensor**")
print('**********************************')
print('************* '+str(key)+' *************')
print('**********************************')
eg.Exit()
But when I tried to merge it, I must have made a mistake somewhere, because it still runs my other rooms, but it doesn't show the new sensor:
Code: Select all
#Sjekke om det er en Viking-sensor
if (eg.eventString.split(' ')[1]) == "Viking":
#Finne rommet sensoren kommer fra ved hjelp av tabellen i oppstartsskriptet
key = int(eg.eventString.split(' ')[4])
Rom = ""
print("Dette er en Viking-sensor")
#Sjekke om det er en sensor som står i listen
if key in eg.globals.Romkonvertering:
Rom = eg.globals.Romkonvertering[key]
print (Rom)
#Skille ut temperatur og signal fra payload
eg.globals.Romtemperatur[Rom] = float((eg.event.payload.split(' ')[2]))
eg.globals.Signal[Rom] = (eg.event.payload.split(' ')[6])
#Hvis det ikke er en sensor som står i listen:
else:
print('**********************************')
print("**Dette er en ny Viking-sensor**")
print('**********************************')
print('************* '+str(key)+' *************')
print('**********************************')
eg.Exit()
Any idea why it just doesn't use that else when there is no corresponding "Rom" ?
Re: RFXtrx
Posted: Mon Nov 23, 2015 6:01 pm
by Mastiff
Re: RFXtrx
Posted: Mon Nov 23, 2015 6:20 pm
by Mastiff
So next problem is that I have room numbers for the rooms and names for the other stuff, which makes it hard to separate. So I guess I'll have to change that and go for a series of numbers for those as well, probably starting at 20, just to have extra space between 13 and 20 for other rooms that may be controlled later. I have found code I can use to see what part of the script that should be run, if it's the temperature control or the alarm part (too hot in the freezer and stuff like that):
But that of course errors out on the stuff that has names. Well, then I have something to do the coming weekend too!

Re: RFXtrx
Posted: Mon Nov 23, 2015 6:35 pm
by Mastiff
New version, this only errors out on the two rooms that are rooms, but not controlled (bathroom and the kitchen, where the heat pump is working):
Code: Select all
try:
romsjekk = int(Rom)
except ValueError:
print("Dette er ikke et rom som styres")
eg.Exit()
Re: RFXtrx
Posted: Sun Jan 31, 2016 9:02 am
by Mastiff
Hi! I upgraded to the latest version of the firmware, but suddenly discovered that it's not supported in the plug-in.

Will you have support for the latest version soon? Please?
Edit: I downgraded to version 91 that should be supported by your latest plug-in version, but it didn't work either, at least at the first few attempts. Working on it...
Edit 2: Got it working again. Helped to plug out the cable so there was no power to the RFX (it still had power from an USB hub even when the pc was off).
Edit 3: I found out that it doesn't work with the new Viking 02813 sensors that have taken over for the previous version 02811. The Tellstick does, but not the RFX. I have mailed RFX support about that. I hope it's easy to fix, it's still the same protocol, only a variant. Undecoded messages in the RFXmanager sees the new sensors as what they are, Fine Offset.
Re: RFXtrx
Posted: Wed Feb 03, 2016 8:05 am
by Mastiff
I have now sendt a sensor to Bert, so hopefully he can get it working with the RFXtrx433, even with the changes Viking obviously have made on this version. Strange thing is that it seems like it sends only on changes in temperature, and not with a set interval, at least that's what it seems like for me. Maybe a way to save batteries? Anyway, for my part there's no rush to make a new version before there's a firmware that supports the new Viking, if possible.
Re: RFXtrx
Posted: Sat Feb 06, 2016 5:02 pm
by Mastiff
(Quote from Net Home Server thread)
krambriw wrote:Could you please have a look and see if you can update the RFX plug-in?
I have just this morning received a new sdk from Bert (that is necessary to have to update the plugin) but the Viking 02813 is not in there yet
BR
Very weird. I would think it should have been part of it if you got it today. I got firmware 95 this morning, and Bert said that he had incorporated the Viking 02813. But I saw a log he sendt me, and that showed the sensor as a 02811. So maybe it's in there? Or did he say that it wasn't a part of it?