# Device profiles and site scenarios

Prime RMS is brand-inclusive: instead of typing register maps, you `include` a
ready-made **profile** for your make and model, and the agent expands it into the
full set of readings. Profiles ship with the agent and can be overridden per site
in `/etc/prime-gate/profiles/`.

## How to use a profile

In `agent.yaml`, declare the connection once as a device, then include the profile
and pass the slave id or host:

```yaml
devices:
  - { id: rs485, driver: modbus, params: { transport: rtu, port: /dev/ttyUSB0, baudrate: 9600 } }
include:
  - { profile: dse72xx, device: rs485, params: { unit: 10 } }   # Deepsea genset at Modbus id 10
  - { profile: gateway_health, device: "" }
```

Add `prefix: "tank2."` to an include when you have two of the same device, so the
point keys stay unique (`tank2.fuel.level_pct`). Anything under `points:` is still
free-form for one-off readings. Run `prime-gate read` to confirm the addresses.

## Profiles included

| Profile | Device | Interface |
|---|---|---|
| dse72xx | Deepsea DSE72xx/73xx/74xx genset controller (incl. start/stop) | Modbus |
| comap_intelilite | ComAp InteliLite / InteliGen genset | Modbus |
| smartgen_hgm | SmartGen HGM61xx/6120 genset | Modbus |
| huawei_smu | Huawei SMU / SmartLogger power system | SNMP |
| megmeet_mc2900 | MEGMEET MC2900 telecom-power controller — whole cabinet: rectifiers (MR484000SG1), solar MPPT (MS483000HG), battery/BMS, AC mains, LLVD/BLVD load, environment, alarms | SNMP (or Modbus/YDT-1363) |
| megmeet_battery | MEGMEET MPC48100 / MPC48150 lithium battery BMS (direct RS485/SNMP) — SOC/SOH/cell V+temp/cycles/protect + anti-theft/GPS | Modbus / SNMP |
| schneider_pm2xxx | Schneider PM2xxx / iEM3xxx meter | Modbus |
| generic_din_meter | Eastron SDM630-style 3-phase meter | Modbus |
| pylontech_modbus | Pylontech / generic LFP rack | Modbus |
| technoton_dut | Technoton DUT-E / Escort smart fuel sensor | Modbus |
| fuel_4_20ma | 4-20 mA fuel probe via an analog-input module | Modbus |
| sun2000_modbus | Huawei SUN2000 solar inverter | Modbus TCP |
| solaredge_cloud | SolarEdge monitoring cloud | HTTP/JSON |
| modbus_temp_humidity | Generic temperature + humidity probe | Modbus |
| adam4055_security | Advantech ADAM-4055 8 DI / 8 DO security + relays | Modbus |
| gateway_health | The gateway's own CPU/temp/uplink/signal | built-in |

New brands are just a new YAML file with the register list; no code change. Ask
Prime to add your model, or drop a file in `/etc/prime-gate/profiles/`.

## Ready-made site scenarios

Whole-site starting configs that combine profiles. Download, edit the addresses,
delete what you do not have:

- **scenario-telecom-site.yaml** — tower/BTS: grid meter, rectifier, genset, fuel, security.
- **scenario-solar-hybrid.yaml** — SUN2000 inverter, battery, genset backup, meter.
- **scenario-fuel-depot.yaml** — multiple fuel tanks, genset, environment, security.
- **scenario-datacenter-room.yaml** — meter, environment per room, security, cloud PV.

## Drivers behind the profiles

Modbus RTU/TCP, SNMP v1/v2c/v3, on-board GPIO, gateway self-monitoring, and
**HTTP/JSON** for cloud and REST devices (SolarEdge, Victron VRM, SMA, or any
inverter/gateway with a JSON API). CAN-bus BMS and ONVIF cameras are the two
remaining driver types on the roadmap.
