API

nessclient Core

class nessclient.Client(connection: Optional[nessclient.connection.Connection] = None, host: Optional[str] = None, port: Optional[int] = None, loop: Optional[asyncio.events.AbstractEventLoop] = None, update_interval: int = 60, infer_arming_state: bool = False, alarm: Optional[nessclient.alarm.Alarm] = None)
Parameters:
  • update_interval – Frequency (in seconds) to trigger a full state refresh
  • infer_arming_state – Infer the DISARMED arming state only via system status events. This works around a bug with some panels (<v5.8) which emit update.status = [] when they are armed.
arm_away(code: Optional[str] = None) → None
arm_home(code: Optional[str] = None) → None
aux(output_id: int, state: bool = True) → None
close() → None
disarm(code: str) → None
keepalive() → None
on_event_received(f: Callable[nessclient.event.BaseEvent, None]) → Callable[nessclient.event.BaseEvent, None]
on_state_change(f: Callable[nessclient.alarm.ArmingState, None]) → Callable[nessclient.alarm.ArmingState, None]
on_zone_change(f: Callable[[int, bool], None]) → Callable[[int, bool], None]
panic(code: str) → None
send_command(command: str) → None
update() → None

Force update of alarm status and zones

class nessclient.ArmingState

An enumeration.

ARMED = 'ARMED'
ARMING = 'ARMING'
DISARMED = 'DISARMED'
ENTRY_DELAY = 'ENTRY_DELAY'
EXIT_DELAY = 'EXIT_DELAY'
TRIGGERED = 'TRIGGERED'
UNKNOWN = 'UNKNOWN'

nessclient.event

class nessclient.event.ArmingUpdate(status: List[ArmingUpdate.ArmingStatus], address: Optional[int], timestamp: Optional[datetime.datetime])
class ArmingStatus

Note: The ness provided documentation has the byte endianness incorrectly documented. For this reason, these enum values have reversed byte ordering compared to the ness provided documentation.

This only applies to some enums, and thus must be applied on a case-by-case basis

AREA_1_ARMED = 256
AREA_1_FULLY_ARMED = 1024
AREA_2_ARMED = 512
AREA_2_FULLY_ARMED = 2048
DAY_MODE_ARMED = 8192
DAY_ZONE_SELECT = 4
ENTRY_DELAY_1_ON = 16384
ENTRY_DELAY_2_ON = 32768
MANUAL_EXCLUDE_MODE = 1
MEMORY_MODE = 2
MONITOR_ARMED = 4096
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.ArmingUpdate
encode() → nessclient.packet.Packet
class nessclient.event.AuxiliaryOutputsUpdate(outputs: List[nessclient.event.AuxiliaryOutputsUpdate.OutputType], address: Optional[int], timestamp: Optional[datetime.datetime])
class OutputType

An enumeration.

AUX_1 = 1
AUX_2 = 2
AUX_3 = 4
AUX_4 = 8
AUX_5 = 16
AUX_6 = 32
AUX_7 = 64
AUX_8 = 128
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.AuxiliaryOutputsUpdate
class nessclient.event.BaseEvent(address: Optional[int], timestamp: Optional[datetime.datetime])
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.BaseEvent
encode() → nessclient.packet.Packet
class nessclient.event.MiscellaneousAlarmsUpdate(included_alarms: List[MiscellaneousAlarmsUpdate.AlarmType], address: Optional[int], timestamp: Optional[datetime.datetime])
class AlarmType

Note: The ness provided documentation has the byte endianness incorrectly documented. For this reason, these enum values have reversed byte ordering compared to the ness provided documentation.

This only applies to some enums, and thus must be applied on a case-by-case basis

CBUS_FAIL = 16
DURESS = 256
EXT_TAMPER = 8192
FIRE = 2048
INSTALL_END = 4096
KEYPAD_TAMPER = 32768
MAINS_FAIL = 8
MEDICAL = 1024
PANEL_BATTERY_LOW = 2
PANEL_BATTERY_LOW2 = 4
PANEL_TAMPER = 16384
PANIC = 512
PENDANT_PANIC = 1
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.MiscellaneousAlarmsUpdate
class nessclient.event.OutputsUpdate(outputs: List[OutputsUpdate.OutputType], address: Optional[int], timestamp: Optional[datetime.datetime])
class OutputType

Note: The ness provided documentation has the byte endianness incorrectly documented. For this reason, these enum values have reversed byte ordering compared to the ness provided documentation.

This only applies to some enums, and thus must be applied on a case-by-case basis

AUX1 = 1
AUX2 = 2
AUX3 = 4
AUX4 = 8
KEYPAD_DISPLAY_ENABLE = 32768
MONITOR_OUT = 16
PANEL_BATT_FAIL = 64
POWER_FAIL = 32
RESET = 8192
SIREN_LOUD = 256
SIREN_SOFT = 512
SIREN_SOFT_FIRE = 2048
SIREN_SOFT_MONITOR = 1024
SONALART = 16384
STROBE = 4096
TAMPER_XPAND = 128
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.OutputsUpdate
class nessclient.event.PanelVersionUpdate(model: nessclient.event.PanelVersionUpdate.Model, major_version: int, minor_version: int, address: Optional[int], timestamp: Optional[datetime.datetime])
class Model

An enumeration.

D16X = 0
D16X_3G = 4
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.PanelVersionUpdate
version
class nessclient.event.StatusUpdate(request_id: nessclient.event.StatusUpdate.RequestID, address: Optional[int], timestamp: Optional[datetime.datetime])
class RequestID

An enumeration.

ARMING = 20
AUXILIARY_OUTPUTS = 24
MISCELLANEOUS_ALARMS = 19
OUTPUTS = 21
PANEL_VERSION = 23
VIEW_STATE = 22
ZONE_AUTO_EXCLUDED = 7
ZONE_CBUS_UNSEALED = 2
ZONE_DETECTOR_LOW_BATTERY = 17
ZONE_DETECTOR_TAMPER = 18
ZONE_DOORS_OPEN = 16
ZONE_EXCLUDED = 6
ZONE_INPUT_UNSEALED = 0
ZONE_IN_ALARM = 5
ZONE_IN_DELAY = 3
ZONE_IN_DOUBLE_TRIGGER = 4
ZONE_RADIO_UNSEALED = 1
ZONE_SUPERVISION_FAIL = 9
ZONE_SUPERVISION_FAIL_PENDING = 8
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.StatusUpdate
class nessclient.event.SystemStatusEvent(type: nessclient.event.SystemStatusEvent.EventType, zone: int, area: int, address: Optional[int], timestamp: Optional[datetime.datetime])
class EventType

An enumeration.

ALARM = 2
ALARM_RESTORE = 3
ARMED_AWAY = 36
ARMED_DAY = 38
ARMED_HIGHEST = 46
ARMED_HOME = 37
ARMED_NIGHT = 39
ARMED_VACATION = 40
ARMING_DELAYED = 48
AUTO_EXCLUDE = 6
AUTO_INCLUDE = 7
BATTERY_FAILURE = 18
BATTERY_NORMAL = 19
DISARMED = 47
ENTRY_DELAY_END = 33
ENTRY_DELAY_START = 32
EXIT_DELAY_END = 35
EXIT_DELAY_START = 34
MANUAL_EXCLUDE = 4
MANUAL_INCLUDE = 5
OUTPUT_OFF = 50
OUTPUT_ON = 49
POWER_FAILURE = 16
POWER_NORMAL = 17
REAL_TIME_CLOCK = 25
REPORT_FAILURE = 20
REPORT_NORMAL = 21
SEALED = 1
SUPERVISION_FAILURE = 22
SUPERVISION_NORMAL = 23
TAMPER_NORMAL = 9
TAMPER_UNSEALED = 8
UNSEALED = 0
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.SystemStatusEvent
encode() → nessclient.packet.Packet
class nessclient.event.ViewStateUpdate(state: nessclient.event.ViewStateUpdate.State, address: Optional[int], timestamp: Optional[datetime.datetime])
class State

An enumeration.

BRIEF_DAY_CHIME = 57344
BRIEF_DAY_ZONE_SELECT = 45056
EXCLUDE_SELECT = 40960
HOME = 53248
INSTALLER_PROGRAM = 32768
MEMORY = 49152
NORMAL = 61440
USER_PROGRAM = 36864
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.ViewStateUpdate
class nessclient.event.ZoneUpdate(included_zones: List[ZoneUpdate.Zone], request_id: nessclient.event.StatusUpdate.RequestID, address: Optional[int], timestamp: Optional[datetime.datetime])
class Zone

An enumeration.

ZONE_1 = 256
ZONE_10 = 2
ZONE_11 = 4
ZONE_12 = 8
ZONE_13 = 16
ZONE_14 = 32
ZONE_15 = 64
ZONE_16 = 128
ZONE_2 = 512
ZONE_3 = 1024
ZONE_4 = 2048
ZONE_5 = 4096
ZONE_6 = 8192
ZONE_7 = 16384
ZONE_8 = 32768
ZONE_9 = 1
classmethod decode(packet: nessclient.packet.Packet) → nessclient.event.ZoneUpdate
encode() → nessclient.packet.Packet
nessclient.event.pack_unsigned_short_data_enum(items: List[T]) → str
nessclient.event.unpack_unsigned_short_data_enum(packet: nessclient.packet.Packet, enum_type: Type[T]) → List[T]

nessclient.connection

class nessclient.connection.Connection

Represents a connection to a Ness D8X/D16X server

close() → None
connect() → bool
connected
read() → Optional[bytes]
write(data: bytes) → None
class nessclient.connection.IP232Connection(host: str, port: int, loop: asyncio.events.AbstractEventLoop = <_UnixSelectorEventLoop running=False closed=False debug=False>)

A connection via IP232 with a Ness D8X/D16X server

close() → None
connect() → bool
connected
read() → Optional[bytes]
write(data: bytes) → None

.