PDA

View Full Version : Will these work with the W800 X10 Device manager?



danward79
January 28th, 2006, 01:26 PM
Mike,

Will this work with you X10 device manager for the w800?

http://www.rfxcom.com/eprod.htm

They look very cool, rob pointed them out to me.

Promixis
January 28th, 2006, 01:47 PM
no idea :(

danward79
February 22nd, 2006, 04:20 AM
Mike,

This is the datasheet for this product.

http://www.rfxcom.com/RFXSensor.pdf

If I purchase one do you think we can work on something? HS supports them so it can't be difficult looking at the output from the device.


01F11607 RFXSensor Temperature sensor addr:01F1 ACRF addr:1 Temperature = 22 deg.
00F01384 RFXSensor Temperature sensor addr:00F0 ACRF addr:0 Temperature = 19.5 deg.
FF0F8118 RFXSensor Device addr:FF0F ACRF addr:FF Error: No 1-Wire device connected

The format is:
Message length 32 bits (decimal)
□ 1st address byte.
□ 2nd address byte. This is byte 1 with the complement of the upper nibble (bit 7-4).
□ 1 byte measured temperature /humidity etc in hex if byte 4-bit 4 is 0 info or error code present if byte 4-bit 4 is 1 info codes: 01 = sensor addresses incremented 02 = Low Voltage detected (not yet implemented) error codes: 81 = no 1-wire device connected 82 = 1-Wire ROM CRC error 83 = 1-Wire device connected is not a DS1820 84 = no end of read signal received from 1-Wire device 85 = 1-Wire scratchpad CRC error
□ Temperature + sensor type / info-error flag / parity 3 bits sensor type: 000 = temperature sensor (MSB = 0.5 degrees bit off) 100 = temperature sensor (MSB = 0.5 degrees bit on) 001 = RFU (humidity sensor) 010 = RFU (pressure sensor) 011 = RFU 101 = RFU 110 = RFU 111 = RFU 1 bit = info-error flag 4bits parity, complement of: byte 1 bit 7654 + byte 1 bit 3210 + byte 2 bit 7654 + byte 2 bit 3210+ byte 3 bit 7654 + byte 3 bit 3210 + byte 4 bit 7654
Byte 1 is 1st byte of sensor address
Byte 2 is 2nd byte of sensor address
Byte 3 measured temperature / humidity etc. or error/info code
Byte 4 bit7 = 0.5 degrees bit if a temperature sensor, bit 7-5 is the sensor type,
bit 4 is error flag, bit 3-0 is 4 bits parity

What do you think? :wink:

Promixis
February 22nd, 2006, 07:25 AM
Dan, if these work with the W800 via HS, then adding them should not be a problem. How much are they?

danward79
February 22nd, 2006, 07:33 AM
They are 42 euro + 12 euro Postage to uk.

Dunno about cost of shipping to the states thou.

danward79
February 22nd, 2006, 10:56 AM
Right, I have ordered one of these, will let you know as soon as I connect it! :P

danward79
March 1st, 2006, 12:20 PM
Hi Mike,

I have the device it is powered up and girder see's it, as extended events from the w800, It does not show any of the data thou.

danward79
March 1st, 2006, 01:14 PM
I enabled this line is the ReceivedResponce function


print ('w',data,code,'l',string.len (data))

Promixis
March 1st, 2006, 01:57 PM
set logging to 0

danward79
March 1st, 2006, 03:03 PM
Ok, I have done that I will post some data as soon as I know it is from the sensor

danward79
March 1st, 2006, 03:11 PM
Ok this is the output from the logger, after a reset


Serial: W800RF32 : Simple Receive: Data 52 46 58 07 RFX. Code: 0
Serial: W800RF32 : Simple Receive: Data 52 46 58 07 RFX. Code: 0
Serial: W800RF32 : Simple Receive: Data 52 46 58 07 RFX. Code: 0
Serial: W800RF32 : Simple Receive: Data 53 45 4E 00 SEN. Code: 0
Serial: W800RF32 : Simple Receive: Data 38 4C AA 00 8L. Code: 0
Serial: W800RF32 : Simple Receive: Data 00 F0 15 0A ... Code: 0
Serial: W800RF32 : Simple Receive: Data 00 F0 15 0A ... Code: 0
Serial: W800RF32 : Simple Receive: Data 00 F0 15 0A ... Code: 0

danward79
March 1st, 2006, 03:13 PM
This is the data it transmits

Serial: W800RF32 : Simple Receive: Data 00 F0 16 09 ... Code: 0
Serial: W800RF32 : Simple Receive: Data 00 F0 16 09 ... Code: 0
Serial: W800RF32 : Simple Receive: Data 00 F0 16 09 ... Code: 0

another transmission

Serial: W800RF32 : Simple Receive: Data 00 F0 16 81 .. Code: 0
Serial: W800RF32 : Simple Receive: Data 00 F0 16 81 .. Code: 0
Serial: W800RF32 : Simple Receive: Data 00 F0 16 81 .. Code: 0

and another

Serial: W800RF32 : Simple Receive: Data 00 F0 12 85 .. Code: 0
Serial: W800RF32 : Simple Receive: Data 00 F0 12 85 .. Code: 0
Serial: W800RF32 : Simple Receive: Data 00 F0 12 85 .. Code: 0

Promixis
March 1st, 2006, 03:36 PM
should be able to parse that easily?

danward79
March 1st, 2006, 03:46 PM
Should be able to.

What would be the best way of doing this. What I mean is in relation to the W800 plugin and getting the data out of it. Or should the W800 plugin just stick the output in a table, listed by device address and temp?

I think the latter would be easiest what do you think?

Promixis
March 1st, 2006, 04:03 PM
Should be able to.

What would be the best way of doing this. What I mean is in relation to the W800 plugin and getting the data out of it. Or should the W800 plugin just stick the output in a table, listed by device address and temp?

I think the latter would be easiest what do you think?

can we tell from the data that this device is different from other RF transmitters? I cannot remember all the details...

if so, why not parse the data within the plugin and have it generate standard events?

danward79
March 1st, 2006, 11:59 PM
Hi,

This is the format of the data. So yeah, it could be used to generate internal events within the plugin.


The format is:
Message length 32 bits (decimal)
□ 1st address byte.
□ 2nd address byte. This is byte 1 with the complement of the upper nibble (bit 7-4).
□ 1 byte measured temperature /humidity etc in hex if byte 4-bit 4 is 0 info or error code present if byte 4-bit 4 is 1 info codes: 01 = sensor addresses incremented 02 = Low Voltage detected (not yet implemented) error codes: 81 = no 1-wire device connected 82 = 1-Wire ROM CRC error 83 = 1-Wire device connected is not a DS1820 84 = no end of read signal received from 1-Wire device 85 = 1-Wire scratchpad CRC error
□ Temperature + sensor type / info-error flag / parity 3 bits sensor type: 000 = temperature sensor (MSB = 0.5 degrees bit off) 100 = temperature sensor (MSB = 0.5 degrees bit on) 001 = RFU (humidity sensor) 010 = RFU (pressure sensor) 011 = RFU 101 = RFU 110 = RFU 111 = RFU 1 bit = info-error flag 4bits parity, complement of: byte 1 bit 7654 + byte 1 bit 3210 + byte 2 bit 7654 + byte 2 bit 3210+ byte 3 bit 7654 + byte 3 bit 3210 + byte 4 bit 7654
Byte 1 is 1st byte of sensor address
Byte 2 is 2nd byte of sensor address
Byte 3 measured temperature / humidity etc. or error/info code
Byte 4 bit7 = 0.5 degrees bit if a temperature sensor, bit 7-5 is the sensor type,
bit 4 is error flag, bit 3-0 is 4 bits parity

danward79
March 4th, 2006, 04:30 PM
Mike,

I think I have notice something about serial.bextract, in that it seems to go from 1 to 8, etc rather than 0 to 7? is that right?

Promixis
March 4th, 2006, 05:19 PM
yes, you are right....

danward79
March 5th, 2006, 12:58 AM
Thank goodness I thought I was going insane! :D

danward79
March 5th, 2006, 07:37 AM
Hey Mike,

I have now come up with some simple code that will allow the RFXCom Sensors to be identified and generate events. It should also report any error's althou it is not possible for me to test all the error codes I have tested one.

I have added the code into the xtended X10 section of your code.


-------------------------------------------------------------Dan's RFXSensor Stuff
local Byte1 = string.sub(serial.formatbytes(data), 1, 2)
local Byte2 = string.sub(serial.formatbytes(data), 4, 5)
local Byte3 = string.sub(serial.formatbytes(data), 7, 8)
local Byte4 = string.sub(serial.formatbytes(data), 10, 11)

if self.AntirepeatTime > 0 and math.bxor(serial.hextodecimal(Byte1), serial.hextodecimal(Byte2)) == 240 then --This is an RFX Sensor

if self.PreviousCommand == data and win.GetElapsedMilliseconds &#40;self.PreviousCommandTime&#41; < self.AntirepeatTime then -- same command therefore block

if serial.bextract&#40;serial.hextodecimal&#40;Byte4&#41;, 5, 5&#41; == 0 then --No errors or info present

local Temperature = serial.hextodecimal&#40;Byte3&#41;

if serial.bextract&#40;serial.hextodecimal&#40;Byte4&#41;, 8, 8&#41; then
Temperature = Temperature + 0.5;
end;

gir.TriggerEvent&#40;"RFXSensor "..serial.hextodecimal&#40;Byte1&#41;.." ,"..Temperature, self.PluginID, serial.hextodecimal&#40;Byte1&#41;, Temperature&#41;

else --Error or info present
if serial.hextodecimal&#40;Byte3&#41; == 01 then ErrorInfo = "Sensor Address Incremented"--Only able to test this one.
elseif serial.hextodecimal&#40;Byte3&#41; == 02 then ErrorInfo = "Low Voltage"-- This may only work on some sensors
elseif serial.hextodecimal&#40;Byte3&#41; == 81 then ErrorInfo = "No 1-Wrie Device Connected"
elseif serial.hextodecimal&#40;Byte3&#41; == 82 then ErrorInfo = "1-Wire ROM CRC Error"
elseif serial.hextodecimal&#40;Byte3&#41; == 83 then ErrorInfo = "1-Wire Device Connected is not a DS1820"
elseif serial.hextodecimal&#40;Byte3&#41; == 84 then ErrorInfo = "No end of read signal received from 1-Wire Device"
elseif serial.hextodecimal&#40;Byte3&#41; == 85 then ErrorInfo = "1-Wire Scratchpad CRC error"
--else ErrorInfo = "Unspecified Error" --This will show after a reset, unsure if this should be kept.
end;

gir.LogMessage&#40;"RFX Sensor", "Error or Info&#58; ".. ErrorInfo, 2&#41;;
end;

serial.Classes.Simple.ReceiveResponse &#40;self,data,code&#41;
return
end

self.PreviousCommand = data
self.PreviousCommandTime = win.GetElapsedMilliseconds &#40;&#41;

end
-------------------------------------------------------------Dan's RFXSensor Stuff end's

It would be nice if like the x10 device's when a new address is found you could name the device "Lounge Temperature", etc. I just can't figure it out, at the moment thou.

I would be grateful if you could cast your pro eye over the above, and let me know if I have done anything silly.

Promixis
March 5th, 2006, 08:29 AM
That looks good.

Probably need a seperate dui page for naming etc.

The best example of good dui coding is in the ambient light ui file.

danward79
March 5th, 2006, 09:14 AM
Thanks Mike,

I will check it out.

danward79
March 5th, 2006, 11:55 AM
Hey Mike.

This looks like you could find it usefull, it has all the x10 formats in one document
http://www.rfxcom.com/X10%20RF%20formats.pdf

danward79
March 6th, 2006, 04:10 PM
Hi Chaps,

I believe Bert the man from RFXCom has updated all the documents linked in this thread.

Anyway. Is there an easy way of calculating signed 2's compliment numbers, perhaps using an lua function?

This is what I am refering too -1 = 0xFF, -2 = 0xFE, etc.

I can think of a simple arithmatic way of doing it. :wink:

danward79
March 7th, 2006, 12:02 AM
Mike,

I have noted some strange behaviour.

I have notice that the logger is not showing all events that are occuring, from the W800 plugin. it is however generating the events as causing a script action I have to run and that is printing a statement. So I can see when the script was run in the lua console.

This seems happen during long periods away from the machine i.e at night and when I am at work.

Have you seen this before?

Promixis
March 7th, 2006, 12:41 PM
Mike,

I have noted some strange behaviour.

I have notice that the logger is not showing all events that are occuring, from the W800 plugin. it is however generating the events as causing a script action I have to run and that is printing a statement. So I can see when the script was run in the lua console.

This seems happen during long periods away from the machine i.e at night and when I am at work.

Have you seen this before?

No, this might be worth a new thread if its a real problem because it shouldn't be plugin specific...

Promixis
March 7th, 2006, 12:44 PM
Hi Chaps,

I believe Bert the man from RFXCom has updated all the documents linked in this thread.

Anyway. Is there an easy way of calculating signed 2's compliment numbers, perhaps using an lua function?

This is what I am refering too -1 = 0xFF, -2 = 0xFE, etc.

I can think of a simple arithmatic way of doing it. :wink:

256 - x?

danward79
March 7th, 2006, 01:09 PM
Thanks Mike,

That is what I thought.

On the event issue I have created another thread.