Configuration Service [beta]

Each new theme portal is customized by the variables contained in the configuration service. Here is a description of each parameter:

 

  • tags - list of relevant tags, see schema for tag obj below *NOTE: this list of tags must be copied over to the data_service workflow library*
    • tag - (required) <stream.tag>
    • stag - (required) shortened tag
    • label - (required) default label for tag
    • dynamic_label - stag that contains tag's label
      • ** Make sure label tag is listed first so its value is queried first & is available for use **
    • unit - (required) unit at end of value (ie %)
      • ** for special symbols like the degree symbol, make sure to use unicode rather than the symbol itself (ie "\xb0" instead of "°") **
    • dynamic_unit - stag that contains tag's unit
      • ** Make sure unit tag is listed first so its value is queried first & is available for use **
    • data_type - (required) string, boolean, geopoint, number, array
    • overview_tag - load for view devices page
    • filter_tag - use to filter view devices page
    • lv_tag - load for LV section of summary page
    • chart_tag - use for chart
    • table_tag - use for history table
    • alert_tag - use for alerts
    • config_tag - load for config page
    • control_tag - load for control page
    • process_fn - function to process value, such as converting to date string
      • **This should be a string that matches the name of a function in the data_service dashboard page. Any functions that you add to the data_service dashboard page should also be added to the data_service workflow library on the platform. These functions should accept one argument: the value to be processed **
    • true_label - label for true value if boolean tag
    • false_label - label for false value if boolean tag
    • value_options - (required when using dynamic_value_options) array of values to select from when setting up an alert for this tag
    • dynamic_value_options - stag that contains array of values to select from when setting up alert for this tag
    • from_device_type - true if value is taken from device type instead of device. currently only used on manage alerts page.
  • map_marker - img to use as marker on all maps
  • subpage_nav - list of objs representing each device info subpage to show in navigation
  • overview_tile_view - stags to show in tile view of view devices
  • overview_map_view - stags to show in map view of view devices
  • overview_list_view - stags to show in list view of view devices
  • summary_overview - stags to show overview section of summary
  • summary_location - stags to show in location section of summary
  • summary_lv_sections - list of dicts {<section name>: stags to show in section} for additional summary sections
  • config_sections - list of dicts {<section name>: list of stag objects to edit and save in section} for configuration page. it is crucial that the stag in the tag object for each tag is just the tag without the stream (ie stag is "test" if tag is "raw.test")
    each stag object in the list can contain the following properties:
    • stag (required)
    • input_type (required) - text, number, switch, select
    • device_config - if true, value should be read from device_config stream + written to device_config_shadow stream (if this stag is "test_config", the device_config_shadow tag should have stag "test_config_shadow"). this is a value we will send to the device.
    • min - min value for number input
    • max - max value for number input
    • true_value - value to send to device if switch is set to true
    • false_value - value to send to device if switch is set to false
    • select_options - (required for input_type = select) dict of {<label>: <value to send to device>} for select input
  • controls_sections - list of dicts {<section name>: list of stag objects to control in section}. it is crucial that the stag is the same as the command that will be sent to the device.
    each stag object in the list can contain the following properties:
    • stag (required)
    • input_type (required) - switch, button, number, string
    • true_value - value to send to device if switch is set to true
    • false_value - value to send to device if switch is set to false
    • press_value - value to send to device is button is pressed
  • mcu_connected - true if MCU controls should be shown on controls page
  • config_fw - true if user should be able to update firmware (on configuration page)
  • fw_list - URL to get list of firmware
  • fw_upload - URL to upload firmware file to device
  • push_enabled - boolean to determine if push notifications enabled
  • alert_conditions - list of all conditions that are able to be selected on the Manage Alerts page. Each condition is an object with the following keys
    • label - human readable label for Manage Alerts page, ie "equal to"
    • allowed_types - list of which data types this condition is used for, ie ["number", "string", "boolean"]
    • val - value for condition that matches the value used in the workflow libraries, ie "eq"
  • table_defaults - default stags to load in table, max of 5
  • chart_defaults - default stags to load in chart, max of 3 for each axis
  • device_type_extra_fields - list of objs representing extra fields to save with the device type object in following format
    • name - label shown on page
    • editable - whether or not field can be edited
    • required - whether or not field must have a value before saving
    • source_property - name of property, either in device type object when queried on portal (if save_portal = true) or in device_type_data stream (if save_stream = true)
    • save_portal - if true, saved in portal database and param is queried using device type endpoints.
    • save_stream - if true, saved in device_type_data stream and used in wfs
    • custom_param - used with save_portal = true. custom_param must be true for any extra parameters so that it is saved in custom_param field of device type object, otherwise device type update endpoint will fail.
    • input_type - type of input to show on page, the options are:
      • text - normal text field
      • textarea - large text field
      • number - number text field
      • boolean - checkbox evaluating to true/false
      • select - dropdown of options. select_options MUST be provided for this option.
      • multi - checkboxes evaluating to array of true/false. value MUST be provided for this option.
    • value - default value
    • save_multi_idx - instead of multi input_type being saved as list of booleans, saved as a list of the indexes where the boolean = true. the default value should still be a list of booleans rather than indexes.
    • select_options - options for a select input_type
    • labels - optional labels for multi input_type checkboxes
    • trigger_enabled - list of tags to enable if value evaluates to true. there are 2 behaviors:
      • input_type isn't "multi" -> if value evaluates to true, all listed tags are enabled.
      • input_type is "multi" -> for each checkbox, if checked, then the tag at that index is enabled.
    • trigger_template_enabled - can only be used with select option where the options are numbers. list of "template" tags where each select option value converts to a tag in which the * in the template tag value is converted to (select option value + an initial value). all tags with select option value < selected value are enabled. template_init_val MUST be provided as well.
    • template_init_val - the initial value used in trigger_template_enabled 's tag creation. usually 0 or 1.
  • google_key - API key for google maps
  • promo_enabled - true if your customers can enter stripe coupon codes upon subscription