Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

TODO - Info updated 4/13/2022

For the form settings you can save units to new keys.

This how it was before (and can still be used):

[
  {
    "order": 0,
    "label": null,
    "variables": [
      {
        "order": 0,
        "label": "Unit",
        "type": "string",
        "min": null,
        "max": null,
        "form": "select",
        "key": "unit",
        "default_value": "f",
        "required": true,
        "values": [
          { "value": "f", "label": "°F", "short": "°F" },
          { "value": "c", "label": "°C", "short": "°C" }
        ]
      }
    ]
  }
]

Individual channels:

[
  {
    "order": 0,
    "label": null,
    "variables": [
      {
        "order": 0,
        "label": "Temperature Unit",
        "type": "string",
        "min": null,
        "max": null,
        "form": "select",
        "key": "child.3.unit",
        "default_value": "f",
        "required": true,
        "values": [
          { "value": "f", "label": "°F", "short": "°F" },
          { "value": "c", "label": "°C", "short": "°C" }
        ]
      },
      {
        "order": 1,
        "label": "Probe Unit",
        "type": "string",
        "min": null,
        "max": null,
        "form": "select",
        "key": "child.7.unit",
        "default_value": "f",
        "required": true,
        "values": [
          { "value": "f", "label": "°F", "short": "°F" },
          { "value": "c", "label": "°C", "short": "°C" }
        ]
      }
    ]
  }
]

"key": "child.3.unit"

where 3 is the channel

the priority is:

1. properties.child.X.unit
2. properties.unit (if it is a valid unit for the sensor)
3. the unit marked as "default" for the capability if the sensor has console capability
4. sensor.unit, not sure where it is defined, but might be the standard unit API returns
5. no unit ("null" unit is also not shown)

  • No labels