History logging production (PV) - linux

Plugwise Forum about Plugwise devices and the Source software.
Post Reply
SevenW
Starting Member
Starting Member
Posts: 26
Joined: Tue May 29, 2012 10:04 am
Contact:

History logging production (PV) - linux

Post by SevenW »

Hi,

I try to figure out how I can get logging of power production out of a circle. Currently I have used linux only, on a synology NAS. I figured out how to convert the actual readings (1s, 8s, hourly) to negative numbers by adapting python-plugwise. However, the history logging (command/reply 0048/0049) results in zero's for each hour the solar panels produce. I have a couple of theory's:

1. I need to upgrade firmware before the logbuffers start containing negative values (requires windows to update firmware, mine is mid 2011).
2. There is a different command/reply set to read production logging.
3. The 0048/0049 command/reply need a different base address from 00044000.
4. Those values are not recorded in the plug. I need to read the 1s, 8s or hourly actual pulse counts.

So does someone have experience with this, or can share insights with me on this?

Frank
SevenW
Starting Member
Starting Member
Posts: 26
Joined: Tue May 29, 2012 10:04 am
Contact:

Re: History logging production (PV) - linux

Post by SevenW »

Update:

Options 3 and 4 can be removed from the list:
I found that I can dump the complete 512kB of memory of the plug by requesting the history buffer 16384 times. From the full memory dump I can see that there is no other memory space with hourly loggings.

I add option 5 to my list:
5. There is command to enable recording of negative (or production) values. This could be related to tariff settings.

So I am affraid that I just have to install Source and use a port sniffer to log the data streams to further analyze how to enable logging of production.
SevenW
Starting Member
Starting Member
Posts: 26
Joined: Tue May 29, 2012 10:04 am
Contact:

Re: History logging production (PV) - linux

Post by SevenW »

Enabling production data logging and controlling the log interval

...so I installed a serial port monitor and plugwise source 2.20 and configured one of the circles as being a producer. Between many commands/responses like 0012/0013 I observed the 0057 command which proved to be the enabler of logging production values: (Leaving out Start, CRC and End)

Code: Select all

S: 0057 <mac> 003C 003C
R: 0000 <seqno> 00C1
R: 0000 <seqno> 00F8 <mac>
The two parameters 0x3C are immidiatelly recognized as 60 for people who programmed embedded stuff in previous lifes. So I interpretted this as a log interval, being 60 minutes, the first for usage, the second for production. Later on, on my linux system I played with those values to proof this. This basically means that the minimal logging interval can be set to one minute. This function is not available form Source. The 0048/0049 get historic logging data now starts to return both positive and negative values.
Before the 0057 command, only production is logged (postive values around 000000EE=238 pulses/60 minutes)

Code: Select all

R: 0049 <seqno> <mac> 0C05A884 000000EE 0C05A8C 0000000EF 0C05A8FC 000000EB 0C05A938 000000ED 00044020
After aplying the 0057 command with 60, 60, the addressed space is interleaved with usage and production values:

Code: Select all

only showing payload
0C05AC76 00000000 0C05AC76 FFFFB836              0C05AC8 000000000  0C05AC80 FFFFBE83
t1       usage=0   t1      prod=-18378            t2       usage=0   t2         prod=-16765
The set interval command does not have to have two identical values. When set to for example usage=10 minutes, production is 2 minutes, the buffer gets written with five (negative) production values, and then one usage value, as can be seen from the payload of three consequetive 0049 responses:

Code: Select all

0C05AC98 FFFFE28B 0C05AC9A FFFFEF8E 0C05AC9C FFFFEEDF 0C05AC9E 00000000
0C05AC9E FFFFEFF0 0C05ACA0 FFFFF477 0C05ACA2 FFFFF712 0C05ACA4 FFFFF8E4
0C05ACA6 FFFFF986 0C05ACA8 00000000 0C05ACA8 FFFFFA32 0C05ACAA FFFFFAF0
So in general, production values are always logged as negative numbers. This also applies to the 0012/0013 command/repsons pair. In this command, the 1s-pulse-count and the 8-second-pulse-count can be both positive and negative, while the one-hour-pulse-count has a separate 32-bit number for usage, (zero or positive), followed by a 32-bit number for production (zero or negative).

Setting the interval
In source it cannot be controlled. One always get 60-minutes log interval. On Linux a circle can now be used to have a recording every minute from the log buffers. The advantage may be that one has a reasonably high resolution, while you do not have to have your computer turned on all the time. Another advantage is that one does not mis a value when software crashes, or a computer has to reboot or something (...hardly ever happens in linux)
Post Reply

Return to “Plugwise Forum”