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.
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: RFXtrx

Post by husa550 »

FINALY!!

I feel pretty dumbass :oops:

Now i finaly can start EG, Latest version with your script and no startup error :D

What was wrong, me :shock:
I think, but not shure, the problem was that when i selected your code i did not push "select all".
I just selected all with the mouse pointer and that in combination with working on a MAC to the other computer using TeamViewer screw things up.
As i wrote, i even printed all code "by hand" and that went wrong to, dunno why...

But now i'm happy again :-)

Next thing, i tried to figure out how to capture humidity but are a complet python noob so that have not succeed yet.
Could you give me some point in how to proceed?

And BIG THANK'S for helping me!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

No worries m8, happy to hear that you got it sorted out!

To get the humidity you can try this:

Code: Select all

pload = eg.event.payload
m = pload.split(' ')
temperature = str(m[2])
humidity = str(m[6])
#humidity = str(m[6])+'  '+str(m[7])
try:
    eg.plugins.CommandFusion.SerialChange(500, temperature)
    eg.plugins.CommandFusion.SerialChange(501, humidity )
except:
    print 'Detected problems sending to CommandFusion'
One of the lines for humidity gives a nicer formatting but I do not know if it looks ok in your phone. You can try them one by one if you comment/uncomment one of the lines

Also you MUST set the correct 'join' number, I just typed in 501 as example
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: RFXtrx

Post by husa550 »

Hmm....

That did not went well.

I tried your extended script and there we go, error messeges arrived.
Removed the first script (temp only), save & restart EG
Error message at start and when the macro is triggerd.
Only way to not get error message is to remove python script.
Every time i do a change, i save & restart EG
Attachments
Skärmavbild 2014-08-13 kl. 19.12.29.png
Skärmavbild 2014-08-13 kl. 19.11.29.png
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

Well,
Something is going wrong in the editing, obviously since the script is just simple text. You did "select all" this time I guess?

Python is very, very sensitive to mistyping and formatting like incorrect indents. Every indent that looks like a tab must be 4 space chars instead, otherwise it will not work. Could it be that you have some 'non-visible' chars in there as well?

Could it be that this is where it goes wrong, copying & pasting from mac to pc via teamviewer???

BR
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: RFXtrx

Post by husa550 »

I suspect the same, some copy/paste error.

I have just uninstalled EG, rebooted computer and will try over again.

One thing that came to my mind was if TeamViewer mess thing's up after some time.

But, thing's worked before so i will try until it work again :-)
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: RFXtrx

Post by husa550 »

It's clearly TeamViewer or Mac that screw up copy&paste!

I copy and paste direct on the PC and now there is no errror :D
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

I just tried to copy & paste the same script (a bit modified to print the results instead of sending to CommandFusion) via Teamviewer and from Windows to Windows it worked just perfect. I suspect that it is in the clipboards of Mac and WIndows something is messed up.

BR
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: RFXtrx

Post by husa550 »

Hi again!

The python script works fine and no error's!

But, data is sent most randomly to iViewer.
I have no clue why :x

My light's that i turn on/off with buttons in iViewer -->Eventghost-->RFXtrx433 works always.
If i try to send a serial join change manually from EG to iViewer it sometimes work (and when it work it's wery fast) but mostly it don't work.

Any ideas to solve that?

This is how EG is setup in commandfusion/iviewer:
Attachments
Skärmavbild 2014-08-17 kl. 15.10.45.png
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

Hi, I am not using iViewer so I do not know what could be the problem.

Eventually, worth trying, is however

- have a short delay between messages sent to iViewer to avoid eventual 'choking'
- sent the same message multiple times

I have modified the script accordingly, you may try if it helps

Code: Select all

import time
pload = eg.event.payload
m = pload.split(' ')
temperature = str(m[2])
humidity = str(m[6])
#humidity = str(m[6])+'  '+str(m[7])
try:
    for i in range(5):
        eg.plugins.CommandFusion.SerialChange(500, temperature)
        time.sleep(0.1)
        eg.plugins.CommandFusion.SerialChange(501, humidity )
except:
    print 'Detected problems sending to CommandFusion'
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: RFXtrx

Post by husa550 »

Hi!

Now i finally found what messed things up.

I had 2 system in commandfusion who used the same port, 8020 :(
Changed that and now it seem's to be more stabile :D
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: RFXtrx

Post by husa550 »

Hi

If i want to display the rest of the data, would this work?

Code: Select all

pload = eg.event.payload
m = pload.split(' ')
temperature = str(m[2])+'  '+str(m[3])+'  '+str(m[4])
humidity = str(m[6])+'  '+str(m[7])
status = str(m[9])
signal = str(m[11])
battery = str(m[13])
try:
    for i in range(5):
eg.plugins.CommandFusion.SerialChange(2500, temperature)
eg.plugins.CommandFusion.SerialChange(2501, humidity )
eg.plugins.CommandFusion.SerialChange(2503, status)
eg.plugins.CommandFusion.SerialChange (2504, signal)
eg.plugins.CommandFusion.SerialChange(2502, battery)
except:
    print 'Detected problems sending to CommandFusion'
	
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

Sure, it looks ok and should work. Just be careful about the formatting, as mentioned earlier, python is very sensitive to correct formatting.

Also, if you found the problem earlier, you do not need the 'for i in range(5):' statement anymore, this was just for testing purposes, I assume you do not need to repeat the command now when everything seems to work?

Here is the script modified and correctly formatted

Code: Select all

pload = eg.event.payload
m = pload.split(' ')
temperature = str(m[2])+'  '+str(m[3])+'  '+str(m[4])
humidity = str(m[6])+'  '+str(m[7])
status = str(m[9])
signal = str(m[11])
battery = str(m[13])
try:
    eg.plugins.CommandFusion.SerialChange(2500, temperature)
    eg.plugins.CommandFusion.SerialChange(2501, humidity )
    eg.plugins.CommandFusion.SerialChange(2503, status)
    eg.plugins.CommandFusion.SerialChange (2504, signal)
    eg.plugins.CommandFusion.SerialChange(2502, battery)
except:
    print 'Detected problems sending to CommandFusion'
   
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: RFXtrx

Post by husa550 »

Thank's!
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: RFXtrx

Post by husa550 »

Here is a picture of one page of my control app :D
In the round spot it show temperature, Humidity, Battery and signal from the temp sensor.
Attachments
iviewer.jpg
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

Very nice!

BTW Do you also use websockets to update statuses of lights, temperature, humidity and other data when they change?
Post Reply