House Tidiness Score - With AI Task

I have seen several topics asking/showing examples about how to use “AI Task”, here is one of mine, I’m sharing as I think I haven’t seen this yet from anybody.

The idea is simple I am asking AI Task to score from 1 to 100 the tidiness of every room I have a camera in (providing camera feed), that’s populating an input number helper for every room and finally I have an House Tidiness sensor that makes the average of all rooms tidiness.
image

Configuration steps:

  • Create an input number for every room you have a camera like “Living room tidiness”
  • Create a sensor that average every room’s input number, call it something like “House tidiness”
  • Setup the automation to populate the score in the input numbers (Below mine)

This is my automation, replace cameras with yours and input numbers with yours:

alias: AI - Tidiness Score
description: ""
triggers:
  - trigger: time_pattern
    hours: "8"
conditions: []
actions:
  - data:
      task_name: Order Index
      instructions: >-
        Reply only with a number from 1 to 100 to rate the level of tidiness of
        the environment in the image.
      attachments:
        media_content_id: media-source://camera/camera.webcam_sala_2
        media_content_type: application/vnd.apple.mpegurl
        metadata:
          title: Living Room Webcam 2
          thumbnail: /api/camera_proxy/camera.webcam_sala_2
          media_class: video
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://camera
    response_variable: Response
    action: ai_task.generate_data
  - target:
      entity_id:
        - input_number.order_index_livingroom2
    data:
      value: "{{ Response.data | float }}"
    action: input_number.set_value
  - data:
      task_name: Order Index
      instructions: >-
        Reply only with a number from 1 to 100 to rate the level of tidiness of
        the environment in the image.
      attachments:
        media_content_id: media-source://camera/camera.webcam_cucina
        media_content_type: application/vnd.apple.mpegurl
        metadata:
          title: Kitchen Webcam
          thumbnail: /api/camera_proxy/camera.webcam_cucina
          media_class: video
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://camera
    response_variable: Response
    action: ai_task.generate_data
  - data:
      value: "{{ Response.data | float }}"
    action: input_number.set_value
    target:
      entity_id: input_number.order_index_kitchen
  - data:
      task_name: Order Index
      instructions: >-
        Reply only with a number from 1 to 100 to rate the level of tidiness of
        the environment in the image.
      attachments:
        media_content_id: media-source://camera/camera.webcam_sala_2
        media_content_type: application/vnd.apple.mpegurl
        metadata:
          title: Living Room Webcam 1
          thumbnail: /api/camera_proxy/camera.webcam_sala_2
          media_class: video
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://camera
    response_variable: Response
    action: ai_task.generate_data
  - data:
      value: "{{ Response.data | float }}"
    action: input_number.set_value
    target:
      entity_id: input_number.order_index_livingroom1
  - data:
      task_name: Order Index
      instructions: >-
        Reply only with a number from 1 to 100 to rate the level of tidiness of
        the environment in the image.
      attachments:
        media_content_id: media-source://camera/camera.webcam_cameretta
        media_content_type: application/vnd.apple.mpegurl
        metadata:
          title: Bedroom Webcam
          thumbnail: /api/camera_proxy/camera.webcam_cameretta
          media_class: video
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://camera
    response_variable: Response
    action: ai_task.generate_data
  - data:
      value: "{{ Response.data | float }}"
    action: input_number.set_value
    target:
      entity_id: input_number.order_index_bedroom
  - data:
      task_name: Order Index
      instructions: >-
        Reply only with a number from 1 to 100 to rate the level of tidiness of
        the environment in the image.
      attachments:
        media_content_id: media-source://camera/camera.reolink_camera_sub
        media_content_type: application/vnd.apple.mpegurl
        metadata:
          title: Reolink Sliding Camera
          thumbnail: /api/camera_proxy/camera.reolink_camera_sub
          media_class: video
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://camera
    response_variable: Response
    action: ai_task.generate_data
  - data:
      value: "{{ Response.data | float }}"
    action: input_number.set_value
    target:
      entity_id: input_number.order_index_camera
mode: single

You can be specific per room about what to check, for example “nothing on the floor” or “made bed”, etc…
Automation run twice a day.
The tidiness score can be helpful to stimulate kids to help improve the score (well, I have to stimulate myself first).

Hope this will be inspiring for someone. :slight_smile:

1 Like

A future addition I will do is to have AI Task to also populate a check list with all things that needs to be sorted in order to improve house tidiness. I think it will be pretty simple to do.
Like:

  • Make bed in bedroom
  • Clean the floor in dinining room
    etc…