dxoverdy / Alpha2MQTT

A smart home interface for AlphaESS solar and battery inverters.
GNU General Public License v3.0
45 stars 6 forks source link

Slave or Master? #10

Closed Spookster closed 1 year ago

Spookster commented 1 year ago

Hey, just trying to work through connection issues for a new build on a smile5. Definitions set to :

define INVERTER_SMILE5

I have a working wemos mini and max3485, software loaded, it connects to wireless etc Display shows A2M *WM

Currently I have a bad crc UR/HB and Im trying to trouble shoot it.

Like you, I have blue + blue/white providing 4v, other wires nothing. Ive swapped these 2 around, and it doesnt start with blue connected to A

When I checked the Alpha unit, MODBUS was off. Ive turned it on. Theres also an option for master / slave. Ive tried both, but assume I would use slave.

You also suggest : Make sure the Slave IDs match. Alpha systems use 0x55 by default but if you have changed it on an inverter with an on device interface, change the appropriate line in Definitions.h as documented above.

I havent changed anything, but how would I check this value if required?

image D4 and D5 leds flash on the 385

There is continuity between all connections (as much as I can tell)

Any words of wisdom? Thanks!

dxoverdy commented 1 year ago

And yes with Node Red a tweak can be put in so that neither CONSUMPTION nor GRID nor LOAD are posted as onward MQTT messages to home assistant if over an amount, I'd like to get you a diagnosis :)

dxoverdy commented 1 year ago

It is possible the CT around your main red incomer is not fully shut, or the wire bends slightly through it, or is subject to interference from nearby wiring. Not that I'm advocating you faffing around with pretty substantial electrics, it would be good if you could sense check if the clamp is tightly gripped, slid up to a none-bending part of the wire and also away from nearby wires and connectors?

Spookster commented 1 year ago

Theres about 6 screens to cycle through, all with 2 letter identifiers, none of which are in the manual at first glance We are also running on bat at the moment, so might not see the obvious values. Ill check the clamp is clear

Spookster commented 1 year ago

Anything specific?

image

I assume the 'active power'

dxoverdy commented 1 year ago

active power, so i suspect because you are single phase you'll see stuff like

Pa 03.32 kW (phase 1) Pb 0 (phase 2) Pc 0 (phase 3)

P the sum of the above, so in the example, 03.32kW

Spookster commented 1 year ago

Yep, all zero running on Battery

dxoverdy commented 1 year ago

You may have also wondered why load is not the sum of the pv, grid and battery as per your pic, regardless of being in the same payload. image

That is because the reading for GRID is pulled from the Alpha twice - once to populate the grid value itself, and then pulled a second time a fraction of a second or so later to be used in the load calculation, so in that short amount of time it gave a valid number, then gave a crazy number. It gives you an idea now just how often these garbage figures could be happening but going unnoticed because it wasn't at the exact point when the ten second cycle happened. This could be an issue with the Alpha as opposed to the grid meter, but it is impossible to tell at the moment.

Turn on your oven and kettle and start pulling a few pennies from the grid :D

Spookster commented 1 year ago

I have about $500 of credit to use up already ;) I was aiming for just a break even, but I end up in credit too often... Its winter here, so the A/C will get a hiding.....

Whats the best course of action then?

dxoverdy commented 1 year ago

I would turn on a couple of high power appliances, like your kettle and cooker (if electric) for a 30 second period and see what kind of readings, then turn off. I'd repeat for five minutes or so to give it chance to keep the power changing between high and low. You may find it easier to use "Discharge time control" to disable your battery for an hour so that you just have grid usage for an hour of testing - which will ensure the grid takes a bit of a hammering.

dxoverdy commented 1 year ago

If you want to ignore them.... Use the switch node like so

image

image

In the example there, two output nodes are created. Output 1 is when the value is less than some abitrary number of watts of your choosing. You link output 1 to the MQTT Output, and you can leave output2 empty. You could of course link output2 to another mqtt sensor so you log only the sporadic values in a separate sensor in HA.

jt1971 commented 1 year ago

Good morning.  I too have intermittent spurious data which seems to align with CRC check (I cannot recall the exact phrase).  I did exactly that and introduced filters using node-red.  On 23 May 2023, at 08:13, Daniel Young @.***> wrote: If you want to ignore them.... Use the switch node like so

In the example there, two output nodes are created. Output 1 is when the value is less than some abitrary number of watts of your choosing. You link output 1 to the MQTT Output, and you can leave output2 empty. You could of course link output2 to another mqtt sensor so you log only the sporadic values in a separate sensor in HA.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

Spookster commented 1 year ago

I was just doing something this in NR: - I guess it achieves the same thing and skips all of the data for that 10 seconds, but open to best option?


if (msg.payload.REG_GRID_METER_R_TOTAL_ACTIVE_POWER_1 < 10000) {

msg.payload.CONSUMPTION =
    msg.payload.REG_CUSTOM_TOTAL_SOLAR_POWER
    -
    // Minus feeding, if feeding
    (msg.payload.REG_GRID_METER_R_TOTAL_ACTIVE_POWER_1 < 0 ? Math.abs(msg.payload.REG_GRID_METER_R_TOTAL_ACTIVE_POWER_1) : 0)
    +
    // Plus purchase, if purchasing
    (msg.payload.REG_GRID_METER_R_TOTAL_ACTIVE_POWER_1 > 0 ? msg.payload.REG_GRID_METER_R_TOTAL_ACTIVE_POWER_1 : 0)
    -
    // Minus battery, if charging
    (msg.payload.REG_BATTERY_HOME_R_BATTERY_POWER < 0 ? Math.abs(msg.payload.REG_BATTERY_HOME_R_BATTERY_POWER) : 0)
    +
    // Plus battery, if discharging
    (msg.payload.REG_BATTERY_HOME_R_BATTERY_POWER > 0 ? msg.payload.REG_BATTERY_HOME_R_BATTERY_POWER : 0);

return msg;

}
dxoverdy commented 1 year ago

Whatever you feel most comfortable with :) Switching just keeps away from the javascript, and you have the option to onward process spurious values. Remember to do load, consumption and grid.

Spookster commented 1 year ago

It's sufficient to do all those values in NR ? Ie, they are the source for all the HA sensors?

dxoverdy commented 1 year ago

Just the three.

For some background, Node Red is only really used to take a single ten second state from Alpha2MQTT which contains many readings, and to split that single message into individual MQTT messages, one for each reading which can be easily consumed by Home Assistant.

In a purest form, Node Red isn't needed. You could get away with MQTT sensors in Home Assistant and use Templating (https://www.home-assistant.io/docs/configuration/templating/) to pull out individual readings from a grander message. But, I'm more at home in C / JavaScript / SQL and found the templating language difficult to wrap my head around.

I personally prefer the switching out of posting individual messages, that way, if you have a period of sporadic readings, you wouldn't lose other readings which came in at the same time.

Spookster commented 1 year ago

Sounds good. It's probably reasonable to assume the rogue values come from the ESS , so it's a reasonable bandaid. Thanks so much!

dxoverdy commented 1 year ago

Can I ask what PIN you used to get into the modbus settings please?

Spookster commented 1 year ago

My default is 1 1 1 1

Spookster commented 1 year ago

Just to add to my fix, as the active power figures for export / import are calculated in node red from power absolute, I filtered those outputs too

image

Spookster commented 1 year ago

The other one Im watching is REG_INVERTER_HOME_R_POWER_L1_1 as it also has rogue spikes:

image