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.
thebeetleuk
Posts: 9
Joined: Sun Dec 09, 2012 9:36 pm

Re: RFXtrx

Post by thebeetleuk »

Hi Walter,

Re your reply to my post on the "by krambriw ┬╗ Sun Apr 28, 2013 6:26 am"

I understand how to get the relevant values from the web page into the EventGhost. What I'm struggling with is how to execute the AC commands directly from Python instead of the pre defined dialog boxes or actions that can be added. How is this done? Can you point me in the direction of some sample code or documentation?

Many Thanks
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

I see, if you run one of the latest versions of EG, this will be very simple.

1) Create a macro with a 'Send_AC' action inside

2) In the EG tree on the left side, right click on the Action and select 'Copy As Python'

3) Then paste into your editor of choice or directly into your python script and it will look like this:

Code: Select all

eg.plugins.RFXtrx.send_AC(u'Test device', u'AC', u'00 00 00 01', u'1', u'off', u'0', 1)
This you can execute directly in the script and it will work (provided you have the device configured the same)

If you run an older version of EG, you need to do some more steps:

1) Create a macro with a 'Send_AC' action inside

2) In the EG tree on the left side, right click on the Action and select 'Copy'

3) Then paste into your editor of choice or directly into your python script and it will look like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1610">
    <Action>
        RFXtrx.send_AC(u'Test device', u'AC', u'00 00 00 01', u'1', u'off', u'0', 1)
    </Action>
</EventGhost>
4) As you see, you now copy and edit only one of the lines (add the keywords eg.plugins) so that it will look the same as above

Code: Select all

eg.plugins.RFXtrx.send_AC(u'Test device', u'AC', u'00 00 00 01', u'1', u'off', u'0', 1)
Best regards, Walter
thebeetleuk
Posts: 9
Joined: Sun Dec 09, 2012 9:36 pm

Re: RFXtrx

Post by thebeetleuk »

Brilliant! Quite simply simple!

Thanks for getting back so quickly.

Time for a slight redesign I think :)
thebeetleuk
Posts: 9
Joined: Sun Dec 09, 2012 9:36 pm

Re: RFXtrx

Post by thebeetleuk »

OK so I was going well for a while and now im stuck. I can pass the variables i need into eventghost from the web without an issue. These appear as the payload 0-3. Only thing is I don't know the syntax to format line 11 below. Forgive my lack of python skills. Can someone help?

Code: Select all

newEvent = str(eg.event.suffix)
newPayload = eg.event.payload

eg.TriggerEvent(  eg.event.payload[0] ) #ignore ip address
eg.TriggerEvent(  eg.event.payload[1] ) #type
eg.TriggerEvent(  eg.event.payload[2] ) #devicename
eg.TriggerEvent(  eg.event.payload[3] ) #level - I want to pass this into the execute command "Level"

DeviceID = u'01 00 00 07' #The correct id of the sensor
UnitID = u'1'

Level = u'15' #how can I format this line to accept the value 15 from the payload above?
#Level = "u'15'" #no luck with this format or the line below. I don't think it likes the double quotes.
#Level  = "u'%s'" % eg.TriggerEvent(eg.event.payload[3])

DeviceName = u'Any Name' #The name of the device
Protocol = u'AC'
Command = u'set level'

#Execute Command
eg.plugins.RFXtrx.send_AC(DeviceName, Protocol, DeviceID, UnitID, Command, Level, 3)
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

Assuming you have your wanted data in the payload[3]:

This will give you the data as a string:
Level = str(newPayload[3])

If you instead need it as a number (integer) you can do:
Level = int(newPayload[3])
thebeetleuk
Posts: 9
Joined: Sun Dec 09, 2012 9:36 pm

Re: RFXtrx

Post by thebeetleuk »

Now you have written that down I can't think why I didnt just do that. Over complicating it I think :)

Thanks!!!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

New version released (see first post)
GraemeEvans
Posts: 6
Joined: Sun Mar 10, 2013 3:16 pm

Re: RFXtrx

Post by GraemeEvans »

krambriw wrote:Hi Fred, I think and I hope this one works,

Best regards, Walter
__init__.py

i just tried to install this version of the plugin but i can seem to find where to input my lighting4 code???

nevermind, opened the py and found the chnagelog, not very clear that its under the whole ELRO, Flamingo, Phenix,
# Sartano, RisingSun, Brennenstuhl" but i found it. will let you know how it goes


update: works perfectly with my belkin energy conserve http://www.belkin.com/uk/p/P-BG108000-2M thanks again
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

Cool, thanks for your feedback, I do not have any Lighting 4 compatible devices myself so I couldn't test.

Best regards, Walter
GraemeEvans
Posts: 6
Joined: Sun Mar 10, 2013 3:16 pm

Re: RFXtrx

Post by GraemeEvans »

no problem.

i'm curious about the plugin, is it possible for you to support protocols that arent integrated by rfxcom?'

I've purchased some wall light dimmers, and the rfx doesnt seem to pick up any of the signals from the remotes i bought with them, but someone managed to "decode"if you can call it that, the signal the remotes generate.
http://forum.arduino.cc/index.php/topic,153525.0.html

He got it working transmitting the signal from an arduino uno, but would it be possible to get the eventghost plugin to do the same?

i'm already talking with one of the guys at rfxcom about getting the rfxtrx433 to work with these remote led mini dimmers http://www.ebay.com/itm/RF-Wireless-Con ... 1115798171

since i'd need it to work with eventghost it makes more sense to just get it working with your awesome plugin first, if that possible? :)

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

Re: RFXtrx

Post by krambriw »

No, this is not possible, all protocols needs to be supported by the RFXtrx.

Best, Walter
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

New version supporting fw 67 / 167 published in first post
arjanm
Posts: 13
Joined: Sun Feb 17, 2013 4:50 pm

Re: RFXtrx

Post by arjanm »

Hi Walter,

I own a RFXtrx433, which works flawless with your eg-plugin, great work!

Recently I bought a RFXreceiver, which turns out to be a (very) old version.
This version is not completely compatible with your eg-plugin.
I've contacted Bert from RFXcom, he told me flashing/upgrading my RFXreceiver is not possible.
Bert told me I could possibly use a driver from xPLmonkey (http://www.xplmonkey.com/) and use xPL, but unfortunately the website is offline and I can't find the correct (Windows-)driver.

This leaves me with trying to get your eg-plugin to work, with some adjustments if needed.
I started with changing the baud-rate to 4800, that resulted already in a more meaningful result.
Now I get: "Message could not be repaired 20946b08f720946b08f720946b08f720946b08f720946b08f7"

Could you point me in the direction where to make adjustments in the python-code to 'convert' the incoming message to be compatible with the plug-in?
I have a test-setup with a RFXtrx and the RFXreceiver and multiple RF-modules, and am ofcourse willing to provide you logs/data.

Kind regards,
Arjan
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

Hello Arjan,

I understand your point, I also have the same RFXreceiver and also a RFXmitter....and they worked great. I made earlier a dedicated plugin for those, I think you can find them here viewtopic.php?f=9&t=2077#p11836 but it is depending on xPL and tailored to fit the xPL Monkey. I did not know that it seems unavailable.

The newer plugin built for the RFXtrx is not easy to modify since then I would need the protocol and re-work the whole plugin (or at least a major part of it). I do not see that it is actually worth the effort anymore, I do not use my older RFXCOM devices, I only use the RFXtrx.

Let me think...
arjanm
Posts: 13
Joined: Sun Feb 17, 2013 4:50 pm

Re: RFXtrx

Post by arjanm »

Hi Walter,

Thank you for your reply,

I've edited your plugin at two points now:
- Change the baud-rate to 4800.
- Change the output that says "Message could not be repaired 20946b08f720946b08f720946b08f720946b08f720946b08f7"
to a new output that gives no error, but just triggers the event: "20946b08f720946b08f720946b08f720946b08f720946b08f7"

Because the RFXtrx is also in this system, I can discover what the code-string should say, and add the code-string as an event to a macro.
I'm not sure yet what happens when a sensor sends an "On" message with a changed parameter, e.g. signal '6' instead of '5', will it result in a different code-string?

Could you provide me with information on the 'old' and 'new' protocol? It seems the 'code-string' can be directly converted to a meaningful result.
Post Reply