{
  "id": "daikin-g3-media-v1",
  "version": 1,
  "status": "implemented-unreleased",
  "limits": {
    "jpeg_bytes": 131072,
    "width": 480,
    "height": 854,
    "upload_chunk": 512,
    "queue_including_active": 16,
    "images": 4,
    "title_utf8_bytes": 64,
    "text_utf8_bytes": 512,
    "history": 16,
    "orphan_expiry_ms": 120000,
    "max_fps": 10,
    "notification_views": 4,
    "double_tap_ms": 350,
    "source_url_bytes": 383,
    "source_credential_bytes": 63,
    "first_frame_timeout_ms": 15000,
    "ttl_ms": 86400000
  },
  "defaults": {
    "baud": 115200,
    "baud_mode": "fixed",
    "width": 320,
    "height": 240,
    "fps": 1,
    "duration_ms": 10000,
    "wake": true,
    "brightness": 30,
    "verify_tls": true,
    "ttl_ms": 0,
    "overflow": "reject"
  },
  "rates": [
    115200,
    230400,
    460800,
    921600
  ],
  "actions": {
    "screen.link.get": {
      "required": [],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.link.set": {
      "required": [
        "mode"
      ],
      "optional": [
        "rate",
        "max_rate",
        "apply_now"
      ],
      "access": "ADMIN"
    },
    "screen.media.begin": {
      "required": [
        "id",
        "total",
        "crc32",
        "width",
        "height"
      ],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.media.chunk": {
      "required": [
        "id",
        "offset",
        "bytes"
      ],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.media.commit": {
      "required": [
        "id"
      ],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.media.cancel": {
      "required": [
        "id"
      ],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.media.get": {
      "required": [],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.push.send": {
      "required": [
        "id"
      ],
      "optional": [
        "image_id",
        "title",
        "text",
        "duration_ms",
        "mode",
        "wake",
        "brightness",
        "url",
        "username",
        "password",
        "width",
        "height",
        "fps",
        "verify_tls",
        "ttl_ms",
        "overflow"
      ],
      "access": "CONTROL"
    },
    "screen.push.get": {
      "required": [],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.push.dismiss": {
      "required": [
        "id"
      ],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.stream.get": {
      "required": [],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.stream.set": {
      "required": [
        "url"
      ],
      "optional": [
        "username",
        "password",
        "width",
        "height",
        "fps",
        "enabled",
        "verify_tls"
      ],
      "access": "ADMIN"
    },
    "screen.stream.start": {
      "required": [],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.stream.stop": {
      "required": [],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.push.select": {
      "required": [
        "index"
      ],
      "optional": [],
      "access": "CONTROL"
    },
    "screen.push.update": {
      "required": [
        "id"
      ],
      "optional": [
        "image_id",
        "title",
        "text",
        "duration_ms",
        "mode",
        "wake",
        "brightness",
        "url",
        "username",
        "password",
        "width",
        "height",
        "fps",
        "verify_tls",
        "ttl_ms"
      ],
      "access": "CONTROL",
      "at_least_one_optional": true
    }
  },
  "uart": {
    "version": 1,
    "magic": "GM",
    "delimiter": 0,
    "escape": {
      "00": "dbdc",
      "db": "dbdd"
    },
    "header_bytes": 14,
    "length_endian": "little",
    "session_bytes": 4,
    "sequence_bytes": 4,
    "payload_max": 1152,
    "crc": "CRC32/ISO-HDLC over header and payload, little endian",
    "channels": {
      "link": 0,
      "command": 1,
      "reply": 2,
      "socket": 3,
      "socket_ack": 4,
      "socket_event": 5
    }
  },
  "results": {
    "0": "ok",
    "1": "range",
    "2": "busy",
    "3": "not_found",
    "4": "crc",
    "5": "format",
    "6": "decode",
    "7": "offline"
  },
  "push_states": [
    "empty",
    "queued",
    "displayed",
    "confirmed",
    "timedout",
    "dismissed",
    "failed",
    "expired",
    "dropped",
    "evicted"
  ],
  "scn3": {
    "bytes": 9520,
    "component_type": 8,
    "image_source_offset": 86,
    "image_fit_offset": 87,
    "image_source": 0,
    "image_fit": {
      "0": "contain",
      "1": "cover"
    },
    "pages": 8,
    "components": 32
  },
  "url_push": {
    "capability": 33554432,
    "opcode": 12,
    "same_url": "renew canonical queued id without shortening remaining duration",
    "storage": "transient",
    "image_id": "mutually exclusive with nonzero image_id",
    "source": "HTTP(S) JPEG or MJPEG, detected from response",
    "timer": "starts after first decoded and presented frame",
    "last_push_id": "canonical id in screen.media.get",
    "stream_role": "notification or page"
  },
  "push_update": {
    "capability": 67108864,
    "opcode": 13,
    "header_bytes": 18,
    "mask_bits": [
      "title",
      "text",
      "image_id",
      "mode",
      "duration_ms",
      "wake",
      "brightness",
      "url",
      "username",
      "password",
      "width",
      "height",
      "fps",
      "verify_tls",
      "ttl_ms"
    ],
    "source_bytes": 519,
    "omitted": "preserved",
    "duration_ms": "extend to at least requested visible time",
    "missing_id": "not_found, never replayed",
    "position": "preserved, hidden updates do not select",
    "credentials": "URL change clears omitted credentials",
    "dedup": "send retains original creation fingerprint; UART sequence retries are deduplicated",
    "ttl_bytes": "optional LE32 after mask, before source when bit 14 is present",
    "ttl_ms": "reset hard expiry from receipt; zero disables"
  },
  "push_policy": {
    "capability": 134217728,
    "opcode": 14,
    "header_bytes": 22,
    "ttl_ms": {
      "offset": 16,
      "bytes": 4,
      "zero": "disabled",
      "maximum": 86400000,
      "clock": "monotonic including hidden, queued and suspended time"
    },
    "overflow": {
      "offset": 20,
      "values": {
        "0": "reject",
        "1": "drop_newest",
        "2": "drop_oldest"
      },
      "drop_oldest": "evict oldest waiting notice, preserve active"
    },
    "remote": {
      "offset": 21,
      "values": {
        "0": "uploaded image or text",
        "1": "URL source follows header"
      }
    },
    "status_version": 4,
    "status_queue_item_bytes": 14,
    "status_expires_in_ms_offset": 10,
    "timer_relation": "ttl expiry is independent of visible duration and applies to confirm notices",
    "storage": "transient per-message settings"
  },
  "measurement_warmup": {
    "field": "tvoc_warmup_seconds_remaining",
    "location": "status.get data and HTTP business status",
    "optional": true,
    "type": [
      "integer",
      "null"
    ],
    "minimum": 0,
    "maximum": 3600,
    "unit": "seconds",
    "unknown": "null or absent; includes stopped measurement and snapshot age >=20000 ms",
    "zero": "measurement warmup elapsed; does not imply a valid sample",
    "source": "MCU measurement phase clock, independent of calibration session",
    "age": "ESP subtracts floor(monotonic snapshot age /1000), clamps at zero; WebUI subtracts local response age and stops displaying the countdown after 20000 ms without a new response",
    "compatibility": "optional read-only extension, ignored by older clients; existing sample valid flag remains authoritative",
    "configuration": {
      "action": "screen.settings.set",
      "field": "tvoc_warmup_minutes",
      "type": "integer",
      "auto": -1,
      "custom_minimum": 1,
      "custom_maximum": 60,
      "zero": "rejected; warmup cannot be skipped",
      "default": -1,
      "persistence": "existing ESP screen settings transactional record; replay on each MCU session",
      "readback": "screen.settings.get settings and saved_settings; status.screen.settings",
      "effect": "recompute from current measurement elapsed time without restarting measurement; never set an invalid sample valid",
      "calibration": "manual calibration timer unchanged"
    }
  },
  "uart_rx_recovery": {
    "wire_unchanged": true,
    "default_baud": 115200,
    "trigger": "observed hardware RX overrun or receive-ring dropped byte",
    "owner_action": "discard buffered fragments and resynchronize parser through the next zero delimiter; preserve CRC, session and sequence validation",
    "guard_diagnostic": {
      "opcode": 226,
      "accepted_versions": {
        "3": 82,
        "4": 98
      },
      "v4_prefix": "existing 82-byte v3 fields unchanged except version byte is 4",
      "appended_u32_le": {
        "hardware_rx_overruns": 82,
        "ring_dropped_bytes": 86,
        "rx_loss_resets": 90,
        "last_rx_loss_ms": 94
      },
      "hardware_rx_overruns": "observed RXOV events, not a dropped-byte count",
      "last_rx_loss_ms": "boot monotonic milliseconds; zero before any observed loss",
      "compatibility": "new ESP accepts exact v3 or v4 lengths and versions; v3 has no loss fields; older ESP may ignore v4 diagnostic notices without changing media wire framing",
      "exposure": "four appended loss fields are returned only by explicit maintenance queries screen.recovery.get and screen.boot.result.get; ordinary business status retains the original 20 diagnostic fields"
    }
  },
  "display_page_policy": {
    "actions": [
      "screen.display.get",
      "screen.display.set"
    ],
    "capability": 268435456,
    "home_page_id": "stable enabled scene page.id; 0 selects first enabled page",
    "page_overrides": "up to 8 unique existing page IDs; absent entry inherits all global standby fields; each entry requires page_id, external_minutes, battery_minutes and idle_brightness",
    "limits": {
      "external_minutes": [
        0,
        1440
      ],
      "battery_minutes": [
        0,
        1440
      ],
      "idle_brightness": [
        0,
        100
      ]
    },
    "priority": "global weekly plans take precedence; zero minutes disables idle timeout; zero brightness switches the backlight off",
    "compatibility": "old 6-field requests preserve home/overrides; extended 8-field requests require PAGE_POLICY; old MCU receives v1 368-byte policy, new MCU v2 472-byte policy; v1 persisted records load with home=0 and no overrides",
    "status": "new fields only in explicit display get/set replies; ordinary status remains compact",
    "identity": "page sorting preserves stable IDs; deleted page overrides are pruned; disabled page overrides retained; disabled/deleted home falls back to 0",
    "revision": "unchanged saves preserve revision and storage; actual changes persist transactionally and replay by revision"
  }
}
