Skip to content

Latest commit

 

History

History
108 lines (84 loc) · 7.21 KB

P1P2Monitor-commands.md

File metadata and controls

108 lines (84 loc) · 7.21 KB

P1P2Monitor serial raw data format and serial commands

This document describes the serial interface to the ATmega328P or Arduino Uno. It is only relevant if you interface directly to P1P2Monitor. If you use P1P2MQTT on the P1P2-ESP-interface, this information is not relevant for you, in that case please read the MQTT protocol information.

Serial output

Unless you set verbosity to 0, each P1P2Monitor serial output line starts with

  • "R " for error-free raw hex data read directly from the P1/P2 bus,
  • "C " for P1/P2 bus timing information of messages with read errors,
  • "c " for P1/P2 bus timing information of error-free messages, or
  • "* " for any other (human-readable) output (including raw data with errors). The serial output is forwarded by P1P2MQTT via MQTTT topics P1P2/R and P1P2/S, respectively.

In newer P1P2Monitor versions json and MQTT-like output are no longer generated by P1P2Monitor, this functionality is only done in P1P2MQTT on the ESP8266.

If PSEUDO_PACKETS is defined, P1P2Monitor outputs additional information packets on its own status over the serial line in a format as if the data originates from the P1/P2 bus, using packet types 0x08-0x09. These messages do not originate from the P1/P2 bus, but P1P2MQTT will process this data in the same way as it interprets P1/P2 bus data.

Serial input

The serial input is used for providing commands to P1P2Monitor. P1P2Monitor commands are case-insensitive. The maximum command line length is 98 bytes, longer lines will be entirely ignored.

*Warning: If SERIAL_MAGICSTRING is defined, each line must start with this string.

Warning: The first command line received over serial by P1P2Monitor after its reboot will - on purpose - be ignored for robustness reasons. If you communicate directly over serial (not via P1P2MQTT), a good habit is to send a dummy line "*" as first command. If you use P1P2MQTT, this warning is not applicable as P1P2MQTT takes care of sending this extra line.

Basic commands

The most useful commands:

  • L1 to start P1P2Monitor acting as an auxiliary controller
  • L0 to stop P1P2Monitor acting as an auxiliary controller
  • C2 to start requesting counters every minute
  • C0 to stop requesting counters every minute
  • E for parameter writing (as of v0.9.14)

New 'E' parameter write command

The 'E' parameter writing may take one of the following formats

  • E <packet_type> <param_nr>
  • E XX[ ]YYYY[ ]Z[..] where XX is a 2-digit hex encoding of the (1-byte) packettype, YYYY is a 4-digit hex encoding of the (2-byte) parameter number, and Z is the hex-encoding (1-8 hex digits) of the new parameter value to be written (1, 2, 3, or 4 bytes depending on the packet type: 35, 3A: 1-byte, 36, 3B: 2-byte, 37 and 3C: 3-byte, and 38, 39, and 3D: 4-byte). For example, to switch heating on (value 01) by writing parameter number 002F in packet type 35, you can issue
  • E 35 2F 1
  • E 35 002F 01
  • E 35002F01 or
  • E 35002F1

A few pre-defined parameter writing actions are still available from earlier P1P2Monitor versions, for example:

  • Z to write parameter <PARAM_HC_ONOFF> (defined in P1P2Config.h) in packet type 35:
  • Z0 switches heating(/cooling) off
  • Z1 switches heating(/cooling) on
  • R3C set DHW temperature to 0x3C = 60 degrees

Old parameter write commands (will be outphased):

  • Px sets (16-bit) parameter number in packet type 35 to use for Zx command (default PARAM_HC_ONOFF),
  • P reports parameter number used for writes to packet type 35,
  • Qx sets (16-bit) parameter number in packet type 36 to use for Rx command (default PARAM_TEMP),
  • Q reports parameter number used for writes to packet type 36,
  • Mx sets (16-bit) parameter number in packet type 3A to use for Nx command (default PARAM_SYS),
  • M reports parameter number used for writes to packet type 3A,
  • Zx sets heating(/cooling) on/off (1/0) (function can be changed using Px command below to set any 8-bit parameter in packet type 35),
  • Z reports status of write action,
  • Rx sets DHW temperature (function can be changed using Qx command below to set any 16-bit parameter in packet type 36),
  • R reports status of write action,
  • Nx sets 8-bit value of 8-bit parameter selected by Q command) in packet type 3A,
  • N reports status of write action,
  • Yx sets DHW on/off (using parameter PARAM_DHW_ONOFF, cannot be changed), and
  • Y reports status of write action.

Monitor commands:

  • V Show verbosity mode (default 3 for interfacing to P1P2MQTT), P1P2Monitor version and date/time of compilation,
  • Vx Sets verbosity mode (0 minimal, 1 traditional, 2 for P1P2MQTT, 3 like 2 with timing info added, 4 for suppression of hex data),
  • U Shows scope mode (default 0 off, 1 on),
  • Ux Sets scope mode (default 0 off, 1 on); adds timing info for the start of some of the packets read via serial output and R topic, and
  • * comment lines starting with an asterisk are ignored (and echoed in verbosity modes 1 and 4).

Auxiliary controller commands:

  • L1 sets auxiliary controller mode on (controller address (0xF0 or 0xF1) is auto-detected after check whether another auxiliary controller is present or not) (can also be set in P1P2Config.h) (controller ID is saved in EEPROM, so this command remains effective after a restart),
  • L0 sets auxiliary controller mode off,
  • L2 (and L3) switch auxiliary controller mode off (and on) but do not save this change to EEPROM,
  • L5 (F-series only) switches auxiliary controller mode partially on: only 00F030 messages are responded to. This enable monitoring which 00F03x packets will be requested. Not saved to EEPROM,
  • L displays current controller_id (0x00 = off; 0xF0/0xF1 is first/secondary auxiliary controller),
  • C1 triggers single cycle of 6 B8 packets to request (energy/operation/starts) counters from heat pump,
  • C2 like C1, but keeps repeating every new minute,
  • C0 stop requesting counters, and
  • C show counter-repeating-request status.

Raw data commands:

Commands for raw data writing to the bus (only for reverse engineering purposes), avoid these commands unless you know what you do:

  • W<hex data> Write raw packet (max 32 bytes (as defined by WB_SIZE)) (no 0x prefix should be used for the hex bytes; hex bytes may be concatenated or separated by white space),
  • T display current delay value (a packet will be written after exactly ms after the latest start bit, or if the bus has been silent for ms),
  • Tx sets new delay value in ms, to be used for future packets (default 50 (older versions: 0)),
  • O display current delaytimeout value, and
  • Ox sets new delay timeout value in ms, to be used immediately (default 2500).

Miscellaneous

Supported but advised not to use, not really needed (some may be removed in a future version):

  • G display current crc_gen value,
  • Gx sets crc_gen (default 0xD9) (we have not seen any other values so no need to change),
  • H display current crc_feed value,
  • Hx sets crc_feed (default 0x00) (we have not seen any other values so no need to change),
  • X display current echo status (determines whether bytes written will be echoed on the serial line, and also whether bus errors will be detected during writing),
  • Xx sets echo status on/off (recommended to keep on to detect bus errors), and
  • K instruct ATmega328P to reset itself.