Re: btmon, emoncms and GEM - Volts, Current, Power Factor
Posted: Fri Feb 19, 2016 10:41 pm
Interesting that wci68 has been working on this simultaneously as I have.
With great thanks to awtivy, I've finally figured out a bit clearer what is going on with btmon and the GEM.
It would be great to have the btmon updated just a bit to include the volts and amps, and it could be as part of a question and answer option if somebody knows how to program that.
I have followed awtivy's instructions, but it seems that there is an error of omission for 1768, as it didn't work until I put that in. (I have it listed as ch%d_amp, I'm not sure if you changed it to a different name from _amp what would happen. It shows up on the emoncms inputs though as _a and not _amp and I'm not sure why but it didn't really matter to me as long as it seems to work.) Also, for line 1720 I changed the number of channels from 32 to 40, in order to generate more inputs to work with in emoncms for calculating feeds. I was also able to get volts appended too from awtivy's revised 6/23/2015 posting. (And for those who need basic instructions, such as myself, the line numbers are for guidance only and aren't typed in as part of the instructions. I also made a comment with the # date initials method so that I could easily search and see which lines were changed. And finally I changed the name of btmon.3.1.1.py to btmon.3.1.1a.py so I would still have the original btmon present to double-check with.)
Also, emoncms was initially set up and running with btmon without the amperage channels and the voltage, but seemed to do fine adding them with the modified btmon when it initially and subsequently was running.
(Revised 2/20/2016 to correct mistake on line 1801 (originally incorrectly listed as 487 instead of 486.)
With great thanks to awtivy, I've finally figured out a bit clearer what is going on with btmon and the GEM.
It would be great to have the btmon updated just a bit to include the volts and amps, and it could be as part of a question and answer option if somebody knows how to program that.
I have followed awtivy's instructions, but it seems that there is an error of omission for 1768, as it didn't work until I put that in. (I have it listed as ch%d_amp, I'm not sure if you changed it to a different name from _amp what would happen. It shows up on the emoncms inputs though as _a and not _amp and I'm not sure why but it didn't really matter to me as long as it seems to work.) Also, for line 1720 I changed the number of channels from 32 to 40, in order to generate more inputs to work with in emoncms for calculating feeds. I was also able to get volts appended too from awtivy's revised 6/23/2015 posting. (And for those who need basic instructions, such as myself, the line numbers are for guidance only and aren't typed in as part of the instructions. I also made a comment with the # date initials method so that I could easily search and see which lines were changed. And finally I changed the name of btmon.3.1.1.py to btmon.3.1.1a.py so I would still have the original btmon present to double-check with.)
Code: Select all
932 FILTER_CURRENT = 'current'
1720 self.NUM_CHAN = 40
1766 elif fltr == FILTER_CURRENT:
1767 for x in range(1, self.NUM_CHAN + 1):
1768 c.append('ch%d_amp' % x)
1800 for x in range (1, self.NUM_CHAN + 1):
1801 cpkt['ch%d_a' % x] = self._convert(rpkt[486+2*(x-1):486+2*x]
3760 for idx, c in enumerate (PACKET_FORMAT.channels(FILTER_PE_LABELS)):
3761 data.append('%s_a:%.2f' % (mklabel(osn, c), p[c+'_a']))
3768 data.append('%s:%.1f' % (mklabel(osn, 'volts'),p['volts']))
(Revised 2/20/2016 to correct mistake on line 1801 (originally incorrectly listed as 487 instead of 486.)