Smart Home: A fleet of Temperature and Humidity Sensors

February 11, 2024 0 By addshore

One of the easiest ways to get myself into the Zigbee life without needing to worry too much about exactly what I was doing, buying or what my goals were was to buy a set of Temperature and Humidity Sensors for every room of the house.

After a tiny amount of research and some discussion among friends, I settled on a fleet of Aquara sensors. These work well with home assistant, use batteries that I have many of already and want to use up, are visually appealing and can be bought in bulk on AliExpress.

For a hub, I went for the SMLIGHT SLZB-06 that has some good reviews in terms of flexibility and openness, as well as allowing use via wired network, Wi-Fi or even USB.

Everything was extremely easy to set up, wiring the hub into the network and having it appear in Home Assistant running on my Raspberry Pi 4, and then pairing each of the sensors with the Hub and having them appear within Home assistant.

One per room and one outside (in a bike shed) seemed to work quite well, with only a few connectivity issues with the sensor that was outdoors, either due to connection distance, or perhaps the cold temperatures that it is currently operating in.

It took me a while to get the dashboards in Home Assistant looking just right alongside my electric radiator controls, but with some more suggestions from friends around custom UI plugins for Home Assistant, I’m rather happy with the result.

I’ll include the entire dashboard YAML at the bottom of this post, but in summary I use a main tabbed dashboard, where each tab uses a “Panel (1 card)” view type. This tab then uses a main custom:bootstrap-grid-card that allows for responsive layouts to be created with further internal cards.

This primary card then contains a series of custom:auto-entities cards and custom:battery-state-card cards to dynamically populate custom lists and graphs for my radiators, and temperature sensors. This means I don’t have to write out each entity ID, and also can add more sensors easily.

These cards have lots of easy custom visualizations, so even thought “battery” is in the name, it can easily be used for any devices or entities.

The built-in statistics-graph cards seem to be one of the easiest out-of-the-box ways to see metrics over time

I was disappointed to see that after the default o ~30 days, my historical data was starting to disappear, so for now have tweaked the retention settings for the default storage up a little. Posts seem to say this might be a bad idea, and for historical data I might want a different storage engine such as InfluxDB, but I’ll leave that until I actually need it..

I’m yet to play with much automation from these readings to date, but have just ordered some switch controllers for my various bathroom extractor fans to have more fine-grained control over the humidity of various bathrooms after showers etc have been in use. You can clearly see times that showers are used in the humidity and temp data above.

type: custom:bootstrap-grid-card
cards:
  - type: row
    cards:
      - type: custom:auto-entities
        card:
          type: entities
          title: Radiators
          state_color: true
        filter:
          include:
            - domain: climate
          exclude:
            - state: unavailable
      - type: custom:battery-state-card
        title: Temperature
        secondary_info: '{last_changed}'
        filter:
          include:
            - name: attributes.device_class
              value: temperature
          exclude:
            - name: attributes.friendly_name
              operator: contains
              value: Water
            - name: attributes.friendly_name
              operator: contains
              value: Target
        sort:
          by: state
          desc: true
        collapse: 20
        bulk_rename:
          - from: Climate Temperature
        icon: >-
          mdi:thermometer{state|abs()|greaterthan(20,-high)|greaterthan(18,)|greaterthan(10,-low)}
        colors:
          steps:
            - color: '#add8e6'
              value: 16
            - color: '#fff600'
              value: 18
            - color: '#ff8000'
              value: 21
            - color: '#ff0000'
              value: 25
      - type: custom:battery-state-card
        title: Humidity
        secondary_info: '{last_changed}'
        filter:
          include:
            - name: attributes.device_class
              value: humidity
        sort:
          by: state
          desc: true
        collapse: 20
        bulk_rename:
          - from: Climate Humidity
        icon: >-
          mdi:water{state|abs()|greaterthan(75,-alert)|greaterthan(65,)|greaterthan(0,-check)}
        colors:
          steps:
            - color: '#D9D9D6'
              value: 0
            - color: '#A4DBE8'
              value: 70
            - color: '#00008b'
              value: 80
            - color: '#000000'
              value: 90
  - type: row
    cards:
      - type: custom:auto-entities
        card:
          type: statistics-graph
          state_color: true
          title: Temperature
          stat_types:
            - mean
          hide_legend: false
          days_to_show: 7
        filter:
          include:
            - attributes:
                device_class: temperature
          exclude:
            - device_manufacturer: Mixergy Ltd
      - type: custom:auto-entities
        card:
          type: statistics-graph
          chart_type: line
          period: 5minute
          state_color: true
          title: Humidity
          stat_types:
            - mean
          hide_legend: false
          days_to_show: 7
        filter:
          include:
            - attributes:
                device_class: humidity
          exclude: []
Code language: PHP (php)