Re: [mh] Whole home power monitoring

H Plato <[email protected]> Mon, 24 May 2021 11:53:45 -0600
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <[email protected]>
I bought this off ebay:

DVB-T USB TV FM+DAB Radio Tuner Receiver Stick Realtek RTL2832U+R820T MCX

Cost me $10 w/ shipping.

I’ve got the data in MH with a custom perl script that I run in the background (below). Now I’m just creating  per minute totalizers for the deltas and I can use the new RRD object method to log the minute by minute changes. That should give me the daily usage patterns (I hope!)

#!/usr/bin/perl

my $host = "127.0.0.1";
my $topic_root = "utilities";
my $debug = 0;
my %mqtt_obj_name;
$mqtt_obj_name{30273954} = "water_meter";
$mqtt_obj_name{45275962} = "gas_meter";
$mqtt_obj_name{3442387}  = "power_meter";

open (RTLAMR, "/usr/local/bin/rtlamr -server=127.0.0.1:1432|");

#my $var="{Time:2021-05-23T12:57:52.339 SCM:{ID:30273954 Type:13 Tamper:{Phy:00 Enc:00} Consumption:  224471 CRC:0x5689}}";

while (<RTLAMR>) {

   chomp ($_);

   print "** $_ \n" if ($debug);
   my ($id, $type, $consumption) = ($_ =~ /ID:\s*(\d+) Type:\s*(\d+).*Consumption:\s*(\d+)/);

   my $topic = $mqtt_obj_name{$id};

   if ($topic) {

       print "mosquitto_pub -h $host -t $topic_root/$topic -m \"$consumption\"\n" if ($debug);
       system "mosquitto_pub -h $host -t $topic_root/$topic -m \"$consumption\"";
    
   } else {

       print "unknown ID $id\n" if ($debug);
    
   }
}

> On May 24, 2021, at 10:53 AM, Eloy Paris <[email protected]> wrote:
> 
> Hhmmm. That looks pretty cool. Gas, electricity, and water have smart
> meters where I live (as far as I know). I thought all the information
> was encrypted but perhaps I should make sure...
> 
> Do you have a link to the USB dongle that you are using to listen to
> what your meters are sending?
> 
> Cheers,
> 
> Eloy Paris.-
> 
> Le dimanche 23 mai 2021 à 16:52 -0600, H Plato a écrit :
>> I’m looking to add 2 additional 240V circuits, one for an outdoor IR
>> patio heater, and another for a steam generator. Having an idea of
>> overall usage will give me an idea of power peaks and the general
>> load. 
>> 
>> I actually coded support for the sonoff power monitoring plug. I
>> think I updated master. I also added in RRD support for any item so
>> that they can be graphed in IA7.
>> 
>> The RTLAMR stuff is pretty neat if you have smart meters. I think I
>> spent $20 on a USB Software defined radio adapter, and I can see my
>> gas, water, and power meter updates in near real time. I think I’m
>> going to pipe the output to a perl script that will take a matching
>> ID and then send an update out via MQTT, unless anyone else has any
>> ideas?
>> 
>> This is the output:
>> 
>> 30273954 is my water meter
>> 45275915 is my gas meter
>> 3442387 is my power meter
>> 
>> mh@s1:~# rtlamr -server=127.0.0.1:1432
>> 16:38:54.987638 decode.go:45: CenterFreq: 912600155
>> 16:38:55.046947 decode.go:46: SampleRate: 2359296
>> 16:38:55.046964 decode.go:47: DataRate: 32768
>> 16:38:55.046974 decode.go:48: ChipLength: 72
>> 16:38:55.046985 decode.go:49: PreambleSymbols: 21
>> 16:38:55.046995 decode.go:50: PreambleLength: 3024
>> 16:38:55.047005 decode.go:51: PacketSymbols: 96
>> 16:38:55.047015 decode.go:52: PacketLength: 13824
>> 16:38:55.047028 decode.go:59: Protocols: scm
>> 16:38:55.047038 decode.go:60: Preambles: 111110010101001100000
>> 16:38:55.047049 main.go:124: GainCount: 29
>> {Time:2021-05-23T16:38:58.575 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:39:12.963 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:39:19.966 SCM:{ID:45275915 Type:12 Tamper:{Phy:00
>> Enc:00} Consumption:  911664 CRC:0x162A}}
>> {Time:2021-05-23T16:39:26.690 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:39:40.907 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:39:41.297 SCM:{ID: 3442387 Type: 5 Tamper:{Phy:01
>> Enc:03} Consumption: 9848673 CRC:0xEDB3}}
>> {Time:2021-05-23T16:39:43.745 SCM:{ID:45275962 Type:12 Tamper:{Phy:02
>> Enc:00} Consumption:  138690 CRC:0xEE5E}}
>> {Time:2021-05-23T16:39:54.578 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:40:01.964 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:40:03.968 SCM:{ID:45275915 Type:12 Tamper:{Phy:00
>> Enc:00} Consumption:  911664 CRC:0x162A}}
>> {Time:2021-05-23T16:40:19.968 SCM:{ID:45275915 Type:12 Tamper:{Phy:00
>> Enc:00} Consumption:  911664 CRC:0x162A}}
>> {Time:2021-05-23T16:40:29.523 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:40:41.300 SCM:{ID: 3442387 Type: 5 Tamper:{Phy:01
>> Enc:03} Consumption: 9848686 CRC:0xEB81}}
>> {Time:2021-05-23T16:40:57.748 SCM:{ID:45275962 Type:12 Tamper:{Phy:02
>> Enc:00} Consumption:  138691 CRC:0x0CBC}}
>> {Time:2021-05-23T16:41:11.302 SCM:{ID: 3442387 Type: 5 Tamper:{Phy:01
>> Enc:03} Consumption: 9848692 CRC:0xDDC8}}
>> {Time:2021-05-23T16:41:19.972 SCM:{ID:45275915 Type:12 Tamper:{Phy:00
>> Enc:00} Consumption:  911665 CRC:0xF4C8}}
>> {Time:2021-05-23T16:41:32.640 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:41:33.973 SCM:{ID:45275915 Type:12 Tamper:{Phy:00
>> Enc:00} Consumption:  911665 CRC:0xF4C8}}
>> {Time:2021-05-23T16:41:43.251 SCM:{ID:45275962 Type:12 Tamper:{Phy:02
>> Enc:00} Consumption:  138691 CRC:0x0CBC}}
>> {Time:2021-05-23T16:41:46.642 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:42:00.754 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:42:04.475 SCM:{ID:45275915 Type:12 Tamper:{Phy:00
>> Enc:00} Consumption:  911666 CRC:0xBC8D}}
>> {Time:2021-05-23T16:42:11.805 SCM:{ID: 3442387 Type: 5 Tamper:{Phy:01
>> Enc:03} Consumption: 9848704 CRC:0x84C5}}
>> {Time:2021-05-23T16:42:27.753 SCM:{ID:45275962 Type:12 Tamper:{Phy:02
>> Enc:00} Consumption:  138692 CRC:0x7ED4}}
>> {Time:2021-05-23T16:42:42.920 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:42:56.531 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:43:04.979 SCM:{ID:45275915 Type:12 Tamper:{Phy:00
>> Enc:00} Consumption:  911666 CRC:0xBC8D}}
>> {Time:2021-05-23T16:43:10.308 SCM:{ID: 3442387 Type: 5 Tamper:{Phy:01
>> Enc:03} Consumption: 9848716 CRC:0xCAB2}}
>> {Time:2021-05-23T16:43:17.704 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:43:45.592 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> {Time:2021-05-23T16:43:59.979 SCM:{ID:30273954 Type:13 Tamper:{Phy:00
>> Enc:00} Consumption:  224484 CRC:0x4873}}
>> 
>> 
>>> On May 23, 2021, at 4:04 PM, Jeff Siddall via misterhouse-users
>>> <[email protected]> wrote:
>>> 
>>> On 5/23/21 10:41 AM, H Plato wrote:
>>>> Has anyone found any good DIY power monitoring solutions? My
>>>> panel is full and I’d to get an idea of the average and peak
>>>> load. I have a 100a service, and the wiring from the utility
>>>> isn’t sized for 200a, so an upgrade would be pretty expensive.
>>>> I’m hoping that the usage is low enough that I can just replace
>>>> the panel without upgrading the service, so having usage tracking
>>>> would be really helpful.
>>> 
>>> Are you planning on adding new electrical devices/appliances, or
>>> just more outlets/lights?
>>> 
>>> Ultimately, the size of your service determines how many "things"
>>> can be running at the same time.  If you aren't adding (or many)
>>> more "things" then you likely don't need a bigger service
>>> regardless of how many breakers/fuses you add.
>>> 
>>> If you want to be a little more scientific without spending any
>>> money you can fire up a spreadsheet.  Getting average power usage
>>> is pretty easy: get the total kWh from your power bill and divide
>>> it by the number of hours in the billing period.  Getting peak
>>> current, which can tell you how close you are to exceeding your
>>> service capacity, is much trickier.  However, you might be able to
>>> get a rough estimate simply by looking up the power rating of all
>>> your electrical equipment and adding it all up.  That would
>>> simulate a worst-case scenario, like after a power outage, when
>>> everything tends to come on at once.  Start with the power hungry
>>> things, like electric heaters, AC units, electric range, electric
>>> clothes dryer, fridges, freezers, microwave, dishwasher etc.
>>> 
>>> Even better, at least for plug-in appliances, is to get a plug-in
>>> power meter such as a Kill-A-Watt and find out what your power
>>> hungry devices draw, then add those up.
>>> 
>>> Good luck!
>>> 
>>> 
>>> 
>>> ________________________________________________________
>>> To unsubscribe from this list, go to:
>>> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>>> 
>> 
>> 
>> 
>> ________________________________________________________
>> To unsubscribe from this list, go to:
>> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>> 
> 
> 



________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users