JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
1.12k stars 88 forks source link

Feature Request: Update camera status when placed in away mode #56

Closed usma0118 closed 3 years ago

usma0118 commented 3 years ago

Model: Tapo C100

From Tapo App i have changed by camera status to Away mode, which Enables Alarm and notifications

To Reproduce Steps to reproduce the behavior:

  1. Go to Tapo app and place camera in Away mode
  2. Go to developer mode and fetch camera data `access_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx model_name: C100 brand: TP-Link motion_detection: 'on' device_type: SMART.IPCAMERA device_model: C100 device_name: C100 1.0 device_info: C100 1.0 hw_version: '1.0' sw_version: 1.0.17 Build 201112 Rel.29622n(4555) device_alias: Entrance features: '3' barcode: '' mac: 3d-80-7A-E7-3E-7E dev_id: 8021xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx oem_id: EDCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx hw_desc: '4857xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' user: santry motion_detection_sensitivity: normal privacy_mode: 'off' alarm: 'off' alarm_mode:
    • sound led: 'on' day_night_mode: auto auto_track: null presets: {} friendly_name: AntaresIncSantry-Entrance - HD icon: 'mdi:cctv' entity_picture: >- /api/camera_proxy/camera.antaresincsantry_entrance_hd?token=9576abf49b6a9d423b716b3fa5edc666775eda766e3a2cece04f18fa71da485c supported_features: 3 ` Expected behavior Status should be updated in HA.

Log Camera (please complete the following information):

Using stream component yes

Camera works through onvif component OR different cameras work in general yes

Camera has all attributes filled out properly in developer tools yes

HASS Environment running in docker

JurajNyiri commented 3 years ago

Setting or getting away mode is not currently supported.

Workaround: You can update motion detection, alarm (and more) from Home Assistant side.

usma0118 commented 3 years ago

Can you explain, how to do that?

Do you mean use switch or button to activate service or?

JurajNyiri commented 3 years ago

Yes, check https://github.com/JurajNyiri/HomeAssistant-Tapo-Control#services

For your example, tapo_control.set_alarm_mode and tapo_control.set_motion_detection_mode. You can open those to see all the information related to those services.

You could make an automation, button, switch etc for executing those services. See Home Assistant docs for those. Some examples to get you started are here: https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/blob/main/examples/EXAMPLES_ENTITIES.md

JurajNyiri commented 3 years ago

@neutrongenious where in the app are you setting the away mode?

usma0118 commented 3 years ago

Tried from here. image

JurajNyiri commented 3 years ago

Yes that should work, when a motion is detected (if you have motion detection enabled and privacy off), the camera will start blinking (light = on) and sound an alarm (sound=on) because alarm_mode is on.

Where in the app were you setting away mode?

usma0118 commented 3 years ago

In App main screen:

JurajNyiri commented 3 years ago

Thank you, I never saw that before.

So what happens is that when you are setting an away or home mode through the app, you are able to automatically set following:

You can do all of these (except alarm schedule) through Home Assistant and a lot more (everything else and more that app doesn't support like auto-track), like moving to preset which the app does not allow with away mode.

Other than that, the camera is doing nothing else, just setting those 2 modes which is suboptiomal.

It is more efficient to create a script (you can have home, vacation, away, sleep, imagination is the limit) in Home Assistant that gives you full control of your camera and can be triggered automatically based on presense sensor as an example.

To reiterate, setting the away mode through the app is just setting motion detection and alarm, nothing more.

The attributes of camera (alarm and motion detection) are updated when you trigger those modes through app.

When a mode is selected through an app, there is no indication of what mode is currently active, it just executes the actions as described above.

So the solution via Home Assistant does more and there is nothing new in the app that is not supported via HASS. Closing this Bug/Feature request because of that.

The only things currently not supported via this integration are schedules - alert schedule and record schedule. Those are easier to one-time setup via an app because of the UI.

usma0118 commented 3 years ago

Ok, i will test it.

meanwhile, can you share some preset examples?

JurajNyiri commented 3 years ago

Yes, I did above - https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/blob/main/examples/EXAMPLES_ENTITIES.md

There are also lovelace examples here https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/blob/main/examples/EXAMPLES_LOVELACE.md

usma0118 commented 3 years ago

Thanks for quick response.