# RuView — Single-room overview Lovelace dashboard
#
# Drop into a Home Assistant Lovelace view (raw config editor). Replace
# the `binary_sensor.ruview_bedroom_*` entity IDs with the entity IDs
# auto-generated by your RuView node (HA picks them up from MQTT
# discovery automatically — see `mosquitto_sub -t 'homeassistant/#'`
# to enumerate them).
#
# This view shows the full 21-entity RuView surface for one room:
# raw signals on the left (presence, HR, BR, motion, RSSI, fall risk
# score) and semantic primitives on the right (sleeping, distress,
# room active, no movement). Pose visualisation is a placeholder for
# the v0.7.1 picture-elements integration.

title: RuView — Bedroom
path: ruview-bedroom
icon: mdi:home-thermometer
cards:
  - type: vertical-stack
    cards:
      - type: markdown
        content: >
          ## Bedroom — RuView sensing
          Status pulled live from MQTT auto-discovery. Tap any tile to
          see the raw history graph.

      - type: horizontal-stack
        cards:
          - type: tile
            entity: binary_sensor.ruview_bedroom_presence
            name: Presence
            icon: mdi:motion-sensor
            color: green
          - type: tile
            entity: binary_sensor.ruview_bedroom_someone_sleeping
            name: Sleeping
            icon: mdi:sleep
            color: blue
          - type: tile
            entity: binary_sensor.ruview_bedroom_room_active
            name: Room active
            icon: mdi:home-account
            color: amber

      - type: glance
        title: Raw vitals
        entities:
          - entity: sensor.ruview_bedroom_heart_rate
            name: HR
          - entity: sensor.ruview_bedroom_breathing_rate
            name: BR
          - entity: sensor.ruview_bedroom_motion_level
            name: Motion
          - entity: sensor.ruview_bedroom_person_count
            name: Persons
          - entity: sensor.ruview_bedroom_rssi
            name: RSSI

      - type: gauge
        entity: sensor.ruview_bedroom_fall_risk_elevated
        name: Fall risk score
        min: 0
        max: 100
        severity:
          green: 0
          yellow: 40
          red: 70

      - type: entities
        title: Safety
        entities:
          - entity: binary_sensor.ruview_bedroom_possible_distress
            name: Possible distress
          - entity: binary_sensor.ruview_bedroom_no_movement
            name: No movement (safety)
          - entity: binary_sensor.ruview_bedroom_elderly_inactivity_anomaly
            name: Inactivity anomaly

      - type: history-graph
        title: Last 6h — Heart rate & breathing
        hours_to_show: 6
        refresh_interval: 60
        entities:
          - entity: sensor.ruview_bedroom_heart_rate
          - entity: sensor.ruview_bedroom_breathing_rate

      - type: logbook
        title: Recent events
        hours_to_show: 24
        entities:
          - event.ruview_bedroom_fall
          - event.ruview_bedroom_bed_exit
          - event.ruview_bedroom_multi_room_transition
