Repository navigation
Set Grid meter Settings via HA #193
morkfromork72
started this conversation in
Ideas
Replies: 2 comments 2 replies
|
Which CT setting specifically do you want to change? |
1 reply
|
Hi Wilfried,
If build two functions in python whick can help you I Think:
def decode_meter_value(value):
"""Decodeert de U16 waarde van register 43140 naar locatie en type."""
METER_LOCATION_MAP = {0x0100: "Grid", 0x0200: "Load", 0x0300: "Grid+PV
(Two Meter)"}
METER_TYPE_MAP = {
0x0001: "General 1Ph", 0x0002: "Acrel 3Ph", 0x0003: "General 3Ph",
0x0004: "Standard Eastron 1Ph", 0x0005: "Standard Eastron 3Ph", 0x
0006: "No Meter Mode"
}
high_byte = value & 0xFF00
low_byte = value & 0x00FF
location = METER_LOCATION_MAP.get(high_byte, f"Onbekend (0x{high_byte
:04x})")
meter_type = METER_TYPE_MAP.get(low_byte, f"Onbekend (0x{low_byte:04x})"
)
return location, meter_type
And
def controleer_en_herstel_meterinstelling(client):
"""Controleert en herstelt de meterinstelling van de Solis omvormer."""
logging.info("--- Start meter instellingen controle en herstel ---")
if not client:
logging.error("Fout: Geen actieve Modbus-verbinding voor
metercontrole.")
return False
for attempt in range(1, MAX_RETRIES_OPERATION + 1):
try:
read_response = client.read_holding_registers(
METER_CONFIG_REGISTER_ADDRESS, 1, slave=MODBUS_INVERTER_UNIT_ID)
if read_response.isError():
raise ConnectionException(f"Modbus leesfout: {read_response}
")
current_value = read_response.registers[0]
if current_value == GEWENSTE_WAARDE:
logging.info("Meter instellingen zijn correct.")
return True
logging.warning(f"Meter instellingen zijn ONJUIST. Aanpassing
noodzakelijk. Huidig: 0x{current_value:04x}, Gewenst: 0x{GEWENSTE_WAARDE
:04x}")
write_response = client.write_register(
METER_CONFIG_REGISTER_ADDRESS, GEWENSTE_WAARDE, slave=
MODBUS_INVERTER_UNIT_ID)
if write_response.isError():
raise ConnectionException(f"Modbus schrijf fout: {
write_response}")
# Verifieer door opnieuw te lezen
verify_response = client.read_holding_registers(
METER_CONFIG_REGISTER_ADDRESS, 1, slave=MODBUS_INVERTER_UNIT_ID)
if verify_response.isError() or verify_response.registers[0] !=
GEWENSTE_WAARDE:
logging.error(f"VERIFICATIE FOUT: Geschreven {
GEWENSTE_WAARDE}, Gelezen {verify_response.registers[0]}")
return False
logging.info("Instellingen hersteld en geverifieerd.")
return True
except (ModbusException, ConnectionException) as e:
logging.warning(f"Poging {attempt}/{MAX_RETRIES_OPERATION} voor
metercontrole: {e}")
if attempt < MAX_RETRIES_OPERATION:
time.sleep(random.uniform(RETRY_MIN_WAIT_SEC,
RETRY_MAX_WAIT_SEC))
continue
else:
logging.critical("MAX POGINGEN BEREIKT voor metercontrole.
Kon niet communiceren.")
return False
except Exception as e:
logging.critical(f"Onverwachte kritieke fout tijdens
metercontrole: {e}", exc_info=True)
return False
Op ma 23 feb 2026 om 13:45 schreef Wilfried-Jordan ***@***.***
…:
Hi,
I would like to know the register to switch between an Eastron 230 1 Phase
and a Eastron 630 3 Phase SmartMeter for a Solis s5 EH1P.
Thanks in advance
Wilfried
—
Reply to this email directly, view it on GitHub
<#193 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BRVOJFAOBVJQHTHURQXDD2T4NLY75AVCNFSM6AAAAACV4V3WHCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKOBZGY2TSNQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi I have a S6 3-Phade HV Hybrid.
Is it possible to add an option to adjust the grid meter settings? The grid meter settings sometimes go to default for me. I would like to monitor and adjust this via HA.
Thanks,
Mark
All reactions