0x5e / homebridge-tuya-platform

Make homebridge-tuya-platform great again.
MIT License
206 stars 58 forks source link

Failed to Awake Battery-Powered Peephole Camera in Home App #378

Open sam-cheuk opened 9 months ago

sam-cheuk commented 9 months ago

Prerequisite

Cache

Version

1.7.0-beta.49

Device Infomation JSON File

{
  "active_time": 1694010377,
  "biz_type": 18,
  "category": "sp",
  "create_time": 1694010377,
  "icon": "smart/icon/ay1565839075983OpfF2/7c317b0a091805e9e21870fdcd7b9ad7.jpg",
  "model": "S2,S22,S50,S50S,S60,S60S,S6.S62, S80,S80S,S80,S80S,S8,S82",
  "name": "video peephole camera",
  "online": true,
  "product_id": "vnidlamnjwqqqano",
  "product_name": "video peephole camera",
  "status": [
    {
      "code": "alarm_message",
      "value": ""
    },
    {
      "code": "basic_device_volume",
      "value": 80
    },
    {
      "code": "basic_flip",
      "value": true
    },
    {
      "code": "basic_indicator",
      "value": true
    },
    {
      "code": "basic_nightvision",
      "value": "1"
    },
    {
      "code": "basic_osd",
      "value": true
    },
    {
      "code": "battery_report_cap",
      "value": 0
    },
    {
      "code": "doorbell_active",
      "value": ""
    },
    {
      "code": "doorbell_pic",
      "value": ""
    },
    {
      "code": "humanoid_filter",
      "value": false
    },
    {
      "code": "initiative_message",
      "value": "eyJ2IjoiNC4wIiwiZmlsZXMiOlt7ImRhdGEiOiJkYTM1MzQ0NmQ3OGI3ODNkZTE2YTY1Y2Q3ZTc3MTJhMTZhY2U1ZTczYmZhODI5NGYzNDIwNDU4ZTRkZjgxYTYyMGUwOWRiYmY5NDNkZTQzYzRhNzVhMDVhOGRlODY3Yjk4YWEzZWJmOTUzMjJjN2YxNjMzY2ZlZTkyNWY0MDcyZTA4YWYyMTQ5ZjQ4NGViNTljNTI4MWZlNDcyN2MyODRhOTNkMmU4NjY2NmY1YzI0MGE4NWRiYzFiMDBhYjNkNGM3M2MxNzEzYjZhMDFiMWZlYTE4YjE3MmJkY2UwNDE2MSIsImtleUlkIjoiZGVmYXVsdCIsIml2IjoiODJlOGY0MTFiYzZhMDhhZDUzODliOGU5ZjUzMTI2ZjEifV0sImNtZCI6ImlwY19tb3Rpb24iLCJ0eXBlIjoiaW1hZ2UifQ=="
    },
    {
      "code": "ipc_work_mode",
      "value": "0"
    },
    {
      "code": "motion_record",
      "value": false
    },
    {
      "code": "movement_detect_pic",
      "value": "$"
    },
    {
      "code": "pir_switch",
      "value": "1"
    },
    {
      "code": "record_loop",
      "value": true
    },
    {
      "code": "record_mode",
      "value": "1"
    },
    {
      "code": "record_switch",
      "value": true
    },
    {
      "code": "sd_format",
      "value": true
    },
    {
      "code": "sd_format_state",
      "value": 0
    },
    {
      "code": "sd_status",
      "value": 1
    },
    {
      "code": "sd_storge",
      "value": "124844544|181952|124662592"
    },
    {
      "code": "sd_umount",
      "value": false
    },
    {
      "code": "wireless_awake",
      "value": false
    },
    {
      "code": "wireless_electricity",
      "value": 100
    },
    {
      "code": "wireless_lowpower",
      "value": 10
    },
    {
      "code": "wireless_powermode",
      "value": "0"
    }
  ],
  "sub": false,
  "time_zone": "+08:00",
  "update_time": 1695399683,
  "schema": [
    {
      "code": "alarm_message",
      "mode": "ro",
      "type": "String",
      "property": {}
    },
    {
      "code": "basic_device_volume",
      "mode": "rw",
      "type": "Integer",
      "property": {
        "unit": "%",
        "min": 1,
        "max": 100,
        "scale": 0,
        "step": 1
      }
    },
    {
      "code": "basic_flip",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "basic_indicator",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "basic_nightvision",
      "mode": "rw",
      "type": "Enum",
      "property": {
        "range": [
          "0",
          "1",
          "2"
        ]
      }
    },
    {
      "code": "basic_osd",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "battery_report_cap",
      "mode": "ro",
      "type": "Integer",
      "property": {
        "min": 0,
        "max": 15,
        "scale": 0,
        "step": 1
      }
    },
    {
      "code": "doorbell_active",
      "mode": "ro",
      "type": "String",
      "property": {
        "maxlen": 255
      }
    },
    {
      "code": "doorbell_pic",
      "mode": "ro",
      "type": "Raw",
      "property": {}
    },
    {
      "code": "humanoid_filter",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "initiative_message",
      "mode": "ro",
      "type": "Raw",
      "property": {}
    },
    {
      "code": "ipc_work_mode",
      "mode": "rw",
      "type": "Enum",
      "property": {
        "range": [
          "0",
          "1"
        ]
      }
    },
    {
      "code": "motion_record",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "movement_detect_pic",
      "mode": "ro",
      "type": "Raw",
      "property": {}
    },
    {
      "code": "pir_switch",
      "mode": "rw",
      "type": "Enum",
      "property": {
        "range": [
          "0",
          "1",
          "2",
          "3"
        ]
      }
    },
    {
      "code": "record_loop",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "record_mode",
      "mode": "rw",
      "type": "Enum",
      "property": {
        "range": [
          "1",
          "2"
        ]
      }
    },
    {
      "code": "record_switch",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "sd_format",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "sd_format_state",
      "mode": "ro",
      "type": "Integer",
      "property": {
        "unit": "",
        "min": -20000,
        "max": 20000,
        "scale": 1,
        "step": 1
      }
    },
    {
      "code": "sd_status",
      "mode": "ro",
      "type": "Integer",
      "property": {
        "unit": "",
        "min": 1,
        "max": 5,
        "scale": 1,
        "step": 1
      }
    },
    {
      "code": "sd_storge",
      "mode": "ro",
      "type": "String",
      "property": {
        "maxlen": 255
      }
    },
    {
      "code": "sd_umount",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "wireless_awake",
      "mode": "rw",
      "type": "Boolean",
      "property": {}
    },
    {
      "code": "wireless_electricity",
      "mode": "ro",
      "type": "Integer",
      "property": {
        "unit": "",
        "min": 0,
        "max": 100,
        "scale": 1,
        "step": 1
      }
    },
    {
      "code": "wireless_lowpower",
      "mode": "rw",
      "type": "Integer",
      "property": {
        "unit": "",
        "min": 10,
        "max": 30,
        "scale": 1,
        "step": 1
      }
    },
    {
      "code": "wireless_powermode",
      "mode": "ro",
      "type": "Enum",
      "property": {
        "range": [
          "0",
          "1"
        ]
      }
    }
  ]
}

Device Control Mode

Standard Instruction

Logs

[23/09/2023, 02:07:13] [Tuya] [video peephole camera] Running Snapshot command: /var/lib/homebridge/node_modules/@0x5e/homebridge-tuya-platform/node_modules/ffmpeg-for-homebridge/ffmpeg "-i" "rtsps://echo:********************************@wework-2-us.stream.iot-11.com:443/v1/**********************/********************************?signInfo=***************************************************************************************************************************************************************************" "-frames:v" "1" "-hide_banner" "-loglevel" "error" "-f" "image2" "-"
[video peephole camera] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info.
[video peephole camera] The image snapshot handler for the given accessory didn't respond at all! See https://homebridge.io/w/JtMGR for more info.
[23/09/2023, 02:07:28] [Tuya] [video peephole camera] Failed to fetch snapshot. Showing "offline" image instead.
[23/09/2023, 02:07:28] [Tuya] [video peephole camera] Cannot determine format of input stream 0:0 after EOF Error marking filters as finished

Other Infomations

This battery-powered peephole camera operates in a sleep mode until it is activated either through the Smart Life app or when its motion sensor is triggered. During idle periods, the camera remains dormant, and as a result, snapshots and videos cannot be displayed in the Home app. Please refer to the attached log for details.

However, I have observed that by opening the Smart Life app and activating the camera, and then swiftly switching to the Home app, snapshots and videos can be displayed without any issues. In light of this, I am interested in knowing if there is a specific command or action that can be executed to awaken the camera before snapshots and videos can be shown in the Home app.