fix cutoff
This commit is contained in:
@@ -1651,14 +1651,16 @@ async def write_inverter_setpoints(
|
||||
r179 = await mb179.read_holding_registers(179, 1, unit_id)
|
||||
if r179 and len(r179) >= 1:
|
||||
current_179 = int(r179[0])
|
||||
new_179 = (current_179 & ~REG179_MI_EXPORT_MASK) | int(target_bits)
|
||||
registers.append((179, "control_board_special_1", new_179))
|
||||
# Deye firmware/UI u některých instalací neinterpretuje jen bits0–1 maskou,
|
||||
# ale očekává přímo hodnotu 2/3. Proto zapisujeme "clean" 2/3 (bez RMW),
|
||||
# aby se cutoff skutečně projevil i v UI.
|
||||
registers.append((179, "control_board_special_1", int(target_bits)))
|
||||
logger.info(
|
||||
"[control] %s: reg179 MI cutoff %s (old=%s new=%s mask=0x%04X)",
|
||||
inv.code,
|
||||
"ON" if want_cutoff else "OFF",
|
||||
current_179,
|
||||
new_179,
|
||||
int(target_bits),
|
||||
REG179_MI_EXPORT_MASK,
|
||||
)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user