Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

RFXtrx

Questions and comments specific to a particular plugin should go here.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: RFXtrx

Post by Pako »

Mastiff wrote:Btw do you have any idea why I'm getting a line saying

Code: Select all

10:22:22         Persistent values: {}
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
PersVars.png (3.1 KiB) Viewed 7217 times
It shows the values ÔÇïÔÇïof persistent variables (for checking).
And as we can see, you do not use persistent variables.

Pako
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

Aha! Thanks! :D I thought it was an error, but it's only information, then.
haklis
Posts: 6
Joined: Sat Oct 06, 2012 4:49 pm

Re: RFXtrx

Post 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

New version published in first post

Added support for
- RGB TRC02 controllers
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post 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:
Image2.jpg
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
bj├©rnhf
Posts: 3
Joined: Tue Jan 07, 2014 10:06 am

Re: RFXtrx

Post 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?
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post 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? :roll: :lol:
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

:D

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)

Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

krambriw wrote::D
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! :lol:
bj├©rnhf
Posts: 3
Joined: Tue Jan 07, 2014 10:06 am

Re: RFXtrx

Post 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)
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post 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)
bj├©rnhf
Posts: 3
Joined: Tue Jan 07, 2014 10:06 am

Re: RFXtrx

Post by bj├©rnhf »

Nice .working very well now :D 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

Perfect, thanks
Br
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post 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
Image2.jpg
alonmalka
Posts: 29
Joined: Wed Dec 04, 2013 10:07 am

Re: RFXtrx

Post 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
Post Reply