New Features
- Add: New sensor entities about all available storages in cameras, generated dynamically from camera. Depending on your settings, values for these entities might change a lot so I would recommend adding them to
exclude
in logbook and/or recorder.
Developer Notes
Recently one of my cameras stopped detecting SD card and thus stopped recording without my knowledge. Because of this, I added all these new data into Diagnostics section of each camera. You can see my example automation below, which automatically notifies me about an unexpected state of SD card in one of my cameras. You can add more triggers from other cameras too and it will work correctly automatically.
*triggered with additional state trigger Automation to notify about invalid SD card state
Automation YAML:
alias: "Tapo: Detect SD card failure"
description: >-
Detects invalid state of SD cards of tapo cameras and creates a persistent notification
trigger:
- platform: state
entity_id:
- sensor.bedroom_disk_1_detect_status
from: normal
- platform: state
entity_id:
- sensor.bedroom_disk_1_rw_attr
from: rw
- platform: state
entity_id:
- sensor.bedroom_disk_1_status
from: normal
- platform: state
entity_id:
- sensor.bedroom_disk_1_write_protect
from: "0"
condition: []
action:
- service: notify.persistent_notification
data:
message: >
{% set diskName = trigger.entity_id | regex_findall_index('sensor\.(.*?disk_.*?)_') %}
WARNING: Camera {{device_attr(trigger.entity_id,"name")}} SD card failure!
status: {{states("sensor."+diskName+"_status")}}
detect_status: {{states("sensor."+diskName+"_detect_status")}}
rw: {{states("sensor."+diskName+"_rw_attr")}}
write_protect: {{states("sensor."+diskName+"_write_protect")}}
mode: single
Example output:
sensor.bedroom_disk_1_record_free_duration
which updates every 10 seconds for me, for testing