Skip to content

Library Structure

The library follows a multi-level tree structure:

  • Top level: Manufacturer
  • Second level: Model ID
  • Optional: Sub-profiles for specific device behaviors

Each manufacturer directory must include a manufacturer.json file:

Field Type Required Description
name string Yes The full vendor/brand name
aliases array of strings No Other names the same brand ships under, used for discovery
website string No Home page of the brand, linked from its page on the library website
country string No Country the brand is based in, as an ISO 3166-1 alpha-2 code such as NL
description string No A sentence or two about the brand, shown on its page on the library website

Each device profile resides in its own subdirectory: {manufacturer}/{modelid} (e.g., signify/LCT010) This directory contains a mandatory model.json file and, optionally, CSV files used for LUT (Look-Up Table) calculation strategy.

model.json

Every device profile must include a model.json file, which defines supported calculation modes and other configuration parameters. Refer to the JSON schema for full details.

Available Fields

Below is a comprehensive table of all fields that can be used in a model.json file:

Field Type Required Description
name string Yes The full name of the device (used only for display in the Library)
device_type string Yes Type of device (e.g., light, camera, fan). See Device Types for implementation examples
calculation_strategy string Yes Strategy used for power calculation (lut, linear, fixed, multi_switch, composite). See Calculation Strategies
measure_method string Yes How the device was measured (manual, script)
measure_device string Yes Device which was used to measure (e.g., Shelly PM Gen 3)
created_at string Yes Creation date of the profile (ISO 8601 format, e.g., 2023-06-19T08:02:31)
authors array of objects No Contributors to the profile; each object has required name and github, plus optional email
aliases array of strings No Alternative model id's for this model, used for discovery purposes
compatible_integrations array of strings No List of compatible integration platforms (e.g., "hue", "lifx"). Only entities from these integrations will be discovered
calculation_enabled_condition string No Template which can be evaluated to determine if calculation is enabled
composite_config object/array No Configuration for composite calculation strategy
config_flow_discovery_remarks string No Remarks to show in the GUI config flow on first step of discovery
config_flow_sub_profile_remarks string No Remarks to show in the GUI config flow on sub profile selection step
description string No A short description of the device
device_specs object No Manufacturer specifications such as rated power and connectivity, plus type-specific attributes. See Device specs
discovery_by string No Whether to discover the profile by config entry, device, or entity
ean array of strings No Barcode numbers on the packaging (EAN-8, UPC-12, EAN-13 or GTIN-14). A model often ships under several, one per region
fields array of objects No Custom fields for the profile, more about it explained in Variables
fixed_config object No Configuration for fixed calculation strategy
is_dumb_bulb boolean No Indicates if the profile is for a dumb light bulb without smart capabilities
linear_config object No Configuration for linear calculation strategy
linked_profile string No Use data from another model
mains_voltage number No Nominal mains voltage the measurements were taken on, e.g. 230 or 120
measure_description string No Additional information about how the device was measured
measure_device_firmware string No Firmware version of the device used to measure
measure_settings object No Settings used for measure script, for future reference
min_version boolean No Minimum required Powercalc version for the profile
multi_switch_config object No Configuration for multi switch calculation strategy
only_self_usage boolean No Set for devices with a built-in power meter, which already measure the connected appliance themselves. The profile then only provides the self usage of the device, and its sensors are named {} Device Power / {} Device Energy
playbook_config object No Configuration for playbook calculation strategy
product_url string No Manufacturer product page for this model
sensor_config object No Sensor configuration options. See Sensor configuration. Naming options (power_sensor_naming, energy_sensor_naming and their _friendly_ variants) are not allowed, naming is a user preference
standby_power number No Power draw when the device is turned off
standby_power_estimated boolean No Set when standby_power holds an assumed value you could not measure, so the library website does not present a guess as a measurement
standby_power_on number No Power draw when the device is turned on
sub_profile_select object No Configuration to automatically select a sub profile, see sub profiles

Device specs

device_specs holds what the box or manufacturer datasheet says about the device, as opposed to what the measurements say. Some keys apply to every device type; selected device types have additional type-specific keys.

"device_specs": {
  "socket": ["E26", "E27"],
  "form_factor": "bulb",
  "lumens": 806,
  "rated_power": 9.5,
  "connectivity": ["zigbee"]
}

Generic device specifications:

Key Type Description
rated_power number Power draw claimed by the manufacturer, in watts. The library website shows it next to the measured maximum
connectivity array of strings Protocols the device talks: zigbee, wifi, zwave, matter, thread, bluetooth, ethernet, usb, rf433, infrared, proprietary

Additional light specifications:

Key Type Description
socket string or array Lamp base(s): E27, E26, E14, E12, B22, GU10, GU5.3, GU24, GX53, G9, G4, or integrated when the light source cannot be replaced
form_factor string bulb, spot, candle, globe, filament, strip, panel, downlight, tube, fixture or other
lumens number Nominal luminous flux at full brightness

Additional smart switch and smart dimmer specifications:

Key Type Description
form_factor string plug, wall_switch, in_wall, inline, din_rail, power_strip, led_driver or other
max_load_watts number Maximum connected load supported by the device, in watts; this is not the device's own power draw
power_monitoring boolean Whether the device can monitor the connected load's power consumption

For a smart switch or dimmer, only_self_usage: true implies power_monitoring: true: the profile models only the device's own consumption because the connected load is already measured by the device. The reverse is not required; a monitoring-capable device can still have a profile that models more than its own consumption.

Additional network device specifications:

Key Type Description
form_factor string router, modem, access_point, repeater, switch, gateway, bridge or other

Additional fan specifications:

Key Type Description
form_factor string table, tower, pedestal, ceiling, floor, air_purifier, purifier_fan, white_noise_machine or other

Additional smart speaker specifications:

Key Type Description
form_factor string speaker, smart_display, soundbar, soundbase, subwoofer, amplifier, streamer, clock, speaker_lamp, picture_frame or other

Leave a key out rather than guessing. These are manufacturer claims, and the website presents them as such.

Calculation Strategy Specific Fields

Depending on the calculation_strategy you choose, you'll need to provide specific configuration:

Fixed Strategy (fixed_config)
"fixed_config": {
  "power": 5.0,  // Fixed power value in watts
  "states_power": {  // Optional: power values for different states
    "idle": 2.0,
    "playing": 5.0,
    "off": 0.5
  }
}
Composite Strategy (composite_config)

Allows combining multiple calculation strategies based on conditions:

"composite_config": {
  "mode": "stop_at_first",  // or "sum_all"
  "strategies": [
    {
      "condition": {
        "condition": "state",
        "entity_id": "light.example",
        "state": "on"
      },
      // Strategy-specific config here
    }
  ]
}

Discovery Behavior

By default, Powercalc performs discovery on a per-entity basis. This can cause issues if a device has multiple entities, resulting in multiple discoveries.

To avoid this, you can set:

"discovery_by": "device"

This enables per-device discovery, which is more reliable. It is especially recommended for device types using sensor domain entities: network, power_meter, and generic_iot.

When one integration config entry creates several similar devices but should result in only one Powercalc discovery, use:

"discovery_by": "config_entry"

This enables per-config-entry discovery. Powercalc uses the first device belonging to the config entry to determine the manufacturer and model.


Aliases and Linked Profiles

  • Use aliases to define alternative model names for discovery. This is helpful when the same device is reported differently across integrations (e.g., Hue vs. deCONZ).

Note

When using aliases, only discovery information is added to the existing profile in the library.

  • Use linked_profile to point to another profile that contains the measurement data. This creates a separate entry in the library.

Format: manufacturer/modelid Example: signify/LCT010


Sub-Profiles

Some devices may have different power usage based on their state. In these cases, you can define multiple sub-profiles within the same model.

See Sub Profiles for details.