cremalink.ecam.monitor_bits module

Monitor frame bit tables — the machine’s switch and alarm words.

Names come from the official enums in Coffee Link 4.9.6 (m6.p for switches, m6.l for alarms); see research/protocol.md Registers 4.1 and 4.2. Values are the raw bit states — whether a set bit means “fault” or “present” is given by each label.

The switches word is 2 bytes (bit n = switches[n // 8] >> n % 8); the alarms word is 4 bytes assembled from non-contiguous payload bytes by MonitorFrame.

cremalink.ecam.monitor_bits.ALARM_BITS: dict[int, BitDef] = {2: ('descale', 'Descale Needed', True), 3: ('replace_water_filter', 'Replace Water Filter', True), 4: ('ground_too_fine', 'Coffee Ground Too Fine', True), 5: ('beans_empty', 'Coffee Beans Empty', True), 6: ('machine_to_service', 'Service Required', True), 7: ('heater_probe_failure', 'Coffee Heater Probe Failure', True), 8: ('too_much_coffee', 'Too Much Coffee', True), 9: ('infuser_motor_not_working', 'Infuser Motor Not Working', True), 10: ('steamer_probe_failure', 'Steamer Probe Failure', True), 11: ('empty_drip_tray', 'Empty Drip Tray', True), 12: ('hydraulic_circuit_problem', 'Hydraulic Circuit Problem', True), 14: ('clean_knob', 'Clean Knob', True), 15: ('beans_empty_hopper_2', 'Coffee Beans Empty (Hopper 2)', False), 16: ('tank_too_full', 'Water Tank Too Full', True), 17: ('bean_hopper_absent', 'Bean Hopper Absent', False), 18: ('grid_presence', 'Drip Grid Presence', True), 19: ('infuser_not_in_position', 'Infuser Not In Position', True), 20: ('not_enough_coffee', 'Not Enough Coffee', True), 21: ('expansion_comm_problem', 'Expansion Module Comm Problem', False), 22: ('expansion_submodules_problem', 'Expansion Submodule Problem', False), 23: ('grinding_unit_1_problem', 'Grinding Unit 1 Problem', False), 24: ('grinding_unit_2_problem', 'Grinding Unit 2 Problem', False), 25: ('condense_fan_problem', 'Condense Fan Problem', False), 26: ('clock_bt_comm_problem', 'Clock Board Comm Problem', False), 27: ('spi_comm_problem', 'SPI Comm Problem', False)}

Alarm bits. Bits 0, 1 and 13 (water tank empty / waste container full / tank in position) are exposed by the dedicated is_watertank_* and is_waste_container_full flags. Bits 28-31 are unmapped.

class cremalink.ecam.monitor_bits.BitDef(key: str, label: str, common: bool = True)[source]

Bases: NamedTuple

One documented monitor bit.

common: bool

expose, but off by default.

Type:

Rare hardware faults / dual-hopper bits

key: str

Alias for field number 0

label: str

Alias for field number 1

cremalink.ecam.monitor_bits.SWITCH_BITS: dict[int, BitDef] = {0: ('water_spout', 'Water Spout', True), 1: ('motor_up', 'Motor Up', True), 2: ('motor_down', 'Motor Down', True), 4: ('water_tank_absent', 'Water Tank Absent', True), 5: ('knob', 'Knob', True), 6: ('water_level_low', 'Water Level Low', True), 7: ('coffee_jug_present', 'Coffee Jug Present', True), 8: ('milk_carafe_present', 'Milk Carafe Present', True), 9: ('choco_tank_present', 'Chocolate Tank Present', True), 10: ('clean_knob', 'Clean Knob', True), 13: ('door_opened', 'Door Opened', True), 14: ('preground_door_opened', 'Preground Door Opened', True)}

Switch bits. Bits 11, 12 and 15 are unmapped (cold-milk accessory bits on striker/maestosa models). Bit 3 (waste container) is exposed by the dedicated is_waste_container_missing flag instead.

cremalink.ecam.monitor_bits.decode_bits(word: bytes, table: dict[int, BitDef]) → dict[str, bool | None][source]

{key: bit state} for every documented bit of word.

A bit whose byte is missing (a short frame) maps to None rather than False — absent data is not a cleared bit.