Page 20 of 36
Re: RFXtrx
Posted: Mon Nov 18, 2013 12:28 pm
by Pako
Mastiff wrote:Btw do you have any idea why I'm getting a line saying
when I start EventGhost? It has an exclamation mark in a yellow triangle, so I'm guessing it's a warning sign about something.
It does the Webserver plugin:

- PersVars.png (3.1 KiB) Viewed 7220 times
It shows the values ÔÇïÔÇïof persistent variables (for checking).
And as we can see, you do not use persistent variables.
Pako
Re: RFXtrx
Posted: Mon Nov 18, 2013 12:45 pm
by Mastiff
Aha! Thanks!

I thought it was an error, but it's only information, then.
Re: RFXtrx
Posted: Wed Nov 20, 2013 4:32 pm
by haklis
b_weijenberg wrote:Hakon, it seems the FTDI driver becomes frozen. This problem has been reported a very few times and was solved connecting the RFXtrx433 to a powered USB hub.
Sounds reasonable! I will try that and report back.
Hakon
Re: RFXtrx
Posted: Thu Dec 12, 2013 8:07 am
by krambriw
New version published in first post
Added support for
- RGB TRC02 controllers
Re: RFXtrx
Posted: Mon Dec 30, 2013 4:00 pm
by krambriw
I needed a new feature...
I figured out I got a problem when replacing all my remaining ARC devices into AC device types including existing ARC remote controls.
The web pages I built for my home automation is using web sockets and they were suddenly messed up.
This was due to the fact that each AC remote control has its own unique address and you can't change that. Without diving into the details, I thought it would be handy if it was somehow possible to map one or more remote control addresses into a single common one (so that a number of remotes could be used but the web page system would still see all of them just as one single remote). This would allow you to have a number of AC remotes with different addresses lying around but they would all just behave like clones...
So in the new version, published in the first post, there is a new action available called 'remote_address_Mapper'. The configuration view looks typically like this:
When you save the configuration, the mapping is added. From then on, when an event from an AC remote control with the originating address is incoming, it will be mapped to the replacement address when broad-casted via web sockets.
If you run the action, the designated mapping will be deleted.
I think the mapping will also work with other types of AC transmitting devices like push buttons, infrared and magnetic sensors but so far, I haven't tried that.
Enjoy and please report back if you find any issue/bug
Happy New Year,
Walter
Re: RFXtrx
Posted: Tue Jan 07, 2014 11:03 am
by bj├©rnhf
Hi.
Now i finally got my rfxtrx to make my system even better.Running Switchking and eventghost with duo and now rfxtrx.
evrything is working good with your duo and rfx plugin.nice.
But when i try to understand pyton scripts i meet my limitation.have been reading and trying lot of scripts without sucsess.
This is the Owl 160 power meter.
I am trying to get instant power and total usage to update 2 datasources in switchking called instant power and total power.
Any help would be much appriciated.
Code: Select all
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 3 Instant power usage: 2736.00 W Total energy usage: 383679.10 Wh signal: 6 battery: 9'
also trying to get readings from my rfxsensor type3 to update ds in switchking.
Code: Select all
RFXtrx.Type: RFXSensor temperature id: 7 ' temperature: +20.12 deg C signal: 8'
To use eventghost in a home automatin system i need to learn some basic phyton.where is a good place to start?
Re: RFXtrx
Posted: Tue Jan 07, 2014 12:39 pm
by Mastiff
bjørnhf wrote:To use eventghost in a home automatin system i need to learn some basic phyton.where is a good place to start?
Dyreparken i Kristiansand eller Akvariet i Bergen?

Re: RFXtrx
Posted: Tue Jan 07, 2014 2:02 pm
by krambriw
I assume you are friends all together...
You may in the mean time try the script below.
Pre-conditions:
- you have also added the Switchking plugin in EG
- you check the SK ds names in script below and in SK so that they are ok
- use a text editor when editing scripts, please never use tabs, use 4 spaces instead of one tab. I recommend Notpad++ (small changes can also easily be made directly in the script configuration dialog)
ToDo:
a) Create a macro for python script
b) Copy & Paste the script below or the one you have modified into the configuration dialog, click ok
c) Drag & drop the RFXtrx events for the OWL160 and the RFXSensor to the macro
d) Wait for the events and the SK ds should be updated if everything is correct
Code: Select all
def eventHandler(base, pload):
#Check if the event is from the OWL160
try:
if str(base).find('CM119/160 id: 56146') > -1 :
m = str(pload).split(' ') #Break up the string and create a list
W = str(m[6]) #Pick the list item holding the instant power usage
Wh = str(m[11]) #Pick the list item holding total energy usage
#print W
#print Wh
#Update data sources in SK riding on the SwitchKing plugin
eg.plugins.SwitchkingTellStick.DSSet(u'', u'instant power', W, 0)
eg.plugins.SwitchkingTellStick.DSSet(u'', u'total power', Wh, 0)
except:
pass
#Check if the event is from the RFXSensor
try:
if str(base).find('RFXSensor temperature id: 7') > -1 :
m = str(pload).split(' ')
tmp = str(m[2])
#print tmp
eg.plugins.SwitchkingTellStick.DSSet(u'', u'name of ds', tmp, 0)
except:
pass
#Execution starts here when script is triggered
eg.event.suffix_copy = eg.event.suffix
eg.event.payload_copy = eg.event.payload
#Now calling the defined function
eventHandler(eg.event.suffix_copy, eg.event.payload_copy)
Re: RFXtrx
Posted: Tue Jan 07, 2014 2:08 pm
by Mastiff
krambriw wrote:
I assume you are friends all together...
I may know him from another forum, but I'm not sure. Anyway, the name suggested that he was Norwegian, so I couldn't really pass off an opportunity to make one of my trademark bad jokes!

Re: RFXtrx
Posted: Tue Jan 07, 2014 6:06 pm
by bj├©rnhf
Hi.
thank you for trying to help.
Gets some errors trying the script.Error compiling script. seen this before when trying other scripts.
maybe you see whats wrong?
btw what do you mean with this: please never use tabs, use 4 spaces instead of one tab
Code: Select all
---> Welcome to EventGhost <---
Error compiling script.
Traceback (most recent call last) (1640):
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 121, in SetArguments
self.compiled = self.executable.Compile(*args)
File "C:\Program Files (x86)\EventGhost\plugins\EventGhost\PythonScript.py", line 71, in __init__
self.PrintTraceback()
File "C:\Program Files (x86)\EventGhost\plugins\EventGhost\PythonScript.py", line 97, in PrintTraceback
treeItem.PrintError("Traceback (most recent call last):")
AttributeError: 'NoneType' object has no attribute 'PrintError'
Autostart
Plugin: Switch King
Starting Switchking V0.1.0
Plugin: RFXtrx
Plugin: TellStickDuo
Loading library
Initiating TellStick Duo...
Starting TellStick Duo...
Interface mode: ['0d', '01', '00', '01', '02', '53', '47', '00', '0c', '2f', '01', '01', '00', '00']
RFXtrx Firmware Version: 71
RFXtrx receiver/transceiver type: 433.92MHz transceiver
You have a RFXtrx Type 1
Main.OnInit
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 3 Instant power usage: 1191.00 W Total energy usage: 400020.79 Wh signal: 7 battery: 9'
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 2 Instant power usage: 1191.00 W Total energy usage: 400024.76 Wh signal: 7 battery: 9'
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 0 Instant power usage: 2752.00 W Total energy usage: 400035.19 Wh signal: 6 battery: 9'
<unnamed macro>
Python Script
Error in Action: "Python Script"
Traceback (most recent call last) (1640):
TypeError: 'NoneType' object is not callable
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 4 Instant power usage: 2012.00 W Total energy usage: 400041.92 Wh signal: 6 battery: 9'
<unnamed macro>
Python Script
Error in Action: "Python Script"
Traceback (most recent call last) (1640):
TypeError: 'NoneType' object is not callable
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 3 Instant power usage: 2028.00 W Total energy usage: 400048.66 Wh signal: 6 battery: 9'
<unnamed macro>
Python Script
Error in Action: "Python Script"
Traceback (most recent call last) (1640):
TypeError: 'NoneType' object is not callable
RFXtrx.Type: RFXSensor temperature id: 8204 ' temperature: +32.87 deg C signal: 8'
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 2 Instant power usage: 2752.00 W Total energy usage: 400056.64 Wh signal: 6 battery: 9'
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 1 Instant power usage: 2012.00 W Total energy usage: 400064.00 Wh signal: 6 battery: 9'
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 0 Instant power usage: 2012.00 W Total energy usage: 400070.72 Wh signal: 6 battery: 9'
Error compiling script.
Traceback (most recent call last):
IndentationError: unexpected indent (1, line 2)
RFXtrx.Type: CM119/160 id: 56146 ' Counter: 3 Instant power usage: 1191.00 W Total energy usage: 400083.99 Wh signal: 6 battery: 9'
Code: Select all
def eventHandler(base, pload):
#Check if the event is from the OWL160
try:
if str(base).find('CM119/160 id: 56146') > -1 :
m = str(pload).split(' ') #Break up the string and create a list
W = str(m[6]) #Pick the list item holding the instant power usage
Wh = str(m[11]) #Pick the list item holding total energy usage
#print W
#print Wh
#Update data sources in SK riding on the SwitchKing plugin
eg.plugins.SwitchkingTellStick.DSSet(u'', u'instant power', W, 0)
eg.plugins.SwitchkingTellStick.DSSet(u'', u'total power', Wh, 0)
except:
pass
#Check if the event is from the RFXSensor
try:
if str(base).find('RFXSensor temperature id: 8204') > -1 :
m = str(pload).split(' ')
tmp = str(m[2])
#print tmp
eg.plugins.SwitchkingTellStick.DSSet(u'', u'rfxsensor', tmp, 0)
except:
pass
#Execution starts here when script is triggered
eg.event.suffix_copy = eg.event.suffix
eg.event.payload_copy = eg.event.payload
#Now calling the defined function
eventHandler(eg.event.suffix_copy, eg.event.payload_copy)
Re: RFXtrx
Posted: Tue Jan 07, 2014 7:07 pm
by krambriw
Well a space and tab are keys on your keyboard...
I don't know how to explain this but it is all about indents. Python is very sensitive to indentation errors.
You can clearly see it in the error message you got:
Traceback (most recent call last):
IndentationError: unexpected indent (1, line 2)
The problem you now have is that everything compared with my original script was shuffled to the right with 4 space characters on every line. Or better expressed, indented 4 space characters.
Using space characters is correct but when used in such a way that all lines from top gets indented, causes the python compiler to complain.
To fix it, you have to start from top and delete the first 4 space characters in on each and every line. Or try to copy the script correctly, then it should work, at least the script should be accepted by python compiler.
BestR
Code: Select all
def eventHandler(base, pload):
#Check if the event is from the OWL160
try:
if str(base).find('CM119/160 id: 56146') > -1 :
m = str(pload).split(' ') #Break up the string and create a list
W = str(m[6]) #Pick the list item holding the instant power usage
Wh = str(m[11]) #Pick the list item holding total energy usage
#print W
#print Wh
#Update data sources in SK riding on the SwitchKing plugin
eg.plugins.SwitchkingTellStick.DSSet(u'', u'instant power', W, 0)
eg.plugins.SwitchkingTellStick.DSSet(u'', u'total power', Wh, 0)
except:
pass
#Check if the event is from the RFXSensor
try:
if str(base).find('RFXSensor temperature id: 8204') > -1 :
m = str(pload).split(' ')
tmp = str(m[2])
#print tmp
eg.plugins.SwitchkingTellStick.DSSet(u'', u'rfxsensor', tmp, 0)
except:
pass
#Execution starts here when script is triggered
eg.event.suffix_copy = eg.event.suffix
eg.event.payload_copy = eg.event.payload
#Now calling the defined function
eventHandler(eg.event.suffix_copy, eg.event.payload_copy)
Re: RFXtrx
Posted: Tue Jan 07, 2014 8:35 pm
by bj├©rnhf
Nice .working very well now

Thank you very much.
It is really ok that you comment the codes as you writes it.makes it easier for noobs like me
Now i use your plugins for:
*smooth scenario changing
*doorbell with NMA (notify my android)
*Firealarm kd101 with alarm position and turning of critical equipment NMA
*security alarm and kd101 as siren with NMA
*water leak alarm NMA
*low temp alarm chickenhouse NMA
*Energy meter
and much to come.It starts to get fun now
Keep up the good work
Re: RFXtrx
Posted: Tue Jan 07, 2014 9:08 pm
by krambriw
Perfect, thanks
Br
Re: RFXtrx
Posted: Thu Jan 30, 2014 6:51 am
by krambriw
Hi,
There is no real change to the RFXtrx itself this time but I have added support for using the Tornado plugin and it's built in support for web sockets. Now you can select either the previous and still working fine Websocket Suite or the new Tornado.
See below. Find the new plugin version in the first post.
BestR Walter
Re: RFXtrx
Posted: Sun Feb 09, 2014 5:41 pm
by alonmalka
Hi,
I am having trouble with the range of the RfxTrx.
I was wondering if it is possible to connect two RfxTrx units at the same time and to control them. In this way I can place them in to places and improve the reception range.
Thanks,
Alon