RFXCOM Power, Water and Gas data collection tool

Forum regarding Windows Software and Home Automation Domotica.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by Digit »

Hi all,

I'm thinking of making a data collection tool by means of RFXCOM products, specifically aimed at collecting data for Power, Water and Gas usage.
Well, i already decided to make this tool anyway, but i think this tool could be of interest to more than just those who it's being made for initially.
So, based on the response i get on this topic, maybe i'll add extra 'features' to it make it useable to a larger userbase. So, if you're interested, just reply here.

The tool is planned to be able to do the following:

- Receiving data coming from RFXPower/RFXMeter either by TCP/IP or COMport;
- Storing the measured values in several common formats (CSV, MS SQL Server (MSDE), Access, PCX)

For now, this tool is aimed at users who have a Windows PC running 24/7.

Although this looks very limited, i get the impression more than once that even this is too big of a step for those not familiar with programming, or just don't want to buy software for a complete Home Automation solution, while all that's needed is collecting Power, Water and Gas data...

So, anyone interested? Any questions? (small) Wish-list? Just let me know. My own HA-application has just been started to set a new up-time record, so i have some time the next few weeks...ehhmm..[:D]

Robert.
Niknik
Member
Member
Posts: 255
Joined: Wed Apr 26, 2006 6:22 pm
Location: Portugal
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by Niknik »

I'm interested! :)
I'm still using a "hacked" version of RFXcom that logs the data to a MySQL DB.
(And then have a "client" program that shows the data from the DB into graphic format)
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by Digit »

It has been quiet for some time due to all kinds of other things that have kept me busy, but here's a little update.

Currently in the process of testing/evaluating version 0.9 at 1 site.
Supports TCPIP or serial communication in combination with MSSQL 2000/2005. MSDE should work also.

Any option or enhancement can be developed on demand.

Image

Image
Niknik
Member
Member
Posts: 255
Joined: Wed Apr 26, 2006 6:22 pm
Location: Portugal
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by Niknik »

Does the MS SQL 2000 mode work with MySQL DBs?
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by Digit »

Currently not. I'll need MySQL drivers i guess. I do have a MySQL server up and running here somewhere, but never done anything with it myself. But shouldn't be to hard, only thing is i don't know if EXISTS works the same in MSSQL and MySQL. I'll look into that.
proohu01
Starting Member
Starting Member
Posts: 7
Joined: Sun Feb 22, 2009 7:02 pm
Location: Netherlands
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by proohu01 »

Hello Digit,

I was wondering if the program you were developing is availible for download?

I bought mij own set of rfxcom hardware so I can start monitoring gas, water and energy usage.

The things I want to do, and the way I want it to work, seem to be to difficult for myself right now. You could say I am stuck. I went for the xpl-perl (xpl-rfxcom) version and wanted to inject the results from that to MySQL. From there, I want Cacti (great software for creating <u>any</u> graphs) to get the information from MySQL and create nice graphs from it.

I managed to get xpl-rfxcom working but I have not mastered the injecting into MySQL part. Too bad!

I had a look at a lot of topics in this forum and did not get it working yet. I feel that a couple of toppics might be outdated...?

Anyway, any help from anybody is much appreciated.

I am using:
SLES 10, Apache, PHP5, Perl, MySQL, RFXcom, xpl-rfxcom, Cacti....

.....but I am willing to give it a try on Windows so if you've got that software you were talking about ;-)

Hugo
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by Digit »

Hi Hugo,

It's still around somewhere on my disk :-)
I haven't done much work on this lately, other then trying to convert it to a service running on Windows a few weeks ago, which left me with a memory leak that i haven't been able to solve yet. MySQL is something i have to look into in the near future. Or maybe some other forum members can help you getting the MySQL part working in combination with xpl-rfxcom? Maybe that would be better, considering what you're using. Either way, give me some time (talking about 2-3 weeks) and i'll get back to you.
proohu01
Starting Member
Starting Member
Posts: 7
Joined: Sun Feb 22, 2009 7:02 pm
Location: Netherlands
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by proohu01 »

Thnx for the reply!

I will keep trying in Linux than.
ddgiel
Starting Member
Starting Member
Posts: 25
Joined: Fri Dec 05, 2008 4:20 pm
Location: Belgium

RFXCOM Power, Water and Gas data collection tool

Post by ddgiel »

I'm interested too! :)
I would prefer on Linux if possible, otherwise a virtual machine can be a solution. Data collecting can be done on Windows while MySQL can run under Linux.
lapa78
Starting Member
Starting Member
Posts: 2
Joined: Thu Dec 03, 2009 2:49 pm
Location: Poland

RFXCOM Power, Water and Gas data collection tool

Post by lapa78 »

Hi did you finished your tool for data collection under the windows.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by Digit »

Nope...
Although the start of this topic is only 2 years ago, to me it seems like much longer ago; and a lot has changed since then, one of those things is having less time to work on this. Sorry, but that's just the way it is. And there are alternative ways to accomplish the same, so...

<hr noshade size="1"><font size="1">Robert
http://www.hekkers.net <i>Digit's Online Home.</i></font id="size1">
Niknik
Member
Member
Posts: 255
Joined: Wed Apr 26, 2006 6:22 pm
Location: Portugal
Contact:

RFXCOM Power, Water and Gas data collection tool

Post by Niknik »

Just curious, what setup (software) are you currently using? :)

I've inquired Google to know if they plan to open their PowerMeter for private use... they say they'll eventually do it, but can't say "when".

So, I'm still stuck using my own custom software, but I'd prefer using an open-source solution with continued support, more features, etc.
lapa78
Starting Member
Starting Member
Posts: 2
Joined: Thu Dec 03, 2009 2:49 pm
Location: Poland

RFXCOM Power, Water and Gas data collection tool

Post by lapa78 »

Can you share a little bit of your custom software, becouse pay for rfxcom vb.net is not fair for me. I bought hardware and also I have to pay for software 38 euro. I need only put data in mysql thats All. please :-(.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: RFXCOM Power, Water and Gas data collection tool

Post by Digit »

Hmm, i seem to be missing posts... sorry for the late response.

@niknik:
All software for operating my domotica system is made by myself, from RFXCOM/PLCBUS to Touch screen.
Read more here: http://www.hekkers.net/domotica/DomoticaSoftware.aspx" onclick="window.open(this.href);return false;

@lapa78:
The RFXMeter data format is freely available. If you can't produce your own software based on that, you won't have any benefit from looking at my RFXMeter code, since the database part is not even in there. And parts of the RFXMeter code are mixed with other RFXCOM code based on confidential material. That would mean i would have to start writing new code that i don't use muself. I stopped doing that, unless it concerns a HS Plugin.
User avatar
b_weijenberg
Forum Moderator
Forum Moderator
Posts: 1744
Joined: Sun May 14, 2006 4:32 pm
Location: Netherlands

Re: RFXCOM Power, Water and Gas data collection tool

Post by b_weijenberg »

The RFXMeter software is open and Dec 4th I have sent the message below, with the RFXMeter decoding part of the RFreceiver program, to Piotr and I've received a read response so I don't understand the message above.
The RFreceiver doesn't write data to a SQL db so if that coding part was needed the RFreceiver source would not give any additional information.

The RFXMeter protocol is open and is described in chapter 11 http://www.rfxcom.com/documents/RFXMeter.pdf" onclick="window.open(this.href);return false;
So if this is the only device you like to sample to the sql it must be possible for you to write your decoding program.

Code: Select all

                If recbits = 48 Then 'check if RFXMeter or RFXPower
                    parity = Not ((recbuf(0) >> 4) + (recbuf(0) And &HF) _
                    + (recbuf(1) >> 4) + (recbuf(1) And &HF) _
                    + (recbuf(2) >> 4) + (recbuf(2) And &HF) _
                    + (recbuf(3) >> 4) + (recbuf(3) And &HF) _
                    + (recbuf(4) >> 4) + (recbuf(4) And &HF) _
                    + (recbuf(5) >> 4)) And &HF
                    If (parity = (recbuf(5) And &HF)) And (recbuf(0) + (recbuf(1) Xor &HF) = &HFF) Then
                        processrfxmeter()
                    End If
                End If


    Sub processrfxmeter()
        Dim measured_value As Single

        WriteMessage("           RFXMeter[" & (recbuf(0) * 256 + recbuf(1)).ToString & "]M", False)
        WriteMessage(" RFXMeter addr:" & VB.Right("0" & Hex(recbuf(0)), 2), False)
        WriteMessage(VB.Right("0" & Hex(recbuf(1)), 2), False)
        WriteMessage(" ID:" & Convert.ToString(recbuf(1) + (recbuf(0) * 256)) & " ", False)
        Select Case recbuf(5) And &HF0
            Case &H0
                measured_value = ((recbuf(4) * 65536) + (recbuf(2) * 256) + recbuf(3))
                WriteMessage("RFXMeter: " & Convert.ToString(measured_value), False)
                WriteMessage(";  RFXPower: " & Convert.ToString(measured_value / 100) & " kWh", False)
                WriteMessage(";  RFXPwr-Module: " & Convert.ToString(measured_value / 1000) & " kWh", False)
            Case &H10
                WriteMessage("Interval: ", False)
                Select Case recbuf(2)
                    Case &H1
                        WriteMessage("30 sec.", False)
                    Case &H2
                        WriteMessage("1 min.", False)
                    Case &H4
                        WriteMessage("6 (old=5) min.", False)
                    Case &H8
                        WriteMessage("12 (old=10) min.", False)
                    Case &H10
                        WriteMessage("15 min.", False)
                    Case &H20
                        WriteMessage("30 min.", False)
                    Case &H40
                        WriteMessage("45 min.", False)
                    Case &H80
                        WriteMessage("60 min.", False)
                    Case Else
                        WriteMessage("illegal value", False)
                End Select
            Case &H20
                Select Case (recbuf(4) And &HC0)
                    Case &H0
                        WriteMessage("Input-0 ", False)
                    Case &H40
                        WriteMessage("Input-1 ", False)
                    Case &H80
                        WriteMessage("Input-2 ", False)
                    Case Else
                        WriteMessage("Error, unknown input ", False)
                End Select
                measured_value = (((recbuf(4) And &H3F) * 65536) + (recbuf(2) * 256) + recbuf(3)) / 1000
                WriteMessage("Calibration: " & Convert.ToString(measured_value) & "msec ", False)
                If measured_value <> 0 Then
                    WriteMessage("RFXPower= " & Convert.ToString(Round(1 / ((16 * measured_value) / (3600000 / 100)), 3)) & "kW", False)
                    WriteMessage(" RFXPwr= " & Convert.ToString(Round(1 / ((16 * measured_value) / (3600000 / 62.5)), 3)) & "|" & Convert.ToString(Round((1 / ((16 * measured_value) / (3600000 / 62.5))) * 1.917, 3)) & "kW", False)
                End If
            Case &H30
                WriteMessage("New address set", False)
            Case &H40
                Select Case (recbuf(4) And &HC0)
                    Case &H0
                        WriteMessage("Counter for Input-0 will be set to zero within 5 seconds OR push MODE button for next command.", False)
                    Case &H40
                        WriteMessage("Counter for Input-1 will be set to zero within 5 seconds OR push MODE button for next command.", False)
                    Case &H80
                        WriteMessage("Counter for Input-2 will be set to zero within 5 seconds OR push MODE button for next command.", False)
                    Case Else
                        WriteMessage("Error, unknown input ", False)
                End Select
            Case &H50
                WriteMessage("Push MODE push button within 5 seconds to increment the 1st digit.", False)
                measured_value = (recbuf(2) >> 4) * 100000 + (recbuf(2) And &HF) * 10000 + (recbuf(3) >> 4) _
                * 1000 + (recbuf(3) And &HF) * 100 + (recbuf(4) >> 4) * 10 + (recbuf(4) And &HF)
                WriteMessage("Counter value = " & VB.Right("00000" & Convert.ToString(measured_value), 6), False)
            Case &H60
                WriteMessage("Push MODE push button within 5 seconds to increment the 2nd digit.", False)
                measured_value = (recbuf(2) >> 4) * 100000 + (recbuf(2) And &HF) * 10000 + (recbuf(3) >> 4) _
                * 1000 + (recbuf(3) And &HF) * 100 + (recbuf(4) >> 4) * 10 + (recbuf(4) And &HF)
                WriteMessage("Counter value = " & VB.Right("00000" & Convert.ToString(measured_value), 6), False)
            Case &H70
                WriteMessage("Push MODE push button within 5 seconds to increment the 3rd digit.", False)
                measured_value = (recbuf(2) >> 4) * 100000 + (recbuf(2) And &HF) * 10000 + (recbuf(3) >> 4) _
                * 1000 + (recbuf(3) And &HF) * 100 + (recbuf(4) >> 4) * 10 + (recbuf(4) And &HF)
                WriteMessage("Counter value = " & VB.Right("00000" & Convert.ToString(measured_value), 6), False)
            Case &H80
                WriteMessage("Push MODE push button within 5 seconds to increment the 4th digit.", False)
                measured_value = (recbuf(2) >> 4) * 100000 + (recbuf(2) And &HF) * 10000 + (recbuf(3) >> 4) _
                * 1000 + (recbuf(3) And &HF) * 100 + (recbuf(4) >> 4) * 10 + (recbuf(4) And &HF)
                WriteMessage("Counter value = " & VB.Right("00000" & Convert.ToString(measured_value), 6), False)
            Case &H90
                WriteMessage("Push MODE push button within 5 seconds to increment the 5th digit.", False)
                measured_value = (recbuf(2) >> 4) * 100000 + (recbuf(2) And &HF) * 10000 + (recbuf(3) >> 4) _
                * 1000 + (recbuf(3) And &HF) * 100 + (recbuf(4) >> 4) * 10 + (recbuf(4) And &HF)
                WriteMessage("Counter value = " & VB.Right("00000" & Convert.ToString(measured_value), 6), False)
            Case &HA0
                WriteMessage("Push MODE push button within 5 seconds to increment the 6th digit.", False)
                measured_value = (recbuf(2) >> 4) * 100000 + (recbuf(2) And &HF) * 10000 + (recbuf(3) >> 4) _
                * 1000 + (recbuf(3) And &HF) * 100 + (recbuf(4) >> 4) * 10 + (recbuf(4) And &HF)
                WriteMessage("Counter value = " & VB.Right("00000" & Convert.ToString(measured_value), 6), False)
            Case &HB0
                Select Case recbuf(4)
                    Case &H0
                        WriteMessage("Counter for Input-0 reset to zero.", False)
                    Case &H40
                        WriteMessage("Counter for Input-1 reset to zero.", False)
                    Case &H80
                        WriteMessage("Counter for Input-2 reset to zero.", False)
                    Case Else
                        WriteMessage("protocol error.", False)
                End Select
            Case &HC0
                WriteMessage("Enter SET INTERVAL RATE mode within 5 seconds OR push MODE button for next command.", False)
            Case &HD0
                Select Case (recbuf(4) And &HC0)
                    Case &H0
                        WriteMessage("Enter CALIBRATION mode for Input-0 within 5 seconds OR push MODE button for next command.", False)
                    Case &H40
                        WriteMessage("Enter CALIBRATION mode for Input-1 within 5 seconds OR push MODE button for next command.", False)
                    Case &H80
                        WriteMessage("Enter CALIBRATION mode for Input-2 within 5 seconds OR push MODE button for next command.", False)
                    Case Else
                        WriteMessage("Error, unknown input ", False)
                End Select
            Case &HE0
                WriteMessage("Enter SET ADDRESS mode within 5 seconds OR push MODE button for next command.", False)
            Case &HF0
                If recbuf(2) < &H40 Then
                    WriteMessage("RFXPower Identification,", False)
                ElseIf recbuf(2) < &H80 Then
                    WriteMessage("RFXWater Identification,", False)
                ElseIf recbuf(2) < &HC0 Then
                    WriteMessage("RFXGas Identification,", False)
                Else
                    WriteMessage("RFXMeter Identification,", False)
                End If
                WriteMessage(" Firmware Version: " & VB.Right("0" & Hex(recbuf(2)), 2), False)
                WriteMessage(", Interval rate: ", False)
                Select Case recbuf(3)
                    Case &H1
                        WriteMessage("30 seconds", False)
                    Case &H2
                        WriteMessage("1 minute", False)
                    Case &H4
                        WriteMessage("6 minutes", False)
                    Case &H8
                        WriteMessage("12 minutes", False)
                    Case &H10
                        WriteMessage("15 minutes", False)
                    Case &H20
                        WriteMessage("30 minutes", False)
                    Case &H40
                        WriteMessage("45 minutes", False)
                    Case &H80
                        WriteMessage("60 minutes", False)
                    Case Else
                        WriteMessage("illegal value", False)
                End Select
            Case Else
                WriteMessage("illegal packet type", False)
        End Select
    End Sub
Bert
Post Reply

Return to “Windows Forum”