Exchange events with NetHomeServer

Questions and comments specific to a particular plugin should go here.

Re: Receive events from NetHomeServer

Postby Jostein » Tue Jan 05, 2010 4:12 pm

Hi krambriw.

There is no way to set the codes manualy for the wind or the rain.

The rain is at House code 10 device code 3
The wind is at House code 10 device code 2


The wind sensor shows the same in EG if i switch from km/h to mph(this can only be done on the reciever not on the sensor. There is no display on the sensor)

As i understand it the only diference is that the reciever calculates over to mph instead of km/h as it is just the same it recieves.
The vind sensor sends out a new value every minute and it does not change if i change the display from km/h to mph on reciever i still get the same value in EG.

At 6km/h i get 3mph
at 13km/h i get 8mph

I am not sure how to telnet but if you have a link to where it is described i will try my best.

Regards JOstein
Attachments
EG logg.JPG
To show how it updates every minute.
Jostein
Experienced User
 
Posts: 85
Joined: Sun Feb 15, 2009 12:59 pm

Re: Receive events from NetHomeServer

Postby Jostein » Tue Jan 05, 2010 4:37 pm

mickelin wrote:Jostein, what type of data does the rainsensor send out? Is it just a value based on how much water is in the cup or something more sofisticated?

It is an arm that switches over when filed with water Its resulution is 0,7mm witch is what it shows on the station if it tip it once.
This is a picture not the one i have but the same idea. It counts the thimes it tips over.
http://wxw.davep.org/weblog/images/RainBucketOpen.jpg

Here you can se the values i get on the "station" and in EG:
Rain.JPG
Rain.JPG (14 KiB) Viewed 904 times


In norway aslo the most comon wind speed is m/s.

krambriw wrote:Please give your suggestion if I shall make a version with reserved house codes


I was not expecting the plugin to do these things i was more thinking it would be easyer to use a phyton script linked with the event to "recalculate/rescale" based on the values i attached in previous posts. This would be easyer for you i would at least think. But it would be great if the plugin did it. With the possibility to chose m/s or km/h and so on. Anyway it is a great plugin.

The ideal way to solve it would be as i see to create some convert actions to the plugin that the user can link with the event himself.

For example you can convert temprature to farenheit. temprature to speed(m/s, km/h and mph). humidity to direction(N, E, S W and so on).

Hope you understand.

Regards Jostein
Jostein
Experienced User
 
Posts: 85
Joined: Sun Feb 15, 2009 12:59 pm

Re: Receive events from NetHomeServer

Postby krambriw » Tue Jan 05, 2010 6:39 pm

Hi,
Don't worry, I understand now why we get "strange" readings. I will make all possible calculations/decoding and mapping in the plugin to be "compliant" with the devices. Afterwards, you will still have the possibility to add scripts etc

Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: Receive events from NetHomeServer

Postby krambriw » Tue Jan 05, 2010 7:40 pm

Hi again,
Can you try this test version?

PS You will have to start with a new configuration...

__init__.py
(33.48 KiB) Downloaded 57 times
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: Receive events from NetHomeServer

Postby Jostein » Tue Jan 05, 2010 9:19 pm

Hi.

First try i got a error not sure why.
fault.JPG


Tried restarting nethome an EG again.
Got it working with the wind sensor.
scr.JPG

I see that you have changed the value to m/s as i have 5,56in EG and 12mph, 20km/h on the "station".
_________________________
Edit: i see now that i can chose if i want km/h or mph.
_________________________
The N, E, S and W alsow work.
Maby change the text in the event from humidity and temp like you have done for the rain sensor.

The rain sensor there is a fault:
Rain scr.JPG

For every time i tip the bucket the "station" ad 0,7mm in eventghost i get 1.
Exept from that it works perfect.


How is the range for your reciver. Mine is weary week for the UPM sensors but for nexa it is mutch bether.
The "reciever i modified(A UPM station)" Picks up the temprature but not EG. Is that something due to my hardware mod or would it be enough to change something software. Is there a way to strengthen the antena on the reciever?

Did you se the post i wrote about repeting the events trough the network event sender previous in this post?:
Jostein wrote:Hi.

I am trying to display the temprature values in a web page. I have made it by using Bitmonster`s webserver posted in here.
I have managed to do it.

The only problem is that the webserver i use is on a different computer than the one with the UPM reciever. I tought that i could use the network event sender to repeat the event put have not been able to do so with the payload.

Do you know how to do it or should i post somewhere else?


Regards Jostein
Jostein
Experienced User
 
Posts: 85
Joined: Sun Feb 15, 2009 12:59 pm

Re: Receive events from NetHomeServer

Postby krambriw » Tue Jan 05, 2010 11:20 pm

Hi,

New test version.
__init__.py
(33.55 KiB) Downloaded 59 times

Should fix the rain level correctly. Changed labels for wind data as well.

Regarding your question about the rf transmission range, I have the same experience. I have improved the coverage using this method
Some words about receiving RF signals. Some transmission devices sends rather weak signals. This is a link to a page that describes how a passive antenna can improve the result. I have successfully used it. The wire length shall be 34.5 cm for 433 MHz
http://davehouston.net/passive.htm

I am also using the more expensive batteries of lithium type (just to make sure they last longer, especially if they are outdoor in this temperature, -21.25 celsius right now)

The antenna modification made most improvement. You shall position the wire on the back side of the UPM sensor if you are looking towards it and have the receiver behind you

To improve the UPM modified receiver, you can do some things:
- try to lower the "Flank Swing" value (I have 35, try to go down to 20)
- fine adjust the other settings
- consider adding an external antenna (I have this "Radiokommunikation / Scanner / Scannertillbehör / Antenner / 30825" from Kjell & Company connected to my RFXCOM)
- check that your microphone input level is set to maximum
- consider replacing batteries with a real power supply

I have the receiver connected to one computer where I run EG and NetHomeServer with the NetHomeServer plugin. In a second computer I also have another EG running with the NetHomeServer plugin. Both gets the same events from the same receiver.

You can have NethomeServer and the receiver in one PC. Then you can have EG + your web server plugin and the NetHomeServer plugin in a second PC and connect to NetHomeServer over your LAN

If I remember correctly, there was some writing about transferring also the payload using the Network Event Sender (eventually an updated plugin was attached in some post)

Edit: found it
http://www.eventghost.org/forum/viewtopic.php?f=9&t=724

Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: Receive events from NetHomeServer

Postby Jostein » Wed Jan 06, 2010 12:28 am

Hi.

Thanks for the range tips will defenetly try somethings.

krambriw wrote:I have the receiver connected to one computer where I run EG and NetHomeServer with the NetHomeServer plugin. In a second computer I also have another EG running with the NetHomeServer plugin. Both gets the same events from the same receiver.

You can have NethomeServer and the receiver in one PC. Then you can have EG + your web server plugin and the NetHomeServer plugin in a second PC and connect to NetHomeServer over your LAN

Off corse that was easy. I dident think of solving it this way. It doesent always have to be complecated.


I get a fault when the wind dir sensor is at a certain point. The fault stops the plugin mening that i have to restart it to recieve events again.
To try understanding the fault i tried running the previous version(Before rain and wind suport, From your first post) on one computer and the new one on another. The new version crashes.
fault wind.JPG

I dont understand what the code on line 226 does other than that it has something to do with the wind direction.
It is not always there but only at certan points.

I also noticed that it displayes a humidity of 6 and a wind direction of W on the new plugin. That is alsow wrong. 6 should be SE. West should be at 12 not 6. That might have something to do with the bug, somehow the count adds 6?(Se the above attachment.)

the rains sensor is working as it should now.
Could it be possible if not to mutch work to add the rain for last hour in the humidity payload as it is not used by something else, or maby another way of displaying rain for last hour, day, yesterday and week. I only need last hour.

Regards Jostein
Jostein
Experienced User
 
Posts: 85
Joined: Sun Feb 15, 2009 12:59 pm

Re: Receive events from NetHomeServer

Postby krambriw » Wed Jan 06, 2010 6:47 am

Good morning,

The bug is coming when I try to map the value for wind direction to the correct label. I have made some changes to this part to improve the code and also added a printout if things goes wrong just to be able to trace the problem better (will be removed when finished)

Here is a new test version:
__init__.py
(34.14 KiB) Downloaded 57 times


Will look into how to accumulate and calculate the rain average. This might be tricky. I can calculate only when EG is running.

What shall I do if EG restarts (Reset and start from zero or save the accumulated value persistent)?

What if it rains a lot when EG is not running?

Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: Receive events from NetHomeServer

Postby Jostein » Wed Jan 06, 2010 12:03 pm

Morning.

The wind directionStil have some bugs:
Bug that came when switched from m/s to km/h Not to important it worked on aftervards as it should.
Bug.JPG

Here are two screnshots from the log.
NE-E.JPG
log.JPG



krambriw wrote:Will look into how to accumulate and calculate the rain average. This might be tricky. I can calculate only when EG is running.

What shall I do if EG restarts (Reset and start from zero or save the accumulated value persistent)?

What if it rains a lot when EG is not running

The accumulated value should be the easyest one. If EG loses conection the bucket still counts up. It does not start over from -50. So that would just be the value as it is now. It is only when i remove the bateries from it. I dont see a reson for saving the value for accumulated. But it might be a solution for hour and day. That way say if you have 12mm that hour and EG disconects and reconect after 30mins it could maby check and se how big the change was from last timestamp and recalculate from there (So it dont start from scatch). But as the loging goes there are 1000ways it could be solved i gues and i have no phyton skills so i am not sure what is the easyest.


Best regards Jostein
Jostein
Experienced User
 
Posts: 85
Joined: Sun Feb 15, 2009 12:59 pm

Re: Receive events from NetHomeServer

Postby krambriw » Wed Jan 06, 2010 12:52 pm

OK, thanks for detailed testing and screen shots.

The bug that comes when changing from m/s to km/h and vice versus is most likely due to that the thread restarts to quickly. I will see if I can delay it further.

I'm worried about all the readings "Out of Range" for the wind direction. I will review this part of the code further, most likely I have made an error in clearing variables or so. I will add more debug info in the printout for those errors

I will try to make a first shot on the rain ackumaulation calculation when we have a stable operation

Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: Receive events from NetHomeServer

Postby krambriw » Wed Jan 06, 2010 1:11 pm

New test version :?:
__init__.py
(34.44 KiB) Downloaded 58 times

Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: Receive events from NetHomeServer

Postby Jostein » Wed Jan 06, 2010 2:40 pm

krambriw wrote:OK, thanks for detailed testing and screen shots.

No thank you for taking the time creating the test version.

I think i have figured out what the fault is and have tried explaining it in the scr(Red is the Oldest version and green is the new):
x2.JPG

It seams that every humidity value is multiplied with 2 in the new version. So that is why it goes to out of range when it leaves 15.

I am not sure why it x2 but i will try to figure it out from the plugin. You might have mutch bether luck doh as you now more where to look.

krambriw wrote:I will try to make a first shot on the rain ackumaulation calculation when we have a stable operation

Loking forward for it maby an avrage wind speed for last 15min or hour also in case of a strong gust at the time it reads the wind.

Best regards Jostein
Jostein
Experienced User
 
Posts: 85
Joined: Sun Feb 15, 2009 12:59 pm

Re: Receive events from NetHomeServer

Postby krambriw » Wed Jan 06, 2010 4:21 pm

Ooops, the raw message in your screen shots is more or less how it looks like when it comes from NetHomeServer...

In the old version I always divide the humidity value with 2, that is why it looks like if it works. For the wind direction, I cant divide with 2 because the expected value should be 0-15 and that is what it is (most of the time)

Just to verify if it is a bug in NetHomeServer itself, could you start a telnet session and compare how messages look like there. First you need to find Telnet.exe in your computer (Im not sure, but maybe you have to activate it if you are running Vista)

http://www.tekniken.nu/utvecklingstips/telnet_i_vista

You do not have to close EG for this test, let it run in parallel because NetHomeServer supports multiple telnet sessions. From command prompt or double-click to start telnet

From prompt type (if this is the PC where NetHomeServer is running)
Code: Select all
o 127.0.0.1 8005
+Enter

Then type
Code: Select all
dir
+Enter

and you will see a list of all instances defined in NetHomeServer

Then type
Code: Select all
subscribe
+Enter

After a short while messages will be displayed in the telnet window. Try to mark, copy, paste messages with wind directions and compare the values with the ones received and logged in EG

Type
Code: Select all
quit
+Enter to quit

If it is like I suspect, there is a bug in NetHomeServer. In that case we need a bugfix but in the mean time I can make a plugin version that divides the value with 2 if it is higher than 15

Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: Receive events from NetHomeServer

Postby Jostein » Wed Jan 06, 2010 5:36 pm

Hi.

im on winxp.

Am not sure i understand the bug myself hope this will help.
Code: Select all
ok,Event Broker,RFReceiver,TCP Command Port
subscribe
ok
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,30
,UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,30
,UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,6,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,6,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,24
,UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,24
,UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,9,UPM.Humidity,8,U
PM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,2,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,2,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,3,UPM.HouseCode,4,UPM.Humidity,4,U
PM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,2,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,2,
UPM.LowBattery,0,UPM.Temp,0

Regards Jostein
Attachments
telnnet.JPG
Jostein
Experienced User
 
Posts: 85
Joined: Sun Feb 15, 2009 12:59 pm

Re: Receive events from NetHomeServer

Postby krambriw » Wed Jan 06, 2010 5:58 pm

OK, thanks, it must be a bug (or the wind direction meter works this way). You can see from the log that we receive values higher than 15 sometimes.
Advanced debugging is to start the NetHome Analyzator and log some entries for the wind direction in that one. Then double-click on the log entries and the values should be seen there as well

Attached is a new test version I hope will work. When I change from m/s to km/h and back, I have no more crashes here. Is this also ok for you?

Best regards, Walter

__init__.py
(34.67 KiB) Downloaded 56 times
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 1 guest