Temperature and Humidity Display Widget

Widget - Long and Short

This widget is derived from the Temperature and humidity widget created by @debacher and adds additional configuration options. You can choose two separate items for temperature and humidity and optionally a third item for the last update timestamp. Labels and suffixes can be configured to adapt the widget to different languages or use none or shorter descriptions for better display on small mobile screens.

The full list of customization options is:

  • Title: title of the cell.
  • Temperature item: the state of this item will be displayed as temperature.
  • Humidity item: the state of this item will be displayed as humidity.
  • Last update item: the display state of this item will be displayed as last update timestamp. Use an item with the timestamp as state and set the pattern of the “State Description” metadata to format the timestamp.
  • Temperature Label: label to be displayed in front of the temperature.
  • Temperature Suffix: suffix to be displayed after the temperature.
  • Humidity Label: label to be displayed in front of the humidity.
  • Humidity Suffix: suffix to be displayed after the humidity.
  • Last Update Label: label to be displayed in front of the last update timestamp.

Screenshots

Example configuration with long labels:

Widget - Long

Example configuration with short labels:

Widget - Short

Configuration:

Clicking on the widget opens the analyzer displaying both the temperature and the humidity:

Changelog

Version 0.1

  • initial release

Resources

The YAML code for the widget:

uid: TemperatureHumidity
tags:
  - temperature
  - humidity
  - standalone
props:
  parameters:
    - description: Title of the cell.
      label: Title
      name: title
      required: true
      type: TEXT
      groupName: title
    - context: item
      description: The state of this item will be displayed as temperature.
      label: Temperature item
      name: tmp_item
      required: true
      type: TEXT
      groupName: items
    - context: item
      description: The state of this item will be displayed as humidity.
      label: Humidity item
      name: hum_item
      required: true
      type: TEXT
      groupName: items
    - context: item
      description: The display state of this item will be displayed as last update timestamp. Use an item with the timestamp as state and set the pattern of the "State Description" metadata to format the timestamp.
      label: Last update item
      name: update_item
      required: false
      type: TEXT
      groupName: items
    - description: Label to be displayed in front of the temperature.
      label: Temperature Label
      name: tmp_label
      required: false
      type: TEXT
      groupName: labels
    - description: Suffix to be displayed after the temperature.
      label: Temperature Suffix
      name: tmp_suffix
      required: false
      type: TEXT
      groupName: labels
    - description: Label to be displayed in front of the humidity.
      label: Humidity Label
      name: hum_label
      required: false
      type: TEXT
      groupName: labels
    - description: Suffix to be displayed after the humidity.
      label: Humidity Suffix
      name: hum_suffix
      required: false
      type: TEXT
      groupName: labels
    - description: Label to be displayed in front of the last update timestamp.
      label: Last Update Label
      name: update_label
      required: false
      type: TEXT
      groupName: labels
  parameterGroups:
    - name: title
      label: Title
    - name: items
      label: Items
    - name: labels
      label: Labels
timestamp: Jan 21, 2023, 5:07:58 AM
component: oh-label-cell
config:
  header: '= props.title'
  label: '= (props.tmp_label ? props.tmp_label + " " : "") + items[props.tmp_item].state + (props.tmp_suffix ? " " + props.tmp_suffix : "")'
  trendItem: '= props.tmp_item'
  action: analyzer
  actionAnalyzerItems: =[props.hum_item, props.tmp_item]
  icon: oh:temperature
  subtitle: '= (props.hum_label ? props.hum_label + " " : "") + items[props.hum_item].state + (props.hum_suffix ? " " + props.hum_suffix : "")'
  footer: '= (props.update_item ? (props.update_label ? props.update_label : "")  + " " + items[props.update_item].displayState : "")'
  expandable: false

If you want it to be installable from the marketplace, you should add the pulished tag.

Oh, thanks, did that now. I thought from the description in the template that first the post will be reviewed and then the published tag will be added by admins/moderators.

Indeed, that‘s what the template says.
We need to clarify that, but for now leave it as published.