al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.57k stars 647 forks source link

Video Stream terminates in 5 mins #913

Open new-kirte opened 1 year ago

new-kirte commented 1 year ago

Device model

chuangmi.camera.021a04

Component version

0.7.2

HA core version

2022.11.5

Integrated mode

Automatic (自动模式)

The problem

The video stream stops every 5 mins with the network error

Entity attributes

friendly_name: Mi 360° Home Security Camera 2K Pro Camera Control
supported_features: 3
entity_picture: >-
  /api/camera_proxy/camera.chuangmi_021a04_77a9_camera_control?token=9f43e2f0c1dcf594cda06e00b99dae583befe48f56eb9375d5bf71746964ebb0
video_attribute: 3
keep_streaming: true
sub_motion_stream: true
motion_stream_slice: -1
access_token: 9f43e2f0c1dcf594cda06e00b99dae583befe48f56eb9375d5bf71746964ebb0
model_name: chuangmi.camera.021a04
brand: chuangmi
motion_detection: true
frontend_stream_type: hls
model: chuangmi.camera.021a04
lan_ip: 192.168.100.211
mac_address: 94:F8:27:66:77:A9
entity_class: MiotCameraEntity
home_room: 6344569963's home Living room
miot_type: urn:miot-spec-v2:device:camera:0000A01C:chuangmi-021a04:3
camera_control.on: true
camera_control.image_rollover: 0
camera_control.night_shot: 2
camera_control.wdr_mode: true
glimmer_full_color-2-6: true
camera_control.recording_mode: 0
camera_control.motion_tracking: true
camera_control.time_watermark: true
bluetooth.bluetooth_switch.error: '-704220008 Invalid IID (PID, SID, AID, etc.)'
stream_status-8-9: 1
stream_status-7-9: 1
motion_detection.alarm_interval: 5
detection_sensitivity-5-3: 1
motion_detection_start_time-5-4: '00:00:00'
motion_detection_end_time-5-5: '23:59:00'
memory_card_management.status: 1
storage_total_space-4-2: 0
storage_free_space-4-3: 0
storage_used_space-4-4: 0
indicator_light.on: true
state_updater: cloud
sub_entities:
  - motion_detection-5.motion_detection-1
  - indicator_light-3
motion_video_time: '2022-12-02 22:49:15'
motion_video_type: PeopleMotion
motion_video_latest:
  startDuration: 0
  cut: false
  offset: 0
  isCloud: false
  isRead: false
  videoStoreId: >-
    CAMERA_VIDEO_GLACrAnVAf1RelGdxcvyYWU5UEyGpiTgJFROsNlJnr8oAqUlaYUGIZJCkAUANoeqP4-46j0_k2W6kILsoTWF_9XZTlggzAQV217Rx9x5WyQGsRLmu1JwW9PvKnwo5wf8Ht6QEYYxlnR3P-bWtDpxBbTqcHi3lGtyyqUkoMOM2uDFc0_jfVlLnKYvkehVCYQ9WnbPjchPQa-Wemh-t9AQ6MUWe4KETGGqNb6bafidWvtsxxcWzmWpadCDQ5DLhp1iCUsK0lNHHLzPCnNOObgrQ5T_CZ64qjS2Kh19l48ugxPuQmtWCbSOiBpBeEdlSIV5XwSaqSqNNhOSIA53t7vxTE8HViAVR_5tQFngVGwS7IO2-CONu7bMvZjJJFOTRco1ktlmRaajbxnNCwiGrRykNIQFTxgSxz6vCmRSRNK0aI0xdMZp2n0BGBBIklUJ6xBOZUYf0gLIbT0iGBTNPPE6ku8CHM8SqJ18sxpV13jz_QA
  eventType: PeopleMotion
  expireTime: 1670611761118
  isAlarm: true
  isShowImg: true
  imgStoreId: >-
    CAMERA_IMG_GLACrAnVAf1RelGdxcvyYWU5UEyGpiTgJFROsNlJnr8oAqUlaYUGIZJCkAUANoeqP4-46j0_k2W6kILsoTWF_9XZTlggzAQV217Rx9x5WyQGsRLmu1JwW9PvKnwo5wf8Ht6QEYYxlnR3P-bWtDpxBbTqcHi3lGtyyqUkoMOM2uDFc0_jfVlLnKYvkehVCYQ9WnbPjchPQa-Wemh-t9AQ6MUWe4KETGGqNb6bafidWvtsxxcWzmWpadCDQ5DLhp1iCUsK0lNHHLzPCnNOObgrQ5T_CZ64qjS2Kh19l48ugxPuQmtWCbSOiBpBeEdlSIV5XwSaqSqNNhOSIA53t7vxTE8HViAVR_5tQFngVGwS7IO2-CONu7bMvZjJJFOTRco1ktlmRaajbxnNCwiGrRykNIQFTxgSxz6vCmRSRNK0aI0xdMZp2n0BGBBIklUJ6xBOZUYf0gLIbT0iGBTNPPE6ku8CHM8SqJ18sxpV13jz_QA
  fileId: '83594759137402624'
  extraInfo: '{"ver":"1.0.0","alarmStart":true,"eventType":"PeopleMotion"}'

Home Assistant Logs

This error originated from a custom integration.

Logger: homeassistant.components.stream.stream.camera.chuangmi_021a04_77a9_camera_control Source: components/stream/init.py:428 Integration: Stream (documentation, issues) First occurred: 10:12:31 PM (37 occurrences) Last logged: 10:47:02 PM

Error from stream worker: Stream ended; no additional packets Error from stream worker: Error opening stream (HTTP_FORBIDDEN, Server returned 403 Forbidden (access denied)) https://sg08.livestreaming.io.mi.com/hlstranscoder/GCAxMzFmNjY3YjRmMzQ0MjJjYjY5NzEyODAwYzBhNGEyNRgKX191bnVzZWRfXwA_H265transH264/playlist.m3u8 Error from stream worker: Error opening stream (HTTP_FORBIDDEN, Server returned 403 Forbidden (access denied)) https://sg13.livestreaming.io.mi.com/hlstranscoder/GCA3ZDRiMjViZDM2MjY0MDYwODNkMDkzOGEyZWExYWYyZBgKX191bnVzZWRfXwA_H265transH264/playlist.m3u8

Bib007 commented 1 year ago

I have the same problem i have a isa.camera.hl6 and a isa.camera.hl7

Zeunas commented 1 year ago

Before the latest release of HASS I was able to remove the "Stream" component from configuration.yaml and that did the trick, as this ia an ongoing issue with this Xiaomi integration vs Stream component. But now it seems that the stream component is available by default without an option to turn it off, meaning the camera component of this integration won't be working as it should.

Make sure you read previous issues #166 https://github.com/al-one/hass-xiaomi-miot/issues/166#issuecomment-917408685