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#

sl_zigbee_af_price_block_period_t

sl_zigbee_af_price_billing_period_t

sl_zigbee_af_price_cpp_event_t

sl_zigbee_af_price_consolidated_bills_t

sl_zigbee_af_price_credit_payment_t

sl_zigbee_af_price_conversion_factor_t

sl_zigbee_af_price_calorific_value_t

sl_zigbee_af_price_cancel_tariff_t

sl_zigbee_af_price_co2_value_t

sl_zigbee_af_price_currency_conversion_t

sl_zigbee_af_price_tier_label_value_t

sl_zigbee_af_price_tier_label_table_t

sl_zigbee_af_price_block_period_table_t

sl_zigbee_af_price_billing_period_table_t

sl_zigbee_af_price_cpp_table_t

sl_zigbee_af_price_consolidated_bills_table_t

sl_zigbee_af_price_credit_payment_table_t

sl_zigbee_af_price_conversion_factor_table_t

sl_zigbee_af_price_calorific_value_table_t

sl_zigbee_af_price_co2_table_t

sl_zigbee_af_price_currency_conversion_table_t

sl_zigbee_af_price_cancel_tariff_table_t

sl_zigbee_af_scheduled_block_thresholds_t

sl_zigbee_af_scheduled_block_thresholds_table_t

sl_zigbee_af_scheduled_tariff_t

sl_zigbee_af_scheduled_tariff_table_t

sl_zigbee_af_scheduled_price_matrix_t

sl_zigbee_af_scheduled_price_matrix_table_t

sl_zigbee_af_price_server_info_t

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

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
sl_zigbee_af_price_get_price_table_entry(uint8_t endpoint, uint8_t index, sl_zigbee_af_scheduled_price_t *price)

Get a price used by the price server plugin.

void
sl_zigbee_af_price_server_block_period_add(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
sl_zigbee_af_price_server_block_period_pub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish block period command.

void
sl_zigbee_af_price_server_block_period_print(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
sl_zigbee_af_price_server_refresh_block_period(uint8_t endpoint, bool repeat)

Update block period attributes to match the current block period.

bool
sl_zigbee_af_price_get_tariff_table_entry(uint8_t endpoint, uint8_t index, sl_zigbee_af_price_common_info_t *info, sl_zigbee_af_scheduled_tariff_t *tariff)

Get a tariff used by the price server plugin.

bool
sl_zigbee_af_price_get_price_matrix(uint8_t endpoint, uint8_t index, sl_zigbee_af_price_common_info_t *info, sl_zigbee_af_scheduled_price_matrix_t *pm)

Retrieve a price matrix entry by index.

bool
sl_zigbee_af_price_get_block_thresholds_table_entry(uint8_t endpoint, uint8_t index, sl_zigbee_af_scheduled_block_thresholds_t *bt)

Get the block thresholds used by the Price server plugin.

bool
sl_zigbee_af_price_get_tariff_by_issuer_tariff_id(uint8_t endpoint, uint32_t issuerTariffId, sl_zigbee_af_price_common_info_t *info, sl_zigbee_af_scheduled_tariff_t *tariff)

Get a tariff by issuer tariff ID and endpoint.

bool
sl_zigbee_af_price_get_price_matrix_by_issuer_tariff_id(uint8_t endpoint, uint32_t issuerTariffId, sl_zigbee_af_price_common_info_t *info, sl_zigbee_af_scheduled_price_matrix_t *pm)

Get a price matrix by issuer tariff ID and endpoint.

bool
sl_zigbee_af_price_get_block_thresholds_by_issuer_tariff_id(uint8_t endpoint, uint32_t issuerTariffId, sl_zigbee_af_price_common_info_t *info, sl_zigbee_af_scheduled_block_thresholds_t *bt)

Get the block thresholds by issuer tariff ID and endpoint.

bool
sl_zigbee_af_price_set_price_table_entry(uint8_t endpoint, uint8_t index, const sl_zigbee_af_scheduled_price_t *price)

Set a price used by the price server plugin.

bool
sl_zigbee_af_price_set_tariff_table_entry(uint8_t endpoint, uint8_t index, sl_zigbee_af_price_common_info_t *info, const sl_zigbee_af_scheduled_tariff_t *tariff)

Set a tariff used by the price server plugin.

bool
sl_zigbee_af_price_set_price_matrix(uint8_t endpoint, uint8_t index, sl_zigbee_af_price_common_info_t *info, const sl_zigbee_af_scheduled_price_matrix_t *pm)

Set a price matrix entry by index.

bool
sl_zigbee_af_price_set_block_thresholds_table_entry(uint8_t endpoint, uint8_t index, const sl_zigbee_af_price_common_info_t *info, const sl_zigbee_af_scheduled_block_thresholds_t *bt)

Set the block thresholds used by the price server plugin.

bool
sl_zigbee_af_get_current_price(uint8_t endpoint, sl_zigbee_af_scheduled_price_t *price)

Get the current price used by the price server plugin.

uint8_t

Find the first free index in the price table.

void
sl_zigbee_af_price_print(const sl_zigbee_af_scheduled_price_t *price)

function to print price

void
sl_zigbee_af_price_print_tariff(const sl_zigbee_af_price_common_info_t *info, const sl_zigbee_af_scheduled_tariff_t *tariff)
void

Print tariff table.

void
sl_zigbee_af_price_print_price_matrix(uint8_t endpoint, const sl_zigbee_af_price_common_info_t *info, const sl_zigbee_af_scheduled_price_matrix_t *pm)

Print price matrix.

void

Print price matrix table.

void
sl_zigbee_af_price_print_block_thresholds(uint8_t endpoint, const sl_zigbee_af_price_common_info_t *info, const sl_zigbee_af_scheduled_block_thresholds_t *bt)

Print block thresholds.

void

Print block threshold table.

void
sl_zigbee_af_price_server_publish_price_message(sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t priceIndex)

Publish price message.

sl_zigbee_af_price_server_conversion_factor_add(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
sl_zigbee_af_price_server_conversion_factor_pub(uint8_t tableIndex, sl_802154_short_addr_t 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.

sl_zigbee_af_price_server_calorific_value_add(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
sl_zigbee_af_price_server_publish_tariff_message(sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t tariffIndex)

Send a publish tariff information command.

void

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
sl_zigbee_af_price_server_co2_value_add(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

Print data in the CO2 values table.

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

Send a publish CO2 value command.

void
sl_zigbee_af_price_server_tier_label_set(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
sl_zigbee_af_price_server_tier_label_add_label(uint8_t endpoint, uint32_t issuerTariffId, uint8_t tierId, uint8_t *tierLabel)

Add a tier label to the specified tier label table.

void

Print the tier labels table.

void
sl_zigbee_af_price_server_tier_label_pub(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

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.

sl_zigbee_af_price_server_billing_period_add(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
sl_zigbee_af_price_server_billing_period_pub(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
sl_zigbee_af_print_consolidated_bill_table_entry(uint8_t endpoint, uint8_t index)

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

void
sl_zigbee_af_price_server_consolidated_bill_add(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
sl_zigbee_af_price_server_consolidated_bill_pub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t index)

Send a publish consolidated bill command.

void
sl_zigbee_af_price_server_cpp_event_set(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
sl_zigbee_af_price_server_cpp_event_pub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a publish CPP event command.

void

Print data in the CPP Event.

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

Send a publish credit payment command.

void
sl_zigbee_af_price_server_credit_payment_set(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
sl_zigbee_af_price_server_currency_conversion_pub(uint16_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint)

Send a publish currency conversion command.

void
sl_zigbee_af_price_server_currency_conversion_set(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
sl_zigbee_af_price_server_tariff_cancellation_set(uint8_t endpoint, uint8_t valid, uint32_t providerId, uint32_t issuerTariffId, uint8_t tariffType)

Set values in the tariff cancellation command.

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

Send a cancel tariff command.

void

Refresh tariff information.

bool
sl_zigbee_af_price_add_tariff_table_entry(uint8_t endpoint, sl_zigbee_af_price_common_info_t *info, const sl_zigbee_af_scheduled_tariff_t *curTariff)

Add a tariff table entry.

bool
sl_zigbee_af_price_add_price_matrix_raw(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
sl_zigbee_af_price_add_price_matrix(uint8_t endpoint, sl_zigbee_af_price_common_info_t *info, sl_zigbee_af_scheduled_price_matrix_t *pm)

Add price matrix.

bool
sl_zigbee_af_price_add_block_thresholds_table_entry(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
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_PRICE_TABLE_SIZE (5)
#define
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_TARIFF_TABLE_SIZE (2)
#define
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_BILLING_PERIOD_TABLE_SIZE (2)
#define
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_MAX_TIERS_PER_TARIFF (2)
#define
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_TIER_LABELS_TABLE_SIZE (2)
#define
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_BLOCK_PERIOD_TABLE_SIZE (2)
#define
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_CONSOLIDATED_BILL_TABLE_SIZE (5)
#define
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_CREDIT_PAYMENT_TABLE_SIZE (5)
#define
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_CALORIFIC_VALUE_TABLE_SIZE (2)
#define
SL_ZIGBEE_AF_PLUGIN_PRICE_SERVER_CO2_VALUE_TABLE_SIZE (2)
#define
SL_ZIGBEE_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#

sl_zigbee_af_price_server_send_get_scheduled_prices#

void sl_zigbee_af_price_server_send_get_scheduled_prices (uint8_t endpoint)

Send the next get scheduled prices command.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_server_seconds_until_get_scheduled_prices_event#

uint32_t sl_zigbee_af_price_server_seconds_until_get_scheduled_prices_event (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.


sl_zigbee_af_price_clear_price_table#

void sl_zigbee_af_price_clear_price_table (uint8_t endpoint)

Clear all prices in the price table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_clear_tariff_table#

void sl_zigbee_af_price_clear_tariff_table (uint8_t endpoint)

Clear all tariffs in the tariff table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_clear_price_matrix_table#

void sl_zigbee_af_price_clear_price_matrix_table (uint8_t endpoint)

Clear all price matrices in the price matrix table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_clear_block_thresholds_table#

void sl_zigbee_af_price_clear_block_thresholds_table (uint8_t endpoint)

Clear all block thresholds in the block thresholds table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_get_price_table_entry#

bool sl_zigbee_af_price_get_price_table_entry (uint8_t endpoint, uint8_t index, sl_zigbee_af_scheduled_price_t * 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.

sl_zigbee_af_scheduled_price_t *N/Aprice

The sl_zigbee_af_scheduled_price_t 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.


sl_zigbee_af_price_server_block_period_add#

void sl_zigbee_af_price_server_block_period_add (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

sl_zigbee_af_price_server_block_period_pub#

void sl_zigbee_af_price_server_block_period_pub (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.


sl_zigbee_af_price_server_block_period_print#

void sl_zigbee_af_price_server_block_period_print (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.


sl_zigbee_af_price_server_seconds_until_block_period_event#

uint32_t sl_zigbee_af_price_server_seconds_until_block_period_event (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.


sl_zigbee_af_price_server_refresh_block_period#

void sl_zigbee_af_price_server_refresh_block_period (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.


sl_zigbee_af_price_get_tariff_table_entry#

bool sl_zigbee_af_price_get_tariff_table_entry (uint8_t endpoint, uint8_t index, sl_zigbee_af_price_common_info_t * info, sl_zigbee_af_scheduled_tariff_t * 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.

sl_zigbee_af_price_common_info_t *N/Ainfo

The sl_zigbee_af_price_common_info_t structure describing the tariff.

sl_zigbee_af_scheduled_tariff_t *N/Atariff

The sl_zigbee_af_scheduled_tariff_t 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.


sl_zigbee_af_price_get_price_matrix#

bool sl_zigbee_af_price_get_price_matrix (uint8_t endpoint, uint8_t index, sl_zigbee_af_price_common_info_t * info, sl_zigbee_af_scheduled_price_matrix_t * 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.

sl_zigbee_af_price_common_info_t *N/Ainfo

The sl_zigbee_af_scheduled_price_matrix_t structure describing the price matrix.

sl_zigbee_af_scheduled_price_matrix_t *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.


sl_zigbee_af_price_get_block_thresholds_table_entry#

bool sl_zigbee_af_price_get_block_thresholds_table_entry (uint8_t endpoint, uint8_t index, sl_zigbee_af_scheduled_block_thresholds_t * 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.

sl_zigbee_af_scheduled_block_thresholds_t *N/Abt

The sl_zigbee_af_scheduled_block_thresholds_t 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.


sl_zigbee_af_price_get_tariff_by_issuer_tariff_id#

bool sl_zigbee_af_price_get_tariff_by_issuer_tariff_id (uint8_t endpoint, uint32_t issuerTariffId, sl_zigbee_af_price_common_info_t * info, sl_zigbee_af_scheduled_tariff_t * 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.

sl_zigbee_af_price_common_info_t *N/Ainfo

The sl_zigbee_af_price_common_info_t structure describing the tariff.

sl_zigbee_af_scheduled_tariff_t *N/Atariff

The sl_zigbee_af_scheduled_tariff_t structure describing the tariff.

Returns

  • True if the tariff was found.


sl_zigbee_af_price_get_price_matrix_by_issuer_tariff_id#

bool sl_zigbee_af_price_get_price_matrix_by_issuer_tariff_id (uint8_t endpoint, uint32_t issuerTariffId, sl_zigbee_af_price_common_info_t * info, sl_zigbee_af_scheduled_price_matrix_t * 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.

sl_zigbee_af_price_common_info_t *N/Ainfo

The sl_zigbee_af_scheduled_price_matrix_t structure describing the price matrix.

sl_zigbee_af_scheduled_price_matrix_t *N/Apm

Returns

  • True if the price matrix was found.


sl_zigbee_af_price_get_block_thresholds_by_issuer_tariff_id#

bool sl_zigbee_af_price_get_block_thresholds_by_issuer_tariff_id (uint8_t endpoint, uint32_t issuerTariffId, sl_zigbee_af_price_common_info_t * info, sl_zigbee_af_scheduled_block_thresholds_t * 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.

sl_zigbee_af_price_common_info_t *N/Ainfo

The sl_zigbee_af_scheduled_block_thresholds_t structure describing the block thresholds.

sl_zigbee_af_scheduled_block_thresholds_t *N/Abt

Returns

  • True if the block thresholds were found.


sl_zigbee_af_price_set_price_table_entry#

bool sl_zigbee_af_price_set_price_table_entry (uint8_t endpoint, uint8_t index, const sl_zigbee_af_scheduled_price_t * 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 sl_zigbee_af_scheduled_price_t *N/Aprice

The sl_zigbee_af_scheduled_price_t 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.


sl_zigbee_af_price_set_tariff_table_entry#

bool sl_zigbee_af_price_set_tariff_table_entry (uint8_t endpoint, uint8_t index, sl_zigbee_af_price_common_info_t * info, const sl_zigbee_af_scheduled_tariff_t * 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.

sl_zigbee_af_price_common_info_t *N/Ainfo

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

const sl_zigbee_af_scheduled_tariff_t *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.


sl_zigbee_af_price_set_price_matrix#

bool sl_zigbee_af_price_set_price_matrix (uint8_t endpoint, uint8_t index, sl_zigbee_af_price_common_info_t * info, const sl_zigbee_af_scheduled_price_matrix_t * 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.

sl_zigbee_af_price_common_info_t *N/Ainfo

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

const sl_zigbee_af_scheduled_price_matrix_t *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.


sl_zigbee_af_price_set_block_thresholds_table_entry#

bool sl_zigbee_af_price_set_block_thresholds_table_entry (uint8_t endpoint, uint8_t index, const sl_zigbee_af_price_common_info_t * info, const sl_zigbee_af_scheduled_block_thresholds_t * 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 sl_zigbee_af_price_common_info_t *N/Ainfo

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

const sl_zigbee_af_scheduled_block_thresholds_t *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.


sl_zigbee_af_get_current_price#

bool sl_zigbee_af_get_current_price (uint8_t endpoint, sl_zigbee_af_scheduled_price_t * price)

Get the current price used by the price server plugin.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

sl_zigbee_af_scheduled_price_t *N/Aprice

The sl_zigbee_af_scheduled_price_t 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.


sl_zigbee_af_price_find_free_price_index#

uint8_t sl_zigbee_af_price_find_free_price_index (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.


sl_zigbee_af_price_print#

void sl_zigbee_af_price_print (const sl_zigbee_af_scheduled_price_t * price)

function to print price

Parameters
TypeDirectionArgument NameDescription
const sl_zigbee_af_scheduled_price_t *N/Aprice

sl_zigbee_af_price_print_price_table#

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

relevant endpoint

Print the price table.


sl_zigbee_af_price_print_tariff#

void sl_zigbee_af_price_print_tariff (const sl_zigbee_af_price_common_info_t * info, const sl_zigbee_af_scheduled_tariff_t * tariff)
Parameters
TypeDirectionArgument NameDescription
const sl_zigbee_af_price_common_info_t *N/Ainfo

pointer to the common info struct

const sl_zigbee_af_scheduled_tariff_t *N/Atariff

pointer to the scheduled tariff struct

Print tariff.


sl_zigbee_af_price_print_tariff_table#

void sl_zigbee_af_price_print_tariff_table (uint8_t endpoint)

Print tariff table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


sl_zigbee_af_price_print_price_matrix#

void sl_zigbee_af_price_print_price_matrix (uint8_t endpoint, const sl_zigbee_af_price_common_info_t * info, const sl_zigbee_af_scheduled_price_matrix_t * pm)

Print price matrix.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

const sl_zigbee_af_price_common_info_t *N/Ainfo

pointer to common info struct

const sl_zigbee_af_scheduled_price_matrix_t *N/Apm

pointer to scheduled price matrix struct


sl_zigbee_af_price_print_price_matrix_table#

void sl_zigbee_af_price_print_price_matrix_table (uint8_t endpoint)

Print price matrix table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


sl_zigbee_af_price_print_block_thresholds#

void sl_zigbee_af_price_print_block_thresholds (uint8_t endpoint, const sl_zigbee_af_price_common_info_t * info, const sl_zigbee_af_scheduled_block_thresholds_t * bt)

Print block thresholds.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

const sl_zigbee_af_price_common_info_t *N/Ainfo

pointer to common info struct

const sl_zigbee_af_scheduled_block_thresholds_t *N/Abt

pointer to block threshold struct


sl_zigbee_af_price_print_block_thresholds_table#

void sl_zigbee_af_price_print_block_thresholds_table (uint8_t endpoint)

Print block threshold table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


sl_zigbee_af_price_server_publish_price_message#

void sl_zigbee_af_price_server_publish_price_message (sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t priceIndex)

Publish price message.

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

sl_zigbee_af_price_server_conversion_factor_add#

sl_zigbee_af_status_t sl_zigbee_af_price_server_conversion_factor_add (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.


sl_zigbee_af_price_server_conversion_factor_clear#

void sl_zigbee_af_price_server_conversion_factor_clear (uint8_t endpoint)

Clear the conversion factors table and invalidates all entries.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_server_conversion_factor_pub#

void sl_zigbee_af_price_server_conversion_factor_pub (uint8_t tableIndex, sl_802154_short_addr_t 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.

sl_802154_short_addr_tN/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.


sl_zigbee_af_price_server_seconds_until_conversion_factor_event#

uint32_t sl_zigbee_af_price_server_seconds_until_conversion_factor_event (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.


sl_zigbee_af_price_server_refresh_conversion_factor#

void sl_zigbee_af_price_server_refresh_conversion_factor (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.


sl_zigbee_af_price_server_calorific_value_add#

sl_zigbee_af_status_t sl_zigbee_af_price_server_calorific_value_add (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

sl_zigbee_af_price_server_seconds_until_calorific_value_event#

uint32_t sl_zigbee_af_price_server_seconds_until_calorific_value_event (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.


sl_zigbee_af_price_server_refresh_calorific_value#

void sl_zigbee_af_price_server_refresh_calorific_value (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.


sl_zigbee_af_price_server_calorific_value_clear#

void sl_zigbee_af_price_server_calorific_value_clear (uint8_t endpoint)

Clear the calorific value table and invalidates all entries.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_server_publish_tariff_message#

void sl_zigbee_af_price_server_publish_tariff_message (sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, uint8_t tariffIndex)

Send a publish tariff information command.

Parameters
TypeDirectionArgument NameDescription
sl_802154_short_addr_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/AtariffIndex

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


sl_zigbee_af_print_conversion_table#

void sl_zigbee_af_print_conversion_table (uint8_t endpoint)

Print data in the conversion factor table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_print_calorific_values_table#

void sl_zigbee_af_print_calorific_values_table (uint8_t endpoint)

Print data in the calorific values table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_server_seconds_until_co2_value_event#

uint32_t sl_zigbee_af_price_server_seconds_until_co2_value_event (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.


sl_zigbee_af_price_server_refresh_co2_value#

void sl_zigbee_af_price_server_refresh_co2_value (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.


sl_zigbee_af_price_server_co2_value_add#

void sl_zigbee_af_price_server_co2_value_add (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.


sl_zigbee_af_price_server_co2_value_clear#

void sl_zigbee_af_price_server_co2_value_clear (uint8_t endpoint)

Clear the CO2 value table and invalidates all entries.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_print_co2_values_table#

void sl_zigbee_af_print_co2_values_table (uint8_t endpoint)

Print data in the CO2 values table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_server_co2_label_pub#

void sl_zigbee_af_price_server_co2_label_pub (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.


sl_zigbee_af_price_server_tier_label_set#

void sl_zigbee_af_price_server_tier_label_set (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.


sl_zigbee_af_print_print_tier_labels_table#

void sl_zigbee_af_print_print_tier_labels_table (void )

Send the next get scheduled prices command.

Parameters
TypeDirectionArgument NameDescription
voidN/A

The endpoint in question.


sl_zigbee_af_price_server_tier_label_add_label#

void sl_zigbee_af_price_server_tier_label_add_label (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.


sl_zigbee_af_print_tier_labels_table#

void sl_zigbee_af_print_tier_labels_table (uint8_t endpoint)

Print the tier labels table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_server_tier_label_pub#

void sl_zigbee_af_price_server_tier_label_pub (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.


sl_zigbee_af_price_server_seconds_until_billing_period_event#

uint32_t sl_zigbee_af_price_server_seconds_until_billing_period_event (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.


sl_zigbee_af_price_server_refresh_billing_period#

void sl_zigbee_af_price_server_refresh_billing_period (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.


sl_zigbee_af_price_server_billing_period_add#

sl_status_t sl_zigbee_af_price_server_billing_period_add (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.


sl_zigbee_af_price_server_billing_period_pub#

void sl_zigbee_af_price_server_billing_period_pub (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.


sl_zigbee_af_print_billing_period_table#

void sl_zigbee_af_print_billing_period_table (uint8_t endpoint)

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

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_print_consolidated_bill_table_entry#

void sl_zigbee_af_print_consolidated_bill_table_entry (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.


sl_zigbee_af_price_server_consolidated_bill_add#

void sl_zigbee_af_price_server_consolidated_bill_add (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.


sl_zigbee_af_price_server_consolidated_bill_pub#

void sl_zigbee_af_price_server_consolidated_bill_pub (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.


sl_zigbee_af_price_server_cpp_event_set#

void sl_zigbee_af_price_server_cpp_event_set (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.


sl_zigbee_af_price_server_cpp_event_pub#

void sl_zigbee_af_price_server_cpp_event_pub (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.


sl_zigbee_af_price_server_cpp_event_print#

void sl_zigbee_af_price_server_cpp_event_print (uint8_t endpoint)

Print data in the CPP Event.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint in question.


sl_zigbee_af_price_server_credit_payment_pub#

void sl_zigbee_af_price_server_credit_payment_pub (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.


sl_zigbee_af_price_server_credit_payment_set#

void sl_zigbee_af_price_server_credit_payment_set (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.


sl_zigbee_af_price_server_currency_conversion_pub#

void sl_zigbee_af_price_server_currency_conversion_pub (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.


sl_zigbee_af_price_server_currency_conversion_set#

void sl_zigbee_af_price_server_currency_conversion_set (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.


sl_zigbee_af_price_server_tariff_cancellation_set#

void sl_zigbee_af_price_server_tariff_cancellation_set (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.


sl_zigbee_af_price_server_tariff_cancellation_pub#

void sl_zigbee_af_price_server_tariff_cancellation_pub (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.


sl_zigbee_af_price_server_seconds_until_tariff_info_event#

uint32_t sl_zigbee_af_price_server_seconds_until_tariff_info_event (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


sl_zigbee_af_price_server_refresh_tariff_information#

void sl_zigbee_af_price_server_refresh_tariff_information (uint8_t endpoint)

Refresh tariff information.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


sl_zigbee_af_price_add_tariff_table_entry#

bool sl_zigbee_af_price_add_tariff_table_entry (uint8_t endpoint, sl_zigbee_af_price_common_info_t * info, const sl_zigbee_af_scheduled_tariff_t * curTariff)

Add a tariff table entry.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

sl_zigbee_af_price_common_info_t *N/Ainfo

pointer to common info struct

const sl_zigbee_af_scheduled_tariff_t *N/AcurTariff

pointer to scheduled tariff struct

Returns

  • bool true is success


sl_zigbee_af_price_add_price_matrix_raw#

bool sl_zigbee_af_price_add_price_matrix_raw (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


sl_zigbee_af_price_add_price_matrix#

bool sl_zigbee_af_price_add_price_matrix (uint8_t endpoint, sl_zigbee_af_price_common_info_t * info, sl_zigbee_af_scheduled_price_matrix_t * pm)

Add price matrix.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint

sl_zigbee_af_price_common_info_t *N/Ainfo

pointer to the common info struct

sl_zigbee_af_scheduled_price_matrix_t *N/Apm

pointer to the scheduled price matrix struct

Returns

  • bool true is success


sl_zigbee_af_price_add_block_thresholds_table_entry#

bool sl_zigbee_af_price_add_block_thresholds_table_entry (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


sl_zigbee_af_price_clear_block_period_table#

void sl_zigbee_af_price_clear_block_period_table (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

sl_zigbee_af_price_server_price_update_bindings#

void sl_zigbee_af_price_server_price_update_bindings (void )

Update bindings.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_zigbee_af_price_server_seconds_until_active_price_matrix_event#

uint32_t sl_zigbee_af_price_server_seconds_until_active_price_matrix_event (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


sl_zigbee_af_price_server_refresh_price_matrix_information#

void sl_zigbee_af_price_server_refresh_price_matrix_information (uint8_t endpoint)

Refresh price matrix information.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

relevant endpoint


sl_zigbee_af_price_server_seconds_until_active_block_thresholds_event#

uint32_t sl_zigbee_af_price_server_seconds_until_active_block_thresholds_event (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


sl_zigbee_af_price_server_refresh_block_thresholds_information#

void sl_zigbee_af_price_server_refresh_block_thresholds_information (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#

sl_zigbee_af_price_server_info_t priceServerInfo