# RTU Simulator — provider role of cp:padi.test.hvac.rtu ("CP to get RTU info").
# Simulates a rooftop unit publishing the EEM minimum point set: supply/return
# air temps, active setpoint, staged heat/cool states, fan state, sample
# timestamp. Everything is provider-written and propagated; the consumer has no
# writes (pure telemetry, ratified 2026-07-30).
# NOTE: widgets have no clock primitive, so ts is a hand-edited field here —
# a real RTU/gateway stamps every update. Swap profile to padi.hvac.rtu when
# the final CP is published.
widget: rtu-sim
title: RTU Simulator
description: Simulates a rooftop unit - publishes supply/return air temperatures, active setpoint, heat/cool stage states, fan state and a sample timestamp to any consuming engine.
icon: "🌬"
color: "#4c8bf5"

capabilities:
  - profile: padi.test.hvac.rtu
    role: provider

view:
  - type: label
    text: temperatures
  - type: stepper
    bind: supplyAirTemp
    step: 1
    caption: supply / discharge air temp
  - type: stepper
    bind: returnAirTemp
    step: 1
    caption: return / space air temp
  - type: stepper
    bind: tempSetpoint
    step: 1
    caption: active setpoint
  - type: options
    bind: tempUnit
    values: [F, C]
    caption: temperature unit
  - type: split
  - type: label
    text: stages
  - type: toggle
    bind: stage1Cool
    on: "1"
    off: "0"
    caption: cool stage 1 (compressor)
  - type: toggle
    bind: stage2Cool
    on: "1"
    off: "0"
    caption: cool stage 2
  - type: toggle
    bind: stage3Cool
    on: "1"
    off: "0"
    caption: cool stage 3
  - type: toggle
    bind: stage1Heat
    on: "1"
    off: "0"
    caption: heat stage 1
  - type: toggle
    bind: stage2Heat
    on: "1"
    off: "0"
    caption: heat stage 2
  - type: toggle
    bind: stage3Heat
    on: "1"
    off: "0"
    caption: heat stage 3
  - type: toggle
    bind: fanState
    on: "1"
    off: "0"
    caption: fan
  - type: split
  - type: label
    text: sample
  - type: field
    bind: ts
    caption: timestamp (UTC ISO 8601)

behavior:
  init:                       # all six required properties get values up front
    ts: "2026-07-30T17:00:00Z"
    supplyAirTemp: "55"
    returnAirTemp: "75"
    tempSetpoint: "74"
    tempUnit: F
    fanState: "0"
    stage1Cool: "0"
    stage2Cool: "0"
    stage3Cool: "0"
    stage1Heat: "0"
    stage2Heat: "0"
    stage3Heat: "0"
