Page 2 of 23

Re: Receive events from NetHomeServer

Posted: Sat Jan 02, 2010 4:36 pm
by krambriw
Hello Michael, no problem
The information is in the so called payload of the event. A simple way to get it is to create a macro, drag the event to it and then add the following script as next step in the macro

Best regards, Walter

Code: Select all

p = eg.event.payload
print p
p = p.split('|')
temp = p[3]
print temp

Re: Receive events from NetHomeServer

Posted: Sat Jan 02, 2010 5:57 pm
by mickelin
Brilliant, thanks!

Re: Receive events from NetHomeServer

Posted: Sun Jan 03, 2010 7:57 am
by krambriw
support also for the RFTransmitter in the plugin. Since NetHomeServer now supports Pronto codes, that would make it possible to send Pronto codes by RF from EG
Hi,

This is possible. To transmit RF from NetHomeServer you will need to either build a transmitter based on a remote or purchase that little CUL USB dongle he currently is implementing support for. Have you already made the remote mod?

I have no devices connected to and handled by NetHomeServer and I haven't played too much with the pronto code but I believe it is something you configure inside of NetHomeServer for each device that supports it?

If so, you could just help me to test some things before I start coding too much.

Start a telnet session and connect to NetHomeServer. From the prompt, type
o host-ip 8005
and you should be connected. Then type
dir
and you should get a list of all instances. Then try to set a device that you have configured for pronto
call, Bedroom Lamp, on
or something similar

If it works fine from telnet, I know how to code the things

Best regards, Walter


PS I noticed in your configuration screen shot above one little thing; drag the "UPM Logger" action to the Autostart as well, otherwise it wont start automatically when EG starts

Re: Receive events from NetHomeServer

Posted: Sun Jan 03, 2010 10:22 am
by mickelin
Hi Walter,

I have had a look around the config gui of the NHS but haven't found any references to Pronto. Perhaps it is not implemented yet, except in the analyzer?

Let me describe what I want to do, so you have the use case clear.

I use a Philips Pronto remote to control my home theatre. This remote sends RF Pronto codes to a pyramid that converts to IR and sends on to the A/V equipment (amplifier, DVD player, plasma, projector)

To control lights, curtains, projector screen etc, the Pronto remote sends "dummy" codes that are intercepted by EventGhost and used to trigger appropriate Tellstick On/Off/Dim commands.

What I want to do is to replace/complement the Pronto remote with a voice control interface, using the EG Voice plugin. Therefor I need EG to send the control signals to the A/V equipment. I had planned to use a USB-UIRT for this, but I would rather use RF directly, instead of having a set of pyramids translating the USB-UIRT signal to RF and back to IR.

I would rather not have to define and map all devices and codes in NHS, but just use it as a generic RF transmitter, just passing on a code that is sent from EG. That way, I could keep all configuration and device definitions etc in EG.

So my wishlist in summary:
- Define a generic Pronto remote object in NHS that re-transmits a code recieved through telnet
- Support in your plugin for taking a code in Pronto Hex format and sending it through to NHS

Long, description - is it doable?

EDIT:
I've tested some more and it looks promising! In NHS I defined an item of type RFTransmitter and called it ProntoTest.

Using telnet, it shows up under the dir command. I can issue a get command to get the attributes and I can call it by: call,ProntoTest, but haven't figured out how to provide the message code. The documentation (http://wiki.nethome.nu/doku.php/audiopr ... ransmitter) states that it can transmit a pronto message, but doesn't say how to format the message. It only lists one action: PlayTestBeep

call,ProntoTest,PlayTestBeep beeps and returns ok

call,ProntoTest,code returns ok

Thanks,
Michael

Re: Receive events from NetHomeServer

Posted: Mon Jan 04, 2010 6:57 am
by krambriw
Hello,

Yes this will not be too difficult. I expect to have a first test version uploaded sometime during the day

I have just found out how to send pronto codes to NHS, you can test this as well and replace the pronto below with the codes you prefer

This event is taken care of by NHS as an event that shall go out. When I send it via telnet, I hear the code in my speakers/headset. I changed nothing except that I configured the RFTransmitter to use the correct audio output

Best regards, Walter

Code: Select all

event,Pronto_Message,Direction,Out,Pronto.Message,0000 0073 0000 0019 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 000e 002a 002a 000e 000e 002a 002a 000e 000e 002a 002a 000e 000e 0199

Re: Receive events from NetHomeServer

Posted: Mon Jan 04, 2010 11:46 am
by krambriw
New version with pronto command support uploaded in the first post above (just add an action for each pronto code to like to send)
Image2.jpg
Best regards, Walter

Re: Receive events from NetHomeServer

Posted: Mon Jan 04, 2010 11:30 pm
by mickelin
Perfect, exactly like I wanted! You da man Walter! :D

I haven't quite gotten it to work yet, but I suspect there is a problem with my newly built transmitter. I'll try to check it out tomorrow and test some more.

I also picked up my UPM wind sensor today. This is what the logger entries and the analyzer look like:
Windsensor.jpg
As I rotate the wind direction sensor through N-E-S-W, the humidity number changes from 2-10-13-6. With no wind, the temperature shows -50, going to -47.8125 as I blow on the wind speed sensor. Looking at the analyzer results, notice that the command value also changes when there is wind.

So, the support is almost here, we just need to decode the data format and calibrate. Looking at the NHS homepage, there is mention of support for the UPM weather sensors in the next release, but no date on the post or next release. Do you know when it is due?

Thanks again for the Pronto support, that is just great!

/Michael

Re: Receive events from NetHomeServer

Posted: Tue Jan 05, 2010 7:56 am
by krambriw
Hi, yes exactly, the data decoding gets mixed up as a temp/humidity sensor

Can you log the thing (wind speed/direction) using a telnet session (copy/paste the result) so I can see if it is possible to decode already with this NHS version?

I have no info when the next release is due but I will ask next time

Best regards, Walter

Re: Receive events from NetHomeServer

Posted: Tue Jan 05, 2010 11:33 am
by Jostein
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?

Re: Receive events from NetHomeServer

Posted: Tue Jan 05, 2010 1:02 pm
by mickelin
krambriw wrote:Hi, yes exactly, the data decoding gets mixed up as a temp/humidity sensor

Can you log the thing (wind speed/direction) using a telnet session (copy/paste the result)
This is what it looks like in telnet:
subscribe
ok
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,8,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,8,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,8,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,8,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,16
,UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,16
,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,10,UPM.Humidity,0,
UPM.LowBattery,0,UPM.Temp,0
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,0,
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,28
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,30
,UPM.LowBattery,0,UPM.Temp,28
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,0,
UPM.LowBattery,0,UPM.Temp,20
event,UPM_Message,Direction,In,UPM.DeviceCode,2,UPM.HouseCode,10,UPM.Humidity,0,
UPM.LowBattery,0,UPM.Temp,20

I'll see if I can find a compass to get some more accurate direction data

Re: Receive events from NetHomeServer

Posted: Tue Jan 05, 2010 2:04 pm
by Jostein
Hi.
Regarding the wind direction i have maped it completeley. I used the original "Station" set the arrow for N checed that i got N on there an what i got in EG. And so on.

The walue goes from 0 -15
Wind direction.JPG
mickelin you said that you had 2 on N. Are you sure that you had it towards N when you checed. There is an arrow under the arrow for the N direction. If not they might not work the same way.

We should be able to use a phyton scipt to map the humidity to N and so on. I am not that good at that thou so it would be great if somebody can do that.

http://en.wikipedia.org/wiki/Boxing_the_compass

I wil post the wind range later today.

Re: Receive events from NetHomeServer

Posted: Tue Jan 05, 2010 2:47 pm
by mickelin
Hi Jostein,

So you have the actual station! Perfect, then that solves the decoding problem. I was too cheap and only bought the windsensor as a spare part, as you suggested in your previous post.

You are quite right that N is 0, I had only pointed it in the general direction. I have now checked with a compass.

Looking forward to your post on the windspeed decode!

Cheers,
Michael

Re: Receive events from NetHomeServer

Posted: Tue Jan 05, 2010 3:11 pm
by Jostein
I got the whole set as i feared i would not figure it out or get the values at all in to EG.

Using a floor fan and adusting the lenghts to the instrument i was able to get the speed calculations.
Here are the results from reading the speed from the "station" and temp from EG:
Wind Speed.JPG
Wind Speed.JPG (13.06 KiB) Viewed 5677 times
From my calculations it seams that for every extra km/h 0,0625 is added. And we get the table:
Speed calculated.JPG
I have noe idea on how to have a phyton script convert from temp to speed. So i hope you or someone has the skils for that. Or else it is useless. Loking forward to an example or any sugjestions on how to solve it.

Will try to sort out the rain sensor someday if that is wanted?

Regards Jostein

Re: Receive events from NetHomeServer

Posted: Tue Jan 05, 2010 3:45 pm
by krambriw
Hello,
Great logging!

As we can see from the log, in this NHS version, there is no way to directly see if the message comes from an UPM Termometer, Hygrometer, Windmeter or Rainmeter

A quick solution using the current version of NHS could be that we reserve some house codes for the Wind and Rain devices (if possible to set). Like House code = 15 is reserved for Wind, House code = 14 for Rain

If they are hard coded in the device, I can filter on that (in the log it seems to be 10)

Is it possible to set the house and device code in the devices?

Jostein, do you think you could also log the messages in the telnet session for the wind speed for some sample speeds? Just to check if the protocol sends the same as showed on the display (km/h or miles/hour)

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

Best regards, Walter

Re: Receive events from NetHomeServer

Posted: Tue Jan 05, 2010 4:10 pm
by mickelin
Great progress!

For the windsensor, the house code and device code are hardcoded in the device (10/2), no way to set it. I suspect the same is true for the rainsensor (Jostein?) I believe the house code range for the temp sensor is 1-15, so the risk for conflict should be limited with a "fixed filter" approach.

Walter, may I suggest a config option for windspeed in km/h or m/s? The later is more standard, at least in Sweden.

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?

Cheers,
Michael