Price Server#

API and Callbacks for the Price Cluster Server Component.

This component provides an implementation of a Smart Energy price server. The price server holds a table of prices locally and answers requests to retrieve the list of commodity prices. It requires extension to add / remove prices from the table and to send out new prices to those devices that have subscribed to the ESI for price updates.

Modules#

EmberAfPriceBlockPeriod

EmberAfPriceBillingPeriod

EmberAfPriceCppEvent

EmberAfPriceConsolidatedBills

EmberAfPriceCreditPayment

EmberAfPriceConversionFactor

EmberAfPriceCalorificValue

EmberAfPriceCancelTariff

EmberAfPriceCo2Value

EmberAfPriceCurrencyConversion

EmberAfPriceTierLabelValue

EmberAfPriceTierLabelTable

EmberAfPriceBlockPeriodTable

EmberAfPriceBillingPeriodTable

EmberAfPriceCppTable

EmberAfPriceConsolidatedBillsTable

EmberAfPriceCreditPaymentTable

EmberAfPriceConversionFactorTable

EmberAfPriceCalorificValueTable

EmberAfPriceCO2Table

EmberAfPriceCurrencyConversionTable

EmberAfPriceCancelTariffTable

EmberAfScheduledBlockThresholds

EmberAfScheduledBlockThresholdsTable

EmberAfScheduledTariff

EmberAfScheduledTariffTable

EmberAfScheduledPriceMatrix

EmberAfScheduledPriceMatrixTable

EmberAfPriceServerInfo

Price Server

API#

void

Send the next get scheduled prices command.

uint32_t

Return the number of seconds until the next get scheduled prices command should be sent.

void
emberAfPriceClearPriceTable(uint8_t endpoint)

Clear all prices in the price table.

void

Clear all tariffs in the tariff table.

void

Clear all price matrices in the price matrix table.

void

Clear all block thresholds in the block thresholds table.

bool
emberAfPriceGetPriceTableEntry(uint8_t endpoint, uint8_t index, EmberAfScheduledPrice *price)

Get a price used by the price server plugin.

void
emberAfPluginPriceServerBlockPeriodAdd(uint8_t endpoint, uint32_t providerId, uint32_t issuerEventId, uint32_t blockPeriodStartTime, uint32_t blockPeriodDuration, uint8_t blockPeriodControl, uint8_t blockPeriodDurationType, uint32_t thresholdMultiplier, uint32_t thresholdDivisor, uint8_t tariffType, uint8_t tariffResolutionPeriod)

Set values in the block period table.

void
emberAfPluginPriceServerBlockPeriodPub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish block period command.

void
emberAfPluginPriceServerBlockPeriodPrint(uint8_t endpoint, uint8_t index)

Print data in the specified index of the block period table.

uint32_t

Return the number of seconds until the next block period event occurs.

void
emberAfPriceServerRefreshBlockPeriod(uint8_t endpoint, bool repeat)

Update block period attributes to match the current block period.

bool
emberAfPriceGetTariffTableEntry(uint8_t endpoint, uint8_t index, EmberAfPriceCommonInfo *info, EmberAfScheduledTariff *tariff)

Get a tariff used by the price server plugin.

bool
emberAfPriceGetPriceMatrix(uint8_t endpoint, uint8_t index, EmberAfPriceCommonInfo *info, EmberAfScheduledPriceMatrix *pm)

Retrieve a price matrix entry by index.

bool
emberAfPriceGetBlockThresholdsTableEntry(uint8_t endpoint, uint8_t index, EmberAfScheduledBlockThresholds *bt)

Get the block thresholds used by the Price server plugin.

bool
emberAfPriceGetTariffByIssuerTariffId(uint8_t endpoint, uint32_t issuerTariffId, EmberAfPriceCommonInfo *info, EmberAfScheduledTariff *tariff)

Get a tariff by issuer tariff ID and endpoint.

bool
emberAfPriceGetPriceMatrixByIssuerTariffId(uint8_t endpoint, uint32_t issuerTariffId, EmberAfPriceCommonInfo *info, EmberAfScheduledPriceMatrix *pm)

Get a price matrix by issuer tariff ID and endpoint.

bool
emberAfPriceGetBlockThresholdsByIssuerTariffId(uint8_t endpoint, uint32_t issuerTariffId, EmberAfPriceCommonInfo *info, EmberAfScheduledBlockThresholds *bt)

Get the block thresholds by issuer tariff ID and endpoint.

bool
emberAfPriceSetPriceTableEntry(uint8_t endpoint, uint8_t index, const EmberAfScheduledPrice *price)

Set a price used by the price server plugin.

bool
emberAfPriceSetTariffTableEntry(uint8_t endpoint, uint8_t index, EmberAfPriceCommonInfo *info, const EmberAfScheduledTariff *tariff)

Set a tariff used by the price server plugin.

bool
emberAfPriceSetPriceMatrix(uint8_t endpoint, uint8_t index, EmberAfPriceCommonInfo *info, const EmberAfScheduledPriceMatrix *pm)

Set a price matrix entry by index.

bool
emberAfPriceSetBlockThresholdsTableEntry(uint8_t endpoint, uint8_t index, const EmberAfPriceCommonInfo *info, const EmberAfScheduledBlockThresholds *bt)

Set the block thresholds used by the price server plugin.

bool
emberAfGetCurrentPrice(uint8_t endpoint, EmberAfScheduledPrice *price)

Get the current price used by the price server plugin.

uint8_t

Find the first free index in the price table.

void
emberAfPricePrint(const EmberAfScheduledPrice *price)

function to print price

void
emberAfPricePrintPriceTable(uint8_t endpoint)
void
emberAfPricePrintTariff(const EmberAfPriceCommonInfo *info, const EmberAfScheduledTariff *tariff)
void

Print tariff table.

void
emberAfPricePrintPriceMatrix(uint8_t endpoint, const EmberAfPriceCommonInfo *info, const EmberAfScheduledPriceMatrix *pm)

Print price matrix.

void

Print price matrix table.

void
emberAfPricePrintBlockThresholds(uint8_t endpoint, const EmberAfPriceCommonInfo *info, const EmberAfScheduledBlockThresholds *bt)

Print block thresholds.

void

Print block threshold table.

void
emberAfPluginPriceServerPublishPriceMessage(EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t priceIndex)

Publish price message.

emberAfPluginPriceServerConversionFactorAdd(uint8_t endpoint, uint32_t issuerEventId, uint32_t startTime, uint32_t conversionFactor, uint8_t conversionFactorTrailingDigit)

Set parameters in the conversion factors table.

void

Clear the conversion factors table and invalidates all entries.

void
emberAfPluginPriceServerConversionFactorPub(uint8_t tableIndex, EmberNodeId dstAddr, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a Publish Conversion Factor command using data at the specified table index.

uint32_t

Return the number of seconds until the next conversion factor event becomes active.

void

Refresh the conversion factor information if necessary. If the second conversion factor event is active, the first is inactivated and the array is re-sorted.

emberAfPluginPriceServerCalorificValueAdd(uint8_t endpoint, uint32_t issuerEventId, uint32_t startTime, uint32_t calorificValue, uint8_t calorificValueUnit, uint8_t calorificValueTrailingDigit)

Set values in the calorific value table.

uint32_t

Return the number of seconds until the next calorific value event will become active.

void

Refresh the caloric value information if necessary. If the second calorific value event is active, the first is inactivated and the array is re-sorted.

void

Clear the calorific value table and invalidates all entries.

void
emberAfPluginPriceServerPublishTariffMessage(EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t tariffIndex)

Send a publish tariff information command.

void
emberAfPrintConversionTable(uint8_t endpoint)

Print data in the conversion factor table.

void

Print data in the calorific values table.

uint32_t

Return the number of seconds until the next CO2 value event becomes active.

void

Refresh the CO2 value information if necessary. If the second CO2 value event is active, the first is inactivated and the array is re-sorted.

void
emberAfPluginPriceServerCo2ValueAdd(uint8_t endpoint, uint32_t issuerEventId, uint32_t startTime, uint32_t providerId, uint8_t tariffType, uint32_t co2Value, uint8_t co2ValueUnit, uint8_t co2ValueTrailingDigit)

Set values in the CO2 value table.

void

Clear the CO2 value table and invalidates all entries.

void
emberAfPrintCo2ValuesTable(uint8_t endpoint)

Print data in the CO2 values table.

void
emberAfPluginPriceServerCo2LabelPub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish CO2 value command.

void
emberAfPluginPriceServerTierLabelSet(uint8_t endpoint, uint8_t index, uint8_t valid, uint32_t providerId, uint32_t issuerEventId, uint32_t issuerTariffId, uint8_t tierId, uint8_t *tierLabel)

Set values in the tier label table.

void

Send the next get scheduled prices command.

void
emberAfPluginPriceServerTierLabelAddLabel(uint8_t endpoint, uint32_t issuerTariffId, uint8_t tierId, uint8_t *tierLabel)

Add a tier label to the specified tier label table.

void
emberAfPrintTierLabelsTable(uint8_t endpoint)

Print the tier labels table.

void
emberAfPluginPriceServerTierLabelPub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish tier labels command.

uint32_t

Return the number of seconds until the next billing period event becomes active.

void
emberAfPriceServerRefreshBillingPeriod(uint8_t endpoint, bool force)

Refresh the billing period information if necessary. If the second billing period event is active, the first is inactivated and the array is re-sorted. If the force argument is set to true, the billing period will be forced to refresh.

EmberStatus
emberAfPluginPriceServerBillingPeriodAdd(uint8_t endpoint, uint32_t startTime, uint32_t issuerEventId, uint32_t providerId, uint32_t billingPeriodDuration, uint8_t billingPeriodDurationType, uint8_t tariffType)

Set values in the billing period table.

void
emberAfPluginPriceServerBillingPeriodPub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish billing period command.

void

Print data in the billing period table for the specified endpoint.

void
emberAfPrintConsolidatedBillTableEntry(uint8_t endpoint, uint8_t index)

Print data in the consolidated bills table at the specified index.

void
emberAfPluginPriceServerConsolidatedBillAdd(uint8_t endpoint, uint32_t startTime, uint32_t issuerEventId, uint32_t providerId, uint32_t billingPeriodDuration, uint8_t billingPeriodDurationType, uint8_t tariffType, uint32_t consolidatedBill, uint16_t currency, uint8_t billTrailingDigit)

Set values in the consolidated bills table.

void
emberAfPluginPriceServerConsolidatedBillPub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish consolidated bill command.

void
emberAfPluginPriceServerCppEventSet(uint8_t endpoint, uint8_t valid, uint32_t providerId, uint32_t issuerEventId, uint32_t startTime, uint16_t durationInMinutes, uint8_t tariffType, uint8_t cppPriceTier, uint8_t cppAuth)

Set values of the CPP event.

void
emberAfPluginPriceServerCppEventPub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a publish CPP event command.

void

Print data in the CPP Event.

void
emberAfPluginPriceServerCreditPaymentPub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish credit payment command.

void
emberAfPluginPriceServerCreditPaymentSet(uint8_t endpoint, uint8_t index, uint8_t valid, uint32_t providerId, uint32_t issuerEventId, uint32_t creditPaymentDueDate, uint32_t creditPaymentOverdueAmount, uint8_t creditPaymentStatus, uint32_t creditPayment, uint32_t creditPaymentDate, uint8_t *creditPaymentRef)

Set values in the credit payment table.

void
emberAfPluginPriceServerCurrencyConversionPub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a publish currency conversion command.

void
emberAfPluginPriceServerCurrencyConversionSet(uint8_t endpoint, uint8_t valid, uint32_t providerId, uint32_t issuerEventId, uint32_t startTime, uint16_t oldCurrency, uint16_t newCurrency, uint32_t conversionFactor, uint8_t conversionFactorTrailingDigit, uint32_t currencyChangeControlFlags)

Set values for the currency conversion command.

void
emberAfPluginPriceServerTariffCancellationSet(uint8_t endpoint, uint8_t valid, uint32_t providerId, uint32_t issuerTariffId, uint8_t tariffType)

Set values in the tariff cancellation command.

void
emberAfPluginPriceServerTariffCancellationPub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a cancel tariff command.

void

Refresh tariff information.

bool
emberAfPriceAddTariffTableEntry(uint8_t endpoint, EmberAfPriceCommonInfo *info, const EmberAfScheduledTariff *curTariff)

Add a tariff table entry.

bool
emberAfPriceAddPriceMatrixRaw(uint8_t endpoint, uint32_t providerId, uint32_t issuerEventId, uint32_t startTime, uint32_t issuerTariffId, uint8_t commandIndex, uint8_t numberOfCommands, uint8_t subPayloadControl, uint8_t *payload)

Add price matrix (raw).

bool
emberAfPriceAddPriceMatrix(uint8_t endpoint, EmberAfPriceCommonInfo *info, EmberAfScheduledPriceMatrix *pm)

Add price matrix.

bool
emberAfPriceAddBlockThresholdsTableEntry(uint8_t endpoint, uint32_t providerId, uint32_t issuerEventId, uint32_t startTime, uint32_t issuerTariffId, uint8_t commandIndex, uint8_t numberOfCommands, uint8_t subpayloadControl, uint8_t *payload)
void

Clean the block period table.

void
sendValidCmdEntries(uint8_t cmdId, uint8_t endpoint, uint8_t *validEntries, uint8_t validEntryCount)

Send the next get scheduled prices command.

uint32_t

Get seconds until next active price matrix event.

void

Refresh price matrix information.

uint32_t

Get seconds until next active block threshold event.

void

Refresh block threshold information.

Typedefs#

typedef uint8_t
sli_zigbee_af_price_block_threshold[ZCL_PRICE_CLUSTER_BLOCK_THRESHOLDS_PAYLOAD_SIZE]

Macros#

#define
EMBER_AF_PLUGIN_PRICE_SERVER_PRICE_TABLE_SIZE (5)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_TARIFF_TABLE_SIZE (2)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_BILLING_PERIOD_TABLE_SIZE (2)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_MAX_TIERS_PER_TARIFF (2)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_TIER_LABELS_TABLE_SIZE (2)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_BLOCK_PERIOD_TABLE_SIZE (2)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_CONSOLIDATED_BILL_TABLE_SIZE (5)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_CREDIT_PAYMENT_TABLE_SIZE (5)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_CALORIFIC_VALUE_TABLE_SIZE (2)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_CO2_VALUE_TABLE_SIZE (2)
#define
EMBER_AF_PLUGIN_PRICE_SERVER_CONVERSION_FACTOR_TABLE_SIZE (2)
#define
ZCL_PRICE_CLUSTER_BLOCK_THRESHOLDS_PAYLOAD_SIZE (6u)
#define
ZCL_PRICE_CLUSTER_PRICE_MATRIX_SUBPAYLOAD_BLOCK_SIZE (5u)
#define
fieldLength (field)
#define
ZCL_PRICE_CLUSTER_MAX_TOU_BLOCKS (15u)
#define
ZCL_PRICE_CLUSTER_MAX_TOU_BLOCK_TIERS (15u)
#define
ZCL_PRICE_CLUSTER_MAX_TOU_TIERS (48u)
#define
ZCL_PRICE_CLUSTER_PRICE_MATRIX_SUB_PAYLOAD_ENTRY_SIZE (5u)
#define
CURRENT BIT(1)
#define
FUTURE BIT(2)
#define
PUBLISHED BIT(3)
#define
TARIFF_TYPE_MASK (0x0Fu)
#define
CHARGING_SCHEME_MASK (0xF0u)
#define
tariffIsCurrent (tariff)
#define
tariffIsFuture (tariff)
#define
tariffIsPublished (tariff)
#define
priceMatrixIsCurrent (pm)
#define
priceMatrixIsFuture (pm)
#define
priceMatrixIsPublished (pm)
#define
blockThresholdsIsCurrent (bt)
#define
blockThresholdsIsFuture (bt)
#define
blockThresholdsIsPublished (bt)
#define
CREDIT_PAYMENT_REF_STRING_LEN (20u)
#define
TIER_LABEL_SIZE (12u)

API Documentation#

emberAfPriceServerSendGetScheduledPrices#

void emberAfPriceServerSendGetScheduledPrices (uint8_t endpoint)

Send the next get scheduled prices command.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPriceServerSecondsUntilGetScheduledPricesEvent#

uint32_t emberAfPriceServerSecondsUntilGetScheduledPricesEvent (void )

Return the number of seconds until the next get scheduled prices command should be sent.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • The number of seconds until the next get scheduled prices command should be sent.


emberAfPriceClearPriceTable#

void emberAfPriceClearPriceTable (uint8_t endpoint)

Clear all prices in the price table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPriceClearTariffTable#

void emberAfPriceClearTariffTable (uint8_t endpoint)

Clear all tariffs in the tariff table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPriceClearPriceMatrixTable#

void emberAfPriceClearPriceMatrixTable (uint8_t endpoint)

Clear all price matrices in the price matrix table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPriceClearBlockThresholdsTable#

void emberAfPriceClearBlockThresholdsTable (uint8_t endpoint)

Clear all block thresholds in the block thresholds table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPriceGetPriceTableEntry#

bool emberAfPriceGetPriceTableEntry (uint8_t endpoint, uint8_t index, EmberAfScheduledPrice * price)

Get a price used by the price server plugin.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index in the price table.

EmberAfScheduledPrice *N/Aprice

The EmberAfScheduledPrice structure describing the price.

This function gets a price and metadata that the plugin will send to clients. For "start now" prices that are current or scheduled, the duration is adjusted to reflect how many minutes remain for the price. Otherwise, the start time and duration of "start now" prices reflect the actual start and the original duration.

Returns

  • True if the price was found or false is the index is invalid.


emberAfPluginPriceServerBlockPeriodAdd#

void emberAfPluginPriceServerBlockPeriodAdd (uint8_t endpoint, uint32_t providerId, uint32_t issuerEventId, uint32_t blockPeriodStartTime, uint32_t blockPeriodDuration, uint8_t blockPeriodControl, uint8_t blockPeriodDurationType, uint32_t thresholdMultiplier, uint32_t thresholdDivisor, uint8_t tariffType, uint8_t tariffResolutionPeriod)

Set values in the block period table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AproviderId

A unique identifier for the commodity provider.

uint32_tN/AissuerEventId

The event ID of the block period data.

uint32_tN/AblockPeriodStartTime

Time at which the block period data is valid.

uint32_tN/AblockPeriodDuration

The block period duration. Units are specified by the blockPeriodDurationType.

uint8_tN/AblockPeriodControl

Identifies additional control options for the block period command.

uint8_tN/AblockPeriodDurationType

A bitmap that indicates the units used in the block period.

uint32_tN/AthresholdMultiplier

A bitmap identifying the type of tariff published in this command.

uint32_tN/AthresholdDivisor

The resolution period for the block tariff.

uint8_tN/AtariffType
uint8_tN/AtariffResolutionPeriod

emberAfPluginPriceServerBlockPeriodPub#

void emberAfPluginPriceServerBlockPeriodPub (uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish block period command.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.

uint8_tN/Aindex

The index of the table whose data will be used in the command.


emberAfPluginPriceServerBlockPeriodPrint#

void emberAfPluginPriceServerBlockPeriodPrint (uint8_t endpoint, uint8_t index)

Print data in the specified index of the block period table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index of the table whose index will be printed.


emberAfPriceServerSecondsUntilBlockPeriodEvent#

uint32_t emberAfPriceServerSecondsUntilBlockPeriodEvent (uint8_t endpoint)

Return the number of seconds until the next block period event occurs.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

Returns

  • Returns the number of seconds until the next block period event.


emberAfPriceServerRefreshBlockPeriod#

void emberAfPriceServerRefreshBlockPeriod (uint8_t endpoint, bool repeat)

Update block period attributes to match the current block period.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

boolN/Arepeat

Indicates whether or not to try to repeat the current block period in the next block period. This is also controlled by a bit in the blockPeriodControl, saying whether or not the block period should repeat on expiry.


emberAfPriceGetTariffTableEntry#

bool emberAfPriceGetTariffTableEntry (uint8_t endpoint, uint8_t index, EmberAfPriceCommonInfo * info, EmberAfScheduledTariff * tariff)

Get a tariff used by the price server plugin.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index in the tariff table.

EmberAfPriceCommonInfo *N/Ainfo

The EmberAfPriceCommonInfo structure describing the tariff.

EmberAfScheduledTariff *N/Atariff

The EmberAfScheduledTariff structure describing the tariff.

This function gets a tariff and associated metadata that the plugin will send to clients.

Returns

  • True if the tariff was found.


emberAfPriceGetPriceMatrix#

bool emberAfPriceGetPriceMatrix (uint8_t endpoint, uint8_t index, EmberAfPriceCommonInfo * info, EmberAfScheduledPriceMatrix * pm)

Retrieve a price matrix entry by index.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index in the price matrix table.

EmberAfPriceCommonInfo *N/Ainfo

The EmberAfScheduledPriceMatrix structure describing the price matrix.

EmberAfScheduledPriceMatrix *N/Apm

This function gets a price matrix and associated metadata that the plugin will send to clients.

Returns

  • True if the price matrix was found.


emberAfPriceGetBlockThresholdsTableEntry#

bool emberAfPriceGetBlockThresholdsTableEntry (uint8_t endpoint, uint8_t index, EmberAfScheduledBlockThresholds * bt)

Get the block thresholds used by the Price server plugin.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index in the block thresholds table.

EmberAfScheduledBlockThresholds *N/Abt

The EmberAfScheduledBlockThresholds structure describing the block thresholds.

This function gets the block thresholds and associated metadata that the plugin will send to clients.

Returns

  • True if the block thresholds was found.


emberAfPriceGetTariffByIssuerTariffId#

bool emberAfPriceGetTariffByIssuerTariffId (uint8_t endpoint, uint32_t issuerTariffId, EmberAfPriceCommonInfo * info, EmberAfScheduledTariff * tariff)

Get a tariff by issuer tariff ID and endpoint.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AissuerTariffId

The issuer tariff ID.

EmberAfPriceCommonInfo *N/Ainfo

The EmberAfPriceCommonInfo structure describing the tariff.

EmberAfScheduledTariff *N/Atariff

The EmberAfScheduledTariff structure describing the tariff.

Returns

  • True if the tariff was found.


emberAfPriceGetPriceMatrixByIssuerTariffId#

bool emberAfPriceGetPriceMatrixByIssuerTariffId (uint8_t endpoint, uint32_t issuerTariffId, EmberAfPriceCommonInfo * info, EmberAfScheduledPriceMatrix * pm)

Get a price matrix by issuer tariff ID and endpoint.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AissuerTariffId

The issuer tariff ID.

EmberAfPriceCommonInfo *N/Ainfo

The EmberAfScheduledPriceMatrix structure describing the price matrix.

EmberAfScheduledPriceMatrix *N/Apm

Returns

  • True if the price matrix was found.


emberAfPriceGetBlockThresholdsByIssuerTariffId#

bool emberAfPriceGetBlockThresholdsByIssuerTariffId (uint8_t endpoint, uint32_t issuerTariffId, EmberAfPriceCommonInfo * info, EmberAfScheduledBlockThresholds * bt)

Get the block thresholds by issuer tariff ID and endpoint.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint32_tN/AissuerTariffId

The issuer tariff ID.

EmberAfPriceCommonInfo *N/Ainfo

The EmberAfScheduledBlockThresholds structure describing the block thresholds.

EmberAfScheduledBlockThresholds *N/Abt

Returns

  • True if the block thresholds were found.


emberAfPriceSetPriceTableEntry#

bool emberAfPriceSetPriceTableEntry (uint8_t endpoint, uint8_t index, const EmberAfScheduledPrice * price)

Set a price used by the price server plugin.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index in the price table.

const EmberAfScheduledPrice *N/Aprice

The EmberAfScheduledPrice structure describing the price. If NULL, the price is removed from the server.

This function sets a price and metadata that the plugin will send to clients. Setting the start time to zero instructs clients to start the price now. For "start now" prices, the plugin will automatically adjust the duration reported to clients based on the original start time of the price.

Returns

  • True if the price was set or removed or false is the index is invalid.


emberAfPriceSetTariffTableEntry#

bool emberAfPriceSetTariffTableEntry (uint8_t endpoint, uint8_t index, EmberAfPriceCommonInfo * info, const EmberAfScheduledTariff * tariff)

Set a tariff used by the price server plugin.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index in the tariff table.

EmberAfPriceCommonInfo *N/Ainfo

The EmberAfScheduledTariff structure describing the tariff. If NULL, the tariff is removed from the server.

const EmberAfScheduledTariff *N/Atariff

This function sets a tariff and metadata that the plugin will send to clients.

Returns

  • True if the tariff was set or removed, or false if the index is invalid.


emberAfPriceSetPriceMatrix#

bool emberAfPriceSetPriceMatrix (uint8_t endpoint, uint8_t index, EmberAfPriceCommonInfo * info, const EmberAfScheduledPriceMatrix * pm)

Set a price matrix entry by index.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index in the price matrix table.

EmberAfPriceCommonInfo *N/Ainfo

The EmberAfScheduledPriceMatrix structure describing the price matrix. If NULL, the price matrix is removed from the server.

const EmberAfScheduledPriceMatrix *N/Apm

This function sets a price matrix and metadata that the plugin will send to clients.

Returns

  • True if the price matrix was set or removed, or false if the index is invalid.


emberAfPriceSetBlockThresholdsTableEntry#

bool emberAfPriceSetBlockThresholdsTableEntry (uint8_t endpoint, uint8_t index, const EmberAfPriceCommonInfo * info, const EmberAfScheduledBlockThresholds * bt)

Set the block thresholds used by the price server plugin.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

uint8_tN/Aindex

The index in the block thresholds table.

const EmberAfPriceCommonInfo *N/Ainfo

The EmberAfScheduledBlockThresholds structure describing the block thresholds. If NULL, the block thresholds entry is removed from the table.

const EmberAfScheduledBlockThresholds *N/Abt

This function sets the block thresholds and metadata that the plugin will send to clients.

Returns

  • True if the block thresholds was set or removed, or false if the index is invalid.


emberAfGetCurrentPrice#

bool emberAfGetCurrentPrice (uint8_t endpoint, EmberAfScheduledPrice * price)

Get the current price used by the price server plugin.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

EmberAfScheduledPrice *N/Aprice

The EmberAfScheduledPrice structure describing the price.

This function gets the current price and metadata that the plugin will send to clients. For "start now" prices, the duration is adjusted to reflect how many minutes remain for the price. Otherwise, the start time and duration reflect the actual start and the original duration.

Returns

  • True if the current price was found or false is there is no current price.


emberAfPriceFindFreePriceIndex#

uint8_t emberAfPriceFindFreePriceIndex (uint8_t endpoint)

Find the first free index in the price table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

This function looks through the price table and determines whether the entry is in-use or scheduled to be in use. If not, it's considered "free" for the purposes of the user adding a new price entry to the server's table and the index is returned.

Returns

  • The index of the first free (unused/unscheduled) entry in the requested endpoint's price table, or ZCL_PRICE_INVALID_INDEX if no available entry could be found.


emberAfPricePrint#

void emberAfPricePrint (const EmberAfScheduledPrice * price)

function to print price

Parameters
TypeDirectionArgument NameDescription
const EmberAfScheduledPrice *N/Aprice

emberAfPricePrintPriceTable#

void emberAfPricePrintPriceTable (uint8_t endpoint)
Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

Print the price table.


emberAfPricePrintTariff#

void emberAfPricePrintTariff (const EmberAfPriceCommonInfo * info, const EmberAfScheduledTariff * tariff)
Parameters
TypeDirectionArgument NameDescription
const EmberAfPriceCommonInfo *N/Ainfo

pointer to the common info struct

const EmberAfScheduledTariff *N/Atariff

pointer to the scheduled tariff struct

Print tariff.


emberAfPricePrintTariffTable#

void emberAfPricePrintTariffTable (uint8_t endpoint)

Print tariff table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


emberAfPricePrintPriceMatrix#

void emberAfPricePrintPriceMatrix (uint8_t endpoint, const EmberAfPriceCommonInfo * info, const EmberAfScheduledPriceMatrix * pm)

Print price matrix.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

const EmberAfPriceCommonInfo *N/Ainfo

pointer to common info struct

const EmberAfScheduledPriceMatrix *N/Apm

pointer to scheduled price matrix struct


emberAfPricePrintPriceMatrixTable#

void emberAfPricePrintPriceMatrixTable (uint8_t endpoint)

Print price matrix table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


emberAfPricePrintBlockThresholds#

void emberAfPricePrintBlockThresholds (uint8_t endpoint, const EmberAfPriceCommonInfo * info, const EmberAfScheduledBlockThresholds * bt)

Print block thresholds.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

const EmberAfPriceCommonInfo *N/Ainfo

pointer to common info struct

const EmberAfScheduledBlockThresholds *N/Abt

pointer to block threshold struct


emberAfPricePrintBlockThresholdsTable#

void emberAfPricePrintBlockThresholdsTable (uint8_t endpoint)

Print block threshold table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


emberAfPluginPriceServerPublishPriceMessage#

void emberAfPluginPriceServerPublishPriceMessage (EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t priceIndex)

Publish price message.

Parameters
TypeDirectionArgument NameDescription
EmberNodeIdN/AnodeId
uint8_tN/AsrcEndpoint
uint8_tN/AdstEndpoint
uint8_tN/ApriceIndex

emberAfPluginPriceServerConversionFactorAdd#

EmberAfStatus emberAfPluginPriceServerConversionFactorAdd (uint8_t endpoint, uint32_t issuerEventId, uint32_t startTime, uint32_t conversionFactor, uint8_t conversionFactorTrailingDigit)

Set parameters in the conversion factors table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint32_tN/AissuerEventId

The event ID of the conversion factor data.

uint32_tN/AstartTime

The time when the conversion factor data is valid.

uint32_tN/AconversionFactor

Accounts for changes in the volume of gas based on temperature and pressure.

uint8_tN/AconversionFactorTrailingDigit

Determines where the decimal point is located in the conversion factor.


emberAfPluginPriceServerConversionFactorClear#

void emberAfPluginPriceServerConversionFactorClear (uint8_t endpoint)

Clear the conversion factors table and invalidates all entries.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPluginPriceServerConversionFactorPub#

void emberAfPluginPriceServerConversionFactorPub (uint8_t tableIndex, EmberNodeId dstAddr, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a Publish Conversion Factor command using data at the specified table index.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/AtableIndex

The index of the conversion factor table whose data should be used in the publish conversion factor command.

EmberNodeIdN/AdstAddr

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.


emberAfPriceServerSecondsUntilConversionFactorEvent#

uint32_t emberAfPriceServerSecondsUntilConversionFactorEvent (uint8_t endpoint)

Return the number of seconds until the next conversion factor event becomes active.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question

Returns

  • The number of seconds until the next conversion factor event becomes active.


emberAfPriceServerRefreshConversionFactor#

void emberAfPriceServerRefreshConversionFactor (uint8_t endpoint)

Refresh the conversion factor information if necessary. If the second conversion factor event is active, the first is inactivated and the array is re-sorted.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPluginPriceServerCalorificValueAdd#

EmberAfStatus emberAfPluginPriceServerCalorificValueAdd (uint8_t endpoint, uint32_t issuerEventId, uint32_t startTime, uint32_t calorificValue, uint8_t calorificValueUnit, uint8_t calorificValueTrailingDigit)

Set values in the calorific value table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question @issuerEventId The event ID of the calorific value data. @startTime The time at which the calorific value data is valid. @calorificValue The amount of heat generated when a given mass of fuel is burned. @calorificValueTrailingDigit Determines where the decimal point is located in the calorific value.

uint32_tN/AissuerEventId
uint32_tN/AstartTime
uint32_tN/AcalorificValue
uint8_tN/AcalorificValueUnit
uint8_tN/AcalorificValueTrailingDigit

emberAfPriceServerSecondsUntilCalorificValueEvent#

uint32_t emberAfPriceServerSecondsUntilCalorificValueEvent (uint8_t endpoint)

Return the number of seconds until the next calorific value event will become active.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question

Returns

  • The number of seconds until the next calorific value event becomes active.


emberAfPriceServerRefreshCalorificValue#

void emberAfPriceServerRefreshCalorificValue (uint8_t endpoint)

Refresh the caloric value information if necessary. If the second calorific value event is active, the first is inactivated and the array is re-sorted.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPluginPriceServerCalorificValueClear#

void emberAfPluginPriceServerCalorificValueClear (uint8_t endpoint)

Clear the calorific value table and invalidates all entries.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPluginPriceServerPublishTariffMessage#

void emberAfPluginPriceServerPublishTariffMessage (EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t tariffIndex)

Send a publish tariff information command.

Parameters
TypeDirectionArgument NameDescription
EmberNodeIdN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.

uint8_tN/AtariffIndex

The index of the tariff table whose data will be used in the Publish Tariff Information command.


emberAfPrintConversionTable#

void emberAfPrintConversionTable (uint8_t endpoint)

Print data in the conversion factor table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPrintCalorificValuesTable#

void emberAfPrintCalorificValuesTable (uint8_t endpoint)

Print data in the calorific values table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPriceServerSecondsUntilCO2ValueEvent#

uint32_t emberAfPriceServerSecondsUntilCO2ValueEvent (uint8_t endpoint)

Return the number of seconds until the next CO2 value event becomes active.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

Returns

  • The number of seconds until the next CO2 value event becomes active.


emberAfPriceServerRefreshCO2Value#

void emberAfPriceServerRefreshCO2Value (uint8_t endpoint)

Refresh the CO2 value information if necessary. If the second CO2 value event is active, the first is inactivated and the array is re-sorted.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPluginPriceServerCo2ValueAdd#

void emberAfPluginPriceServerCo2ValueAdd (uint8_t endpoint, uint32_t issuerEventId, uint32_t startTime, uint32_t providerId, uint8_t tariffType, uint32_t co2Value, uint8_t co2ValueUnit, uint8_t co2ValueTrailingDigit)

Set values in the CO2 value table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint32_tN/AissuerEventId

The event ID of the CO2 value table data.

uint32_tN/AstartTime

The time at which the CO2 value data is valid.

uint32_tN/AproviderId

A unique identifier for the commodity provider.

uint8_tN/AtariffType

Bitmap identifying the type of tariff published in this command.

uint32_tN/Aco2Value

Used to calculate the amount of carbon dioxide produced from energy use.

uint8_tN/Aco2ValueUnit

An enumeration which defines the unit of the co2Value attribute.

uint8_tN/Aco2ValueTrailingDigit

Determines where the decimal point is located in the co2Value.


emberAfPluginPriceServerCo2ValueClear#

void emberAfPluginPriceServerCo2ValueClear (uint8_t endpoint)

Clear the CO2 value table and invalidates all entries.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPrintCo2ValuesTable#

void emberAfPrintCo2ValuesTable (uint8_t endpoint)

Print data in the CO2 values table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPluginPriceServerCo2LabelPub#

void emberAfPluginPriceServerCo2LabelPub (uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish CO2 value command.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.

uint8_tN/Aindex

The index of the CO2 values table whose data will be used in the command.


emberAfPluginPriceServerTierLabelSet#

void emberAfPluginPriceServerTierLabelSet (uint8_t endpoint, uint8_t index, uint8_t valid, uint32_t providerId, uint32_t issuerEventId, uint32_t issuerTariffId, uint8_t tierId, uint8_t * tierLabel)

Set values in the tier label table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint8_tN/Aindex

The index of the billing period table whose data will be modified.

uint8_tN/Avalid

Indicates if data at this index is valid or not.

uint32_tN/AproviderId

A unique identifier for the commodity provider.

uint32_tN/AissuerEventId

The event ID of the tier labels table data.

uint32_tN/AissuerTariffId

A unique identifier that identifies which tariff the labels apply to.

uint8_tN/AtierId

The tier number that associated tier label applies to.

uint8_t *N/AtierLabel

A character string descriptor for this tier.


emberAfPrintPrintTierLabelsTable#

void emberAfPrintPrintTierLabelsTable (void )

Send the next get scheduled prices command.

Parameters
TypeDirectionArgument NameDescription
voidN/A

The endpoint in question.


emberAfPluginPriceServerTierLabelAddLabel#

void emberAfPluginPriceServerTierLabelAddLabel (uint8_t endpoint, uint32_t issuerTariffId, uint8_t tierId, uint8_t * tierLabel)

Add a tier label to the specified tier label table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint32_tN/AissuerTariffId

A unique identifier that identifies which tariff the labels apply to.

uint8_tN/AtierId

The tier number that associated tier label applies to.

uint8_t *N/AtierLabel

Character string descriptor for this tier.


emberAfPrintTierLabelsTable#

void emberAfPrintTierLabelsTable (uint8_t endpoint)

Print the tier labels table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPluginPriceServerTierLabelPub#

void emberAfPluginPriceServerTierLabelPub (uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish tier labels command.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.

uint8_tN/Aindex

The index of the tier labels table whose data will be used in the Publish Tier Labels command.


emberAfPriceServerSecondsUntilBillingPeriodEvent#

uint32_t emberAfPriceServerSecondsUntilBillingPeriodEvent (uint8_t endpoint)

Return the number of seconds until the next billing period event becomes active.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

Returns

  • The number of seconds until the next billing period event becomes active.


emberAfPriceServerRefreshBillingPeriod#

void emberAfPriceServerRefreshBillingPeriod (uint8_t endpoint, bool force)

Refresh the billing period information if necessary. If the second billing period event is active, the first is inactivated and the array is re-sorted. If the force argument is set to true, the billing period will be forced to refresh.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

boolN/Aforce

Whether or not the billing period should be forced to refresh.


emberAfPluginPriceServerBillingPeriodAdd#

EmberStatus emberAfPluginPriceServerBillingPeriodAdd (uint8_t endpoint, uint32_t startTime, uint32_t issuerEventId, uint32_t providerId, uint32_t billingPeriodDuration, uint8_t billingPeriodDurationType, uint8_t tariffType)

Set values in the billing period table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint32_tN/AstartTime

The time at which the billing period data is valid.

uint32_tN/AissuerEventId

The event ID of the billing period data.

uint32_tN/AproviderId

A unique identifier for the commodity provider.

uint32_tN/AbillingPeriodDuration

The billing period duration. Units are specified by the billingPeriodDurationType.

uint8_tN/AbillingPeriodDurationType

A bitmap that indicates the units used in the billing period.

uint8_tN/AtariffType

Bitmap identifying the type of tariff published in this command.


emberAfPluginPriceServerBillingPeriodPub#

void emberAfPluginPriceServerBillingPeriodPub (uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish billing period command.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.

uint8_tN/Aindex

The index of the table whose data will be used in the command.


emberAfPrintBillingPeriodTable#

void emberAfPrintBillingPeriodTable (uint8_t endpoint)

Print data in the billing period table for the specified endpoint.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPrintConsolidatedBillTableEntry#

void emberAfPrintConsolidatedBillTableEntry (uint8_t endpoint, uint8_t index)

Print data in the consolidated bills table at the specified index.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint8_tN/Aindex

The index of the consolidated bills table whose data should be printed.


emberAfPluginPriceServerConsolidatedBillAdd#

void emberAfPluginPriceServerConsolidatedBillAdd (uint8_t endpoint, uint32_t startTime, uint32_t issuerEventId, uint32_t providerId, uint32_t billingPeriodDuration, uint8_t billingPeriodDurationType, uint8_t tariffType, uint32_t consolidatedBill, uint16_t currency, uint8_t billTrailingDigit)

Set values in the consolidated bills table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint32_tN/AstartTime

The time at which the consolidated bills data is valid.

uint32_tN/AissuerEventId

The event ID of the consolidated bills data.

uint32_tN/AproviderId

A unique identifier for the commodity provider.

uint32_tN/AbillingPeriodDuration

The billing period duration. Units are specified by the billingPeriodDurationType.

uint8_tN/AbillingPeriodDurationType

A bitmap that indicates the units used in the billing period.

uint8_tN/AtariffType

Bitmap identifying the type of tariff published in this command.

uint32_tN/AconsolidatedBill

The consolidated bill value for the specified billing period.

uint16_tN/Acurrency

The currency used in the consolidatedBill field.

uint8_tN/AbillTrailingDigit

Determines where the decimal point is located in the consolidatedBill field.


emberAfPluginPriceServerConsolidatedBillPub#

void emberAfPluginPriceServerConsolidatedBillPub (uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish consolidated bill command.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.

uint8_tN/Aindex

The index of the table whose data will be used in the command.


emberAfPluginPriceServerCppEventSet#

void emberAfPluginPriceServerCppEventSet (uint8_t endpoint, uint8_t valid, uint32_t providerId, uint32_t issuerEventId, uint32_t startTime, uint16_t durationInMinutes, uint8_t tariffType, uint8_t cppPriceTier, uint8_t cppAuth)

Set values of the CPP event.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint8_tN/Avalid

Indicates if the CPP Event data is valid or not.

uint32_tN/AproviderId

A unique identifier for the commodity provider.

uint32_tN/AissuerEventId

The event ID of the CPP Event.

uint32_tN/AstartTime

The time at which the CPP Event data is valid.

uint16_tN/AdurationInMinutes

Defines the duration of the CPP Event.

uint8_tN/AtariffType

Bitmap identifying the type of tariff published in this command.

uint8_tN/AcppPriceTier

Indicates which CPP price tier should be used for the event.

uint8_tN/AcppAuth

The status of the CPP event.


emberAfPluginPriceServerCppEventPub#

void emberAfPluginPriceServerCppEventPub (uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a publish CPP event command.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.


emberAfPluginPriceServerCppEventPrint#

void emberAfPluginPriceServerCppEventPrint (uint8_t endpoint)

Print data in the CPP Event.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


emberAfPluginPriceServerCreditPaymentPub#

void emberAfPluginPriceServerCreditPaymentPub (uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish credit payment command.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.

uint8_tN/Aindex

The index of the table whose data will be used in the command.


emberAfPluginPriceServerCreditPaymentSet#

void emberAfPluginPriceServerCreditPaymentSet (uint8_t endpoint, uint8_t index, uint8_t valid, uint32_t providerId, uint32_t issuerEventId, uint32_t creditPaymentDueDate, uint32_t creditPaymentOverdueAmount, uint8_t creditPaymentStatus, uint32_t creditPayment, uint32_t creditPaymentDate, uint8_t * creditPaymentRef)

Set values in the credit payment table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint8_tN/Aindex

The index of the credit payment table whose data will be modified.

uint8_tN/Avalid

Indicates if data at this index is valid or not.

uint32_tN/AproviderId

A unique identifier for the commodity provider.

uint32_tN/AissuerEventId

The event ID of the credit payment data.

uint32_tN/AcreditPaymentDueDate

The time the next credit payment is due.

uint32_tN/AcreditPaymentOverdueAmount

The current amount that is overdue from the customer.

uint8_tN/AcreditPaymentStatus

Indicates the current credit payment status.

uint32_tN/AcreditPayment

The amount of the last credit payment.

uint32_tN/AcreditPaymentDate

The time at which the last credit payment was made.

uint8_t *N/AcreditPaymentRef

A string used to denote the last credit payment reference used by the energy supplier.


emberAfPluginPriceServerCurrencyConversionPub#

void emberAfPluginPriceServerCurrencyConversionPub (uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a publish currency conversion command.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.


emberAfPluginPriceServerCurrencyConversionSet#

void emberAfPluginPriceServerCurrencyConversionSet (uint8_t endpoint, uint8_t valid, uint32_t providerId, uint32_t issuerEventId, uint32_t startTime, uint16_t oldCurrency, uint16_t newCurrency, uint32_t conversionFactor, uint8_t conversionFactorTrailingDigit, uint32_t currencyChangeControlFlags)

Set values for the currency conversion command.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint8_tN/Avalid

Indicates if the currency conversion data is valid or not.

uint32_tN/AproviderId

A unique identifier for the commodity provider.

uint32_tN/AissuerEventId

The event ID of the currency conversion data.

uint32_tN/AstartTime

The time at which the currency conversion data is valid.

uint16_tN/AoldCurrency

Information about the old unit of currency.

uint16_tN/AnewCurrency

Information about the new unit of currency.

uint32_tN/AconversionFactor

Accounts for changes in the volume of gas based on temperature and pressure.

uint8_tN/AconversionFactorTrailingDigit

Determines where the decimal point is located in the conversion factor.

uint32_tN/AcurrencyChangeControlFlags

Denotes functions that are required to be carried out by the client.


emberAfPluginPriceServerTariffCancellationSet#

void emberAfPluginPriceServerTariffCancellationSet (uint8_t endpoint, uint8_t valid, uint32_t providerId, uint32_t issuerTariffId, uint8_t tariffType)

Set values in the tariff cancellation command.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.

uint8_tN/Avalid

Indicates if the tariff cancellation command is valid or not.

uint32_tN/AproviderId

A unique identifier for the commodity provider.

uint32_tN/AissuerTariffId

Unique identifier that identifies which tariff should be canceled.

uint8_tN/AtariffType

A bitmap identifying the type of tariff to be canceled.


emberAfPluginPriceServerTariffCancellationPub#

void emberAfPluginPriceServerTariffCancellationPub (uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a cancel tariff command.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AnodeId

The destination address to which the command should be sent.

uint8_tN/AsrcEndpoint

The source endpoint used in the transmission.

uint8_tN/AdstEndpoint

The destination endpoint used in the transmission.


emberAfPriceServerSecondsUntilTariffInfoEvent#

uint32_t emberAfPriceServerSecondsUntilTariffInfoEvent (uint8_t endpoint)
Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

Get seconds until the next tariff info event.

Returns

  • unit32_t seconds until next tariff info event


emberAfPriceServerRefreshTariffInformation#

void emberAfPriceServerRefreshTariffInformation (uint8_t endpoint)

Refresh tariff information.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


emberAfPriceAddTariffTableEntry#

bool emberAfPriceAddTariffTableEntry (uint8_t endpoint, EmberAfPriceCommonInfo * info, const EmberAfScheduledTariff * curTariff)

Add a tariff table entry.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

EmberAfPriceCommonInfo *N/Ainfo

pointer to common info struct

const EmberAfScheduledTariff *N/AcurTariff

pointer to scheduled tariff struct

Returns

  • bool true is success


emberAfPriceAddPriceMatrixRaw#

bool emberAfPriceAddPriceMatrixRaw (uint8_t endpoint, uint32_t providerId, uint32_t issuerEventId, uint32_t startTime, uint32_t issuerTariffId, uint8_t commandIndex, uint8_t numberOfCommands, uint8_t subPayloadControl, uint8_t * payload)

Add price matrix (raw).

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

uint32_tN/AproviderId
uint32_tN/AissuerEventId
uint32_tN/AstartTime
uint32_tN/AissuerTariffId
uint8_tN/AcommandIndex
uint8_tN/AnumberOfCommands
uint8_tN/AsubPayloadControl
uint8_t *N/Apayload

Returns

  • bool true is success


emberAfPriceAddPriceMatrix#

bool emberAfPriceAddPriceMatrix (uint8_t endpoint, EmberAfPriceCommonInfo * info, EmberAfScheduledPriceMatrix * pm)

Add price matrix.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

EmberAfPriceCommonInfo *N/Ainfo

pointer to the common info struct

EmberAfScheduledPriceMatrix *N/Apm

pointer to the scheduled price matrix struct

Returns

  • bool true is success


emberAfPriceAddBlockThresholdsTableEntry#

bool emberAfPriceAddBlockThresholdsTableEntry (uint8_t endpoint, uint32_t providerId, uint32_t issuerEventId, uint32_t startTime, uint32_t issuerTariffId, uint8_t commandIndex, uint8_t numberOfCommands, uint8_t subpayloadControl, uint8_t * payload)
Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

uint32_tN/AproviderId
uint32_tN/AissuerEventId
uint32_tN/AstartTime
uint32_tN/AissuerTariffId
uint8_tN/AcommandIndex
uint8_tN/AnumberOfCommands
uint8_tN/AsubpayloadControl
uint8_t *N/Apayload

Add a table entry for block threshold table.

Returns

  • bool true is success


emberAfPriceClearBlockPeriodTable#

void emberAfPriceClearBlockPeriodTable (uint8_t endpoint)

Clean the block period table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


sendValidCmdEntries#

void sendValidCmdEntries (uint8_t cmdId, uint8_t endpoint, uint8_t * validEntries, uint8_t validEntryCount)

Send the next get scheduled prices command.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/AcmdId

The endpoint in question.

uint8_tN/Aendpoint
uint8_t *N/AvalidEntries
uint8_tN/AvalidEntryCount

emberAfPluginPriceServerPriceUpdateBindings#

void emberAfPluginPriceServerPriceUpdateBindings (void )

Update bindings.

Parameters
TypeDirectionArgument NameDescription
voidN/A

emberAfPriceServerSecondsUntilActivePriceMatrixEvent#

uint32_t emberAfPriceServerSecondsUntilActivePriceMatrixEvent (uint8_t endpoint)

Get seconds until next active price matrix event.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

Returns

  • uint32_t seconds until next price matrix event


emberAfPriceServerRefreshPriceMatrixInformation#

void emberAfPriceServerRefreshPriceMatrixInformation (uint8_t endpoint)

Refresh price matrix information.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


emberAfPriceServerSecondsUntilActiveBlockThresholdsEvent#

uint32_t emberAfPriceServerSecondsUntilActiveBlockThresholdsEvent (uint8_t endpoint)

Get seconds until next active block threshold event.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

Returns

  • uint32_t seconds until next block threshold event


emberAfPriceServerRefreshBlockThresholdsInformation#

void emberAfPriceServerRefreshBlockThresholdsInformation (uint8_t endpoint)

Refresh block threshold information.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


Typedef Documentation#

sli_zigbee_af_price_block_threshold#

typedef uint8_t sli_zigbee_af_price_block_threshold[ZCL_PRICE_CLUSTER_BLOCK_THRESHOLDS_PAYLOAD_SIZE] [ZCL_PRICE_CLUSTER_BLOCK_THRESHOLDS_PAYLOAD_SIZE]

Variable Documentation#

priceServerInfo#

EmberAfPriceServerInfo priceServerInfo