curb_energy.models

Classes for representing the Curb API resources

class curb_energy.models.Billing(profile_id=-1, billing_model=None, day_of_month=1, zip_code=None, dollar_per_kwh=None, **kwargs)[source]

Billing describes how and when the customer is billed and is associated with a BillingModel instance.

__init__(profile_id=-1, billing_model=None, day_of_month=1, zip_code=None, dollar_per_kwh=None, **kwargs)[source]

The billing configuration for the customer

Parameters:
  • profile_id (int) – The Curb configuration profile
  • billing_model (Optional[BillingModel]) – Billing model information
  • day_of_month (int) – The start day of the billing period
  • zip_code (Optional[int]) – The zip code of the dwelling being monitored
  • dollar_per_kwh (Optional[float]) – The price per kilowatt-hour
class curb_energy.models.BillingModel(sector='Residential', label=None, utility=None, name=None, **kwargs)[source]

The Billing Model describes the utility and billing tier for a given customer.

__init__(sector='Residential', label=None, utility=None, name=None, **kwargs)[source]

Create an instance of the billing model for the customer

Parameters:
  • sector (str) – One of ‘Residental’ or ‘Commercial’
  • label (Optional[str]) – Unique ID of this instance
  • utility (Optional[str]) – The name of the utility / power provider
  • name (Optional[str]) – The billing tier
class curb_energy.models.Device(id=-1, building_type=None, name=None, timezone=None, sensor_groups=None, **kwargs)[source]

A logical grouping of Sensor Groups. A “device” can be thought of as a unit representing a location being measured, such as a home.

Todo

Clarify with Curb what they really intend by this.

__init__(id=-1, building_type=None, name=None, timezone=None, sensor_groups=None, **kwargs)[source]

Creates an instance of a dwelling location

Parameters:
  • id (int) – The unique ID of this monitored unit
  • building_type (Optional[str]) – The type of building (home, commercial)
  • name (Optional[str]) – The name of the monitored unit
  • timezone (Optional[str]) – Timezone label
  • sensor_groups (Optional[List[SensorGroup]]) – List of sensor groups associated
class curb_energy.models.Measurement(granularity, since, until, unit, headers, data)
data

Alias for field number 5

granularity

Alias for field number 0

headers

Alias for field number 4

since

Alias for field number 1

unit

Alias for field number 3

until

Alias for field number 2

class curb_energy.models.Profile(id=-1, display_name=None, real_time=None, register_groups=None, registers=None, widgets=None, billing=None, **kwargs)[source]

A profile defines how to interpret data, access real time data, and various other configuration options.

__init__(id=-1, display_name=None, real_time=None, register_groups=None, registers=None, widgets=None, billing=None, **kwargs)[source]

Create an instance of a configuration profile

Parameters:
find_register(id)[source]

Return a Register by its unique ID, or None if not found

Parameters:id (str) – The unique ID of the register to look up
Return type:Optional[Register]
class curb_energy.models.RealTimeConfig(topic=None, format='curb', prefix=None, ws_url=None, **kwargs)[source]

Configuration for the Real-Time client

__init__(topic=None, format='curb', prefix=None, ws_url=None, **kwargs)[source]

Create an instance of the RealTime configuration object

Parameters:
  • topic (Optional[str]) – The MQTT topic to subscribe to
  • format (str) – Output format (currently only accepts ‘curb’)
  • prefix (Optional[str]) – A prefix for each key within the measurement results
  • ws_url (Optional[str]) – The URL to the real-time API
class curb_energy.models.Register(id='', multiplier=1, flip_domain=False, label=None, **kwargs)[source]

A source of power measurement data.

__init__(id='', multiplier=1, flip_domain=False, label=None, **kwargs)[source]

Creates an instance of a source of power measurement data, such as an individual circuit breaker of electic panel

Parameters:
  • id (str) – Unique identifier
  • multiplier (int) – Power multiplier
  • flip_domain (bool) – Invert the sign of the reported values (pos/neg)
  • label (Optional[str]) – Name of the power source
class curb_energy.models.RegisterGroup(grid, normals, solar, use)[source]

A logical grouping of registers according to classification

__init__(grid, normals, solar, use)[source]

A group of registers

Parameters:
class curb_energy.models.Sensor(id=-1, name=None, arbitrary_name=None, **kwargs)[source]

An energy monitoring device (in this case, the Curb Hub)

__init__(id=-1, name=None, arbitrary_name=None, **kwargs)[source]

Creates an instance of a Sensor

Parameters:
  • id (int) – Unique identifier
  • name (Optional[str]) – Unique name (serial number) of the Curb Hub
  • arbitrary_name (Optional[str]) – User-assigned name for the Curb Hub
class curb_energy.models.SensorGroup(id=-1, sensors=None, **kwargs)[source]

A logical grouping of sensors

__init__(id=-1, sensors=None, **kwargs)[source]

Creates a logical grouping of sensors identified by a unique ID

Parameters:
  • id (int) – The unique ID of the sensor group
  • sensors (Optional[List[Sensor]]) – List of sensors associated with this group