Elderly TV Watching & Sedentary Reminder | 老年人电视观看时长与久坐关联

Prompts

Using a fixed camera in the living room (aimed at the sofa and TV area), the system analyzes the elderly person's continuous sitting time while watching TV, detecting whether the body remains in a seated posture and the face is oriented toward the TV area (watching). When continuous TV-watching exceeds a preset threshold (default 2 hours) without standing up, the system outputs a 'time-to-move reminder', suggesting the elderly stand up, walk, and do stretching exercises. The skill helps prevent health issues caused by prolonged sitting, such as muscle atrophy, lower-limb thrombosis, and metabolic disorders. Application scenarios: home-based elderly care, nursing-home activity rooms, community daycare centers. Real-time monitoring; when prolonged sitting is detected, the system pushes via smart speaker or mobile app (e.g., 'Grandpa Zhang, you've been watching TV for 2 hours, please get up and move around'). Skill features: long sedentary TV-watching is a common lifestyle pattern among the elderly and can induce deep-vein thrombosis, lumbar/back pain, etc. AI automatic monitoring and gentle reminders help the elderly form a habit of regular activity and improve their health. Can be integrated into home security cameras or elderly-care service platforms as a practical proactive health-management feature. | 通过客厅固定摄像头(对准沙发和电视区域),分析老年人连续观看电视的坐姿时长,检测人体是否持续处于坐姿且面部朝向电视区域(注视电视)。当连续坐姿观看电视超过预设阈值(默认2小时)且期间未起身活动时,输出'久坐活动提醒',建议老年人起身走动、做伸展运动。该技能有助于预防因长时间静坐导致的肌肉萎缩、下肢血栓、代谢紊乱等健康问题。应用场景:居家养老、养老院活动室、社区日间照料中心。系统实时监测,当久坐超时时通过智能音箱语音提醒或手机APP推送'张爷爷,您已经看了2小时电视,起来活动一下吧'。技能特点:老年人长时间久坐看电视是常见生活方式,易诱发深静脉血栓、腰背疼痛等问题。通过AI自动监测并温馨提醒,可帮助老人养成定时活动习惯,改善健康。该技能可集成到居家安防摄像头或养老服务平台中,成为主动健康管理的实用功能。

Install

openclaw skills install smyx-elderly-tv-sedentary-reminder-analysis

Elderly TV Watching & Sedentary Reminder | 老年人电视观看时长与久坐关联

Using a fixed camera in the living room (aimed at the sofa and TV area), the system analyzes the elderly person's continuous sitting time while watching TV, detecting whether the body remains in a seated posture and the face is oriented toward the TV area (watching). When continuous TV-watching exceeds a preset threshold (default 2 hours) without standing up, the system outputs a 'time-to-move reminder', suggesting the elderly stand up, walk, and do stretching exercises. The skill helps prevent health issues caused by prolonged sitting, such as muscle atrophy, lower-limb thrombosis, and metabolic disorders. Application scenarios: home-based elderly care, nursing-home activity rooms, community daycare centers. Real-time monitoring; when prolonged sitting is detected, the system pushes via smart speaker or mobile app (e.g., 'Grandpa Zhang, you've been watching TV for 2 hours, please get up and move around'). Skill features: long sedentary TV-watching is a common lifestyle pattern among the elderly and can induce deep-vein thrombosis, lumbar/back pain, etc. AI automatic monitoring and gentle reminders help the elderly form a habit of regular activity and improve their health. Can be integrated into home security cameras or elderly-care service platforms as a practical proactive health-management feature.

通过客厅固定摄像头(对准沙发和电视区域),分析老年人连续观看电视的坐姿时长,检测人体是否持续处于坐姿且面部朝向电视区域(注视电视)。当连续坐姿观看电视超过预设阈值(默认2小时)且期间未起身活动时,输出'久坐活动提醒',建议老年人起身走动、做伸展运动。该技能有助于预防因长时间静坐导致的肌肉萎缩、下肢血栓、代谢紊乱等健康问题。应用场景:居家养老、养老院活动室、社区日间照料中心。系统实时监测,当久坐超时时通过智能音箱语音提醒或手机APP推送'张爷爷,您已经看了2小时电视,起来活动一下吧'。技能特点:老年人长时间久坐看电视是常见生活方式,易诱发深静脉血栓、腰背疼痛等问题。通过AI自动监测并温馨提醒,可帮助老人养成定时活动习惯,改善健康。该技能可集成到居家安防摄像头或养老服务平台中,成为主动健康管理的实用功能。

🎯 AI 角色

假设你是一个专业的老年人健康生活方式 AI。你的任务是分析客厅固定摄像头的实时视频,检测老年人是否坐姿在沙发区域,并判断其是否在观看电视(头部朝向电视屏幕)。记录连续坐姿观看的时长,当超过预设阈值(默认 120 分钟)且期间无站立活动时,输出活动提醒。不要提供医疗建议或医学诊断,仅输出基于视觉的行为统计与友好提醒。

任务目标

  • 本 Skill 用于:基于客厅固定摄像头视频,识别"在沙发坐姿 + 面部朝向电视"的观看状态 → 统计连续/当日累计观看时长 → 超阈值时输出久坐活动提醒
  • 能力包含:人体检测、姿态分类(sitting / standing / lying / leaving)、沙发与电视 ROI 定义(sofa_region / tv_region)、面部朝向电视判定、电视画面亮起估计(可选)、连续坐姿观看计时与重置规则(短暂取物不算离开沙发)、当日累计观看时长 + 起身次数 + 最长连续观看时长统计、提醒类型分类(continuous_watch_too_long / daily_total_watch_too_long / normal)、语音/APP 提醒文本生成
  • 触发条件:
    1. 默认触发:当用户提供客厅沙发+电视区域视频 URL 或文件需要分析时,默认触发本技能进行电视观看时长与久坐关联分析
    2. 当用户明确提及老人久坐、看电视太久、深静脉血栓预防、起身活动提醒、伸展运动提醒、客厅久坐、智能音箱提醒、居家养老健康等关键词,并且上传了视频文件
    3. 当用户提及以下关键词时,自动触发历史报告查询功能 :查看老人电视观看历史报告、久坐提醒报告清单、电视观看时长报告清单、查询历史久坐记录、显示所有老人观看电视报告、显示养老健康诊断报告,查询久坐提醒清单
  • 自动行为:
    1. 如果用户上传了附件或者视频文件,则自动保存为本地文件
    2. ⚠️ 强制数据获取规则(次高优先级):如果用户触发任何历史报告查询关键词(如"查看所有老人电视观看报告"、" 显示所有久坐提醒报告"、" 查看历史报告"等),必须
      • 直接使用 python -m scripts.smyx_elderly_tv_sedentary_reminder_analysis --list --open-id 参数调用 API 查询云端的历史报告数据
      • 严格禁止:从本地 memory 目录读取历史会话信息、严格禁止手动汇总本地记录中的报告、严格禁止从长期记忆中提取报告
      • 必须统一从云端接口获取最新完整数据,然后以 Markdown 表格格式输出结果

前置准备

  • 依赖说明:scripts 脚本所需的依赖包及版本
    requests>=2.28.0
    

操作步骤

🔒 open-id 获取流程控制(强制执行,防止遗漏)

在执行老年人电视观看时长与久坐关联分析前,必须按以下优先级顺序获取 open-id:

第 1 步:【最高优先级】检查技能所在目录的配置文件(优先)
        路径:skills/smyx_common/scripts/config.yaml(相对于技能根目录)
        完整路径示例:${OPENCLAW_WORKSPACE}/skills/{当前技能目录}/skills/smyx_common/scripts/config.yaml
        → 如果文件存在且配置了 api-key 字段,则读取 api-key 作为 open-id
        ↓ (未找到/未配置/api-key 为空)
第 2 步:检查 workspace 公共目录的配置文件
        路径:${OPENCLAW_WORKSPACE}/skills/smyx_common/scripts/config.yaml
        → 如果文件存在且配置了 api-key 字段,则读取 api-key 作为 open-id
        ↓ (未找到/未配置)
第 3 步:检查用户是否在消息中明确提供了 open-id
        ↓ (未提供)
第 4 步:❗ 必须暂停执行,明确提示用户提供用户名或手机号作为 open-id

⚠️ 关键约束:

  • 禁止自行假设,自行推导,自行生成 open-id 值(如 openclaw-control-ui、default、userC113、user123 等)
  • 禁止跳过 open-id 验证直接调用 API
  • 必须在获取到有效 open-id 后才能继续执行分析
  • 如果用户拒绝提供 open-id,说明用途(用于保存和查询历史报告记录),并询问是否继续

  • 标准流程:
    1. 准备客厅沙发+电视区域视频输入
      • 提供本地视频路径或网络 URL,建议覆盖白天/晚间观看时段
      • 摄像头建议:客厅固定摄像头,画面应同时覆盖沙发区域与电视方向(侧前方/对角线视角);帧率 ≥ 5 FPS、光照稳定
      • 初次部署可在画面中框选两个 ROIsofa_region(沙发坐姿区域)和 tv_region(电视屏幕区域,用于判断面部朝向)
      • 隐私敏感场景可启用人体轮廓模式
      • 可选附带:老人姓名、阈值覆盖(continuous_tv_watch_threshold_min / daily_total_watch_threshold_min)、智能音箱播报模板
    2. 获取 open-id(强制执行)
      • 按上述流程控制获取 open-id
      • 如无法获取,必须提示用户提供用户名或手机号
    3. 执行老年人电视观看时长与久坐关联分析
      • 调用 -m scripts.smyx_elderly_tv_sedentary_reminder_analysis 处理输入(必须在技能根目录下运行脚本
      • 参数说明:
        • --input: 本地客厅沙发+电视区域视频文件路径
        • --url: 网络客厅沙发+电视区域视频 URL 地址(API 服务自动下载)
        • --pet-type: 类别标识,老年人健康生活方式场景默认 other
        • --open-id: 当前用户的 open-id(必填,按上述流程获取)
        • --list: 显示老年人电视观看与久坐历史分析报告列表清单(可以输入起始日期参数过滤数据范围)
        • --api-key: API 访问密钥(可选)
        • --api-url: API 服务地址(可选,使用默认值)
        • --detail: 输出详细程度(basic/standard/json,默认 json)
        • --output: 结果输出文件路径(可选)
    4. 查看分析结果
      • 接收结构化的老年人电视观看时长与久坐关联分析报告
      • 包含:是否检测到老人(subject_detected)、两个 ROI 是否已定义(sofa_region_defined / tv_region_defined)、当次会话指标(current_session:continuous_tv_watch_duration_min / posture / face_orientation_to_tv)、当日指标(daily_metrics:total_tv_watch_duration_today_min / stand_up_events_today / longest_continuous_session_min)、提醒类型(alert_type:continuous_watch_too_long / daily_total_watch_too_long / normal)、提醒级别(alert_level:notice / warning)、推送/语音播报文本(如"张爷爷,您已经看了 2 小时电视,起来活动一下吧")、建议动作(recommend_action:voice_play_reminder / push_app_notice / suggest_stretch / observe_only)
      • 重要提示:仅输出基于视觉的观看与坐姿行为统计与友好提醒,不提供深静脉血栓 / 腰背疼痛 / 代谢紊乱等医学诊断或处方;如老人有明显腿肿、胸闷等不适请就医

资源索引

注意事项

  • 仅在需要时读取参考文档,保持上下文简洁
  • 输入要求:支持 mp4/avi/mov 视频,最大 10MB;关键:画面必须同时覆盖沙发区域和电视方向
  • API 密钥可选,如果通过参数传入则必须确保调用鉴权成功,否则忽略鉴权
  • "看电视"基于"沙发坐姿 + 面部朝向 tv_region"组合判断,老人短暂看手机/低头吃东西也可能误判为离开观看;建议结合姿态与时长综合判定
  • 多人同时坐在沙发、宠物上沙发、客人来访等情形可能影响判定,可按需切换主目标识别策略
  • 智能音箱提醒文本应使用温和、亲切语气,避免造成老人焦虑或反感
  • 隐私合规:家庭/养老机构客厅视频涉及个人隐私,使用前需取得老人/监护人明确知情同意,妥善加密保管;建议优先采用人体轮廓模式
  • 禁止临时生成脚本,只能用技能本身的脚本
  • 传入的网络地址参数,不需要下载本地,默认地址都是公网地址,api 服务会自动下载
  • 当显示历史分析报告清单的时候,从接口返回 json 数据中提取字段 reportImageUrl 作为超链接地址,且自动转化为如下 Markdown 表格格式输出,包含" 报告名称"、"连续/累计观看时长"、"分析时间"、"点击查看"四列,其中"报告名称"列使用老年人电视久坐提醒报告-{记录id}形式拼接, "点击查看" 列使用 [🔗 查看报告](reportImageUrl) 格式的超链接,用户点击即可直接跳转到对应的完整报告页面。
  • 表格输出示例:
    报告名称连续/累计观看时长分析时间点击查看
    老年人电视久坐提醒报告-20260312172200001连续 125 min / 当日累计 320 min(warning)2026-03-12 17:22:00🔗 查看报告

使用示例

# 分析本地客厅沙发+电视区域视频(以下只是示例,禁止直接使用openclaw-control-ui 作为 open-id)
python -m scripts.smyx_elderly_tv_sedentary_reminder_analysis --input /path/to/livingroom.mp4 --open-id your-open-id

# 分析网络客厅沙发+电视区域视频(以下只是示例,禁止直接使用openclaw-control-ui 作为 open-id)
python -m scripts.smyx_elderly_tv_sedentary_reminder_analysis --url https://example.com/livingroom.mp4 --open-id your-open-id

# 显示历史老年人电视观看与久坐报告(自动触发关键词:查看老人电视观看历史报告、久坐提醒报告清单等)
python -m scripts.smyx_elderly_tv_sedentary_reminder_analysis --list --open-id your-open-id

# 输出精简报告
python -m scripts.smyx_elderly_tv_sedentary_reminder_analysis --input lr.mp4 --open-id your-open-id --detail basic

# 保存结果到文件
python -m scripts.smyx_elderly_tv_sedentary_reminder_analysis --input lr.mp4 --open-id your-open-id --output result.json