sensor:
  - platform: min_max
    type: mean
    name: Average temperature
    entity_ids:
      - sensor.trisensor_temperature
      - sensor.bedroom_weather_temperature
      - sensor.kitchen_weather_temperature
      - sensor.hallway_weather_temperature
      - sensor.guest_bedroom_weather_temperature

  - platform: min_max
    type: mean
    name: Average humidity
    entity_ids:
      - sensor.multisensor_6_relative_humidity
      - sensor.bedroom_weather_humidity
      - sensor.kitchen_weather_humidity
      - sensor.hallway_weather_humidity
      - sensor.guest_bedroom_weather_humidity

  # MQTT
  # Bedroom weather sensor
  - platform: mqtt
    name: "Bedroom weather temperature"
    state_topic: "z2m_deconz/bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "°C"
    device_class: "temperature"
    value_template: "{{ value_json.temperature }}"
  - platform: mqtt
    name: "Bedroom weather humidity"
    state_topic: "z2m_deconz/bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "humidity"
    value_template: "{{ value_json.humidity }}"
  - platform: mqtt
    name: "Bedroom weather pressure"
    state_topic: "z2m_deconz/bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "hPa"
    device_class: "pressure"
    value_template: "{{ value_json.pressure }}"
  - platform: mqtt
    name: "Bedroom weather battery"
    state_topic: "z2m_deconz/bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "battery"
    value_template: "{{ value_json.battery }}"
  - platform: mqtt
    name: "Bedroom weather LQI"
    state_topic: "z2m_deconz/bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    icon: "mdi:signal"
    unit_of_measurement: "lqi"
    value_template: "{{ value_json.linkquality }}"

  # Kitchen weather sensor
  - platform: mqtt
    name: "Kitchen weather temperature"
    state_topic: "z2m_deconz/kitchen_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "°C"
    device_class: "temperature"
    value_template: "{{ value_json.temperature }}"
  - platform: mqtt
    name: "Kitchen weather humidity"
    state_topic: "z2m_deconz/kitchen_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "humidity"
    value_template: "{{ value_json.humidity }}"
  - platform: mqtt
    name: "Kitchen weather pressure"
    state_topic: "z2m_deconz/kitchen_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "hPa"
    device_class: "pressure"
    value_template: "{{ value_json.pressure }}"
  - platform: mqtt
    name: "Kitchen weather battery"
    state_topic: "z2m_deconz/kitchen_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "battery"
    value_template: "{{ value_json.battery }}"
  - platform: mqtt
    name: "Kitchen weather LQI"
    state_topic: "z2m_deconz/kitchen_weather"
    availability_topic: "z2m_deconz/bridge/state"
    icon: "mdi:signal"
    unit_of_measurement: "lqi"
    value_template: "{{ value_json.linkquality }}"

  # Bathroom weather sensor
  - platform: mqtt
    name: "Bathroom weather temperature"
    state_topic: "z2m_deconz/bathroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "°C"
    device_class: "temperature"
    value_template: "{{ value_json.temperature }}"
  - platform: mqtt
    name: "Bathroom weather humidity"
    state_topic: "z2m_deconz/bathroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "humidity"
    value_template: "{{ value_json.humidity }}"
  - platform: mqtt
    name: "Bathroom weather pressure"
    state_topic: "z2m_deconz/bathroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "hPa"
    device_class: "pressure"
    value_template: "{{ value_json.pressure }}"
  - platform: mqtt
    name: "Bathroom weather battery"
    state_topic: "z2m_deconz/bathroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "battery"
    value_template: "{{ value_json.battery }}"
  - platform: mqtt
    name: "Bathroom weather LQI"
    state_topic: "z2m_deconz/bathroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    icon: "mdi:signal"
    unit_of_measurement: "lqi"
    value_template: "{{ value_json.linkquality }}"

  # Hallway weather sensor
  - platform: mqtt
    name: "Hallway weather temperature"
    state_topic: "z2m_deconz/hallway_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "°C"
    device_class: "temperature"
    value_template: "{{ value_json.temperature }}"
  - platform: mqtt
    name: "Hallway weather humidity"
    state_topic: "z2m_deconz/hallway_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "humidity"
    value_template: "{{ value_json.humidity }}"
  - platform: mqtt
    name: "Hallway weather pressure"
    state_topic: "z2m_deconz/hallway_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "hPa"
    device_class: "pressure"
    value_template: "{{ value_json.pressure }}"
  - platform: mqtt
    name: "Hallway weather battery"
    state_topic: "z2m_deconz/hallway_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "battery"
    value_template: "{{ value_json.battery }}"
  - platform: mqtt
    name: "Hallway weather LQI"
    state_topic: "z2m_deconz/hallway_weather"
    availability_topic: "z2m_deconz/bridge/state"
    icon: "mdi:signal"
    unit_of_measurement: "lqi"
    value_template: "{{ value_json.linkquality }}"

  # Guest bedroom weather sensor
  - platform: mqtt
    name: "Guest bedroom weather temperature"
    state_topic: "z2m_deconz/guest_bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "°C"
    device_class: "temperature"
    value_template: "{{ value_json.temperature }}"
  - platform: mqtt
    name: "Guest bedroom weather humidity"
    state_topic: "z2m_deconz/guest_bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "humidity"
    value_template: "{{ value_json.humidity }}"
  - platform: mqtt
    name: "Guest bedroom weather pressure"
    state_topic: "z2m_deconz/guest_bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "hPa"
    device_class: "pressure"
    value_template: "{{ value_json.pressure }}"
  - platform: mqtt
    name: "Guest bedroom weather battery"
    state_topic: "z2m_deconz/guest_bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "battery"
    value_template: "{{ value_json.battery }}"
  - platform: mqtt
    name: "Guest bedroom weather LQI"
    state_topic: "z2m_deconz/guest_bedroom_weather"
    availability_topic: "z2m_deconz/bridge/state"
    icon: "mdi:signal"
    unit_of_measurement: "lqi"
    value_template: "{{ value_json.linkquality }}"
