Help with Solar Channel Setup

Ask questions about the GEM here.
SirMaple
Posts: 70
Joined: Sat Aug 08, 2015 11:37 pm
Location: Canada

Help with Solar Channel Setup

Post by SirMaple » Fri Apr 21, 2023 9:19 am

So I've recently had solar installed on my house and garage. On-grid with micro-inverters on the roof under the panels. I'm hoping to monitor each.

So the layout is:

Garage Solar Array -> Garage Sub Panel -> Main Panel in House
House Solar Array -> New House Sub Panel -> Main Panel in House

I currently monitor the Garage Sub Panel as a whole from the breaker in the Main Panel. I don't monitor the House Sub Panel as a whole and don't think I need to.

I was planning to extent a single CT out to the Garage Sub Panel to monitor the Garage Solar breaker on it's own GEM Channel. I've got CAT6 running underground between the two buildings.

I also was planning to monitor the House Solar breaker in the House Sub Panel on it's own GEM Channel as well.

So what I need a better understanding on is how to configure the channels and what my planned setup will do to readings on other GEM Channels.

Solar GEM Channels get set to NET, correct?

I think I need to change my Main GEM Channel to NET as well, correct?

Now with the Garage Solar breaker GEM Channel set to NET what will that do to the GEM Channel that monitors the Garage Sub Panel as a whole? Do I need to set this GEM Channel as NET as well?

Thanks!
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: Help with Solar Channel Setup

Post by ben » Fri Apr 21, 2023 10:03 am

SirMaple wrote:
Fri Apr 21, 2023 9:19 am
So I've recently had solar installed on my house and garage. On-grid with micro-inverters on the roof under the panels. I'm hoping to monitor each.

So the layout is:

Garage Solar Array -> Garage Sub Panel -> Main Panel in House
House Solar Array -> New House Sub Panel -> Main Panel in House

I currently monitor the Garage Sub Panel as a whole from the breaker in the Main Panel. I don't monitor the House Sub Panel as a whole and don't think I need to.

I was planning to extent a single CT out to the Garage Sub Panel to monitor the Garage Solar breaker on it's own GEM Channel. I've got CAT6 running underground between the two buildings.

I also was planning to monitor the House Solar breaker in the House Sub Panel on it's own GEM Channel as well.

So what I need a better understanding on is how to configure the channels and what my planned setup will do to readings on other GEM Channels.

Solar GEM Channels get set to NET, correct?

I think I need to change my Main GEM Channel to NET as well, correct?

Now with the Garage Solar breaker GEM Channel set to NET what will that do to the GEM Channel that monitors the Garage Sub Panel as a whole? Do I need to set this GEM Channel as NET as well?

Thanks!
Yeah, looks correct.

The NET channels will create 2 new channels for the Mains/Subs. If you have the backup user configured I'd consider doing a copy-over on the hourdata and daydata tables when you have the new channel_ids on the sub panel and main panel channels. I've used this program to connect to the DB remotely: https://dbeaver.io/

Something like:

Code: Select all

INSERT INTO hourdata 
SELECT 'YYYY', date, wattseconds, watt, kwh, seconds, cost, totalcost, amps, peakwatt, minwatt
FROM hourdata
WHERE channel_id = XXXX;

INSERT INTO daydata
SELECT 'YYYY', date, num_rec, kwh, totalcost, min_watt, max_watt, avg_watt
FROM daydata
WHERE channel_id = XXXX;
YYYY = the new channel_id
XXXX = the original channel_id

You can get both IDs by clicking the channel under the Channels section, it'll show up in the browser bar under c1=XXXX

Email me if you need any help setting the client up.
Ben
Brultech Research Inc.
E: ben(at)brultech.com
SirMaple
Posts: 70
Joined: Sat Aug 08, 2015 11:37 pm
Location: Canada

Re: Help with Solar Channel Setup

Post by SirMaple » Fri Apr 28, 2023 8:20 am

So I got the CTs installed on the House Solar breakers. I also connected the CAT6 leading to the Garage to the GEM(No CTs connected yet in the Garage).

Few things I've noticed:

- House Solar Channels are reporting values when the breakers are off. Breakers are 30AMP Double Pole so the CT wires are connected black/white and black/white. Channel 31 is Garage Solar and Channel 32 is House Solar. I disconnected the Garage wires from Channel 31 after taking this picture and plan to reconnect them this weekend)
Screenshot 2023-04-28 at 8.05.52 AM.png
Screenshot 2023-04-28 at 8.05.52 AM.png (13.86 KiB) Viewed 14454 times
Screenshot 2023-04-28 at 7.17.17 AM.png
Screenshot 2023-04-28 at 7.17.17 AM.png (1.38 MiB) Viewed 14457 times
- Also when I had the wires for the Garage Solar connected(but no CTs) they were also showing values. I disconnected those ones for now since I plan to install the CTs this weekend.

- MQTT. The channel numbers don't seem to line up. How do I know which is which physical GEM channel? Is it possible to have it so the "NET" channels are reported in MQTT as "ch32_net"?
Screenshot 2023-04-28 at 7.12.00 AM.png
Screenshot 2023-04-28 at 7.12.00 AM.png (27.76 KiB) Viewed 14457 times

For now I'm holding off on adjusting the database. It's not the end of the world if I lose some data. I do back it up twice a day so I can merge and adjust a backup file and then restore if required.
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: Help with Solar Channel Setup

Post by ben » Fri Apr 28, 2023 11:45 am

Do you have a piece of wire you can add between ports 3,4 of one of those GEM channels? It's possible the CT leads are picking up a little noise depending on how they were run. Adding the wire will add a little resistance to the channel.
- MQTT. The channel numbers don't seem to line up. How do I know which is which physical GEM channel? Is it possible to have it so the "NET" channels are reported in MQTT as "ch32_net"?
Yeah, good idea, I'll look into that.
Ben
Brultech Research Inc.
E: ben(at)brultech.com
SirMaple
Posts: 70
Joined: Sat Aug 08, 2015 11:37 pm
Location: Canada

Re: Help with Solar Channel Setup

Post by SirMaple » Fri Apr 28, 2023 12:52 pm

I'll give the jumper a try this weekend.

I decided to go ahead with the database copy over but I'm getting an error.

Code: Select all

Error occurred during SQL query execution

Reason:
SQL Error [42601]: Unterminated string literal started at position 29 in SQL INSERT INTO hourdata 
SELECT '2386, date, wattseconds, watt, kwh, seconds, cost, totalcost, amps, peakwatt, minwatt
FROM hourdata
WHERE channel_id = 2341;. Expected  char
Screenshot attached as well.
Attachments
Screenshot 2023-04-28 at 11.49.39 AM.png
Screenshot 2023-04-28 at 11.49.39 AM.png (1.2 MiB) Viewed 14451 times
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: Help with Solar Channel Setup

Post by ben » Fri Apr 28, 2023 1:20 pm

Missing a single quote on the end of 2386, edited my post.
Ben
Brultech Research Inc.
E: ben(at)brultech.com
SirMaple
Posts: 70
Joined: Sat Aug 08, 2015 11:37 pm
Location: Canada

Re: Help with Solar Channel Setup

Post by SirMaple » Fri Apr 28, 2023 1:39 pm

ben wrote:
Fri Apr 28, 2023 1:20 pm
Missing a single quote on the end of 2386, edited my post.
Getting somewhere now but still getting errors.

Command:

Code: Select all

INSERT INTO hourdata 
SELECT '2386', date, wattseconds, watt, kwh, seconds, cost, totalcost, amps, peakwatt, minwatt
FROM hourdata
WHERE channel_id = 2341;
Error:

Code: Select all

Error occurred during SQL query execution

Reason:
SQL Error [42703]: ERROR: column "wattseconds" does not exist
  Position: 44
If I remove the "s" from the end of "wattseconds" I get this error:

Code: Select all

Error occurred during SQL query execution

Reason:
SQL Error [42804]: ERROR: column "channel_id" is of type smallint but expression is of type timestamp without time zone
  Hint: You will need to rewrite or cast the expression.
  Position: 38
Command:

Code: Select all

INSERT INTO daydata
SELECT '2386', date, num_rec, kwh, totalcost, min_watt, max_watt, avg_watt
FROM daydata
WHERE channel_id = 2341;
Error:

Code: Select all

Error occurred during SQL query execution

Reason:
SQL Error [23505]: ERROR: duplicate key value violates unique constraint "daydata_pkey"
  Detail: Key (channel_id, date)=(2386, 2023-04-27 00:00:00) already exists.
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: Help with Solar Channel Setup

Post by ben » Fri Apr 28, 2023 2:47 pm

INSERT INTO daydata
SELECT '2386', date, num_rec, kwh, totalcost, min_watt, max_watt, avg_watt
FROM daydata
WHERE channel_id = 2341
AND date < '2023-04-27 00:00:00';

Can you do a

select * from hourdata limit 1;

And post the result (interested in column order).
Ben
Brultech Research Inc.
E: ben(at)brultech.com
SirMaple
Posts: 70
Joined: Sat Aug 08, 2015 11:37 pm
Location: Canada

Re: Help with Solar Channel Setup

Post by SirMaple » Sat Apr 29, 2023 9:33 am

ben wrote:
Fri Apr 28, 2023 2:47 pm
INSERT INTO daydata
SELECT '2386', date, num_rec, kwh, totalcost, min_watt, max_watt, avg_watt
FROM daydata
WHERE channel_id = 2341
AND date < '2023-04-27 00:00:00';

Can you do a

select * from hourdata limit 1;

And post the result (interested in column order).
Perfect. daydata has been updated successfully for the 2 channels that needed it.

The output for hourdata is:
Screenshot 2023-04-29 at 8.32.36 AM.png
Screenshot 2023-04-29 at 8.32.36 AM.png (125.14 KiB) Viewed 14442 times
I'm on a 4K display so screenshot might be a little big.
ben
Site Admin
Posts: 4262
Joined: Fri Jun 04, 2010 9:39 am

Re: Help with Solar Channel Setup

Post by ben » Mon May 01, 2023 1:37 pm

Try

INSERT INTO hourdata (channel_id, date, wattsecond, watt, kwh, seconds, cost, totalcost, amps, peakwatt, minwatt)
SELECT '2386', date, wattsecond, watt, kwh, seconds, cost, totalcost, amps, peakwatt, minwatt
FROM hourdata
WHERE channel_id = 2341
AND date < (select min(date) from hourdata where channel_id = 2386);
Ben
Brultech Research Inc.
E: ben(at)brultech.com
Post Reply