tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
879 stars 207 forks source link

Tuya S20 Camera #906

Open adi90x opened 1 year ago

adi90x commented 1 year ago

Hello,

I recently bought an outdoor Camera, video is fine in HA however controls, recording and pir détection sensor are not available in ha. Only a motion detection switch ( which don't seems to work), a flip and watermark switch are available. At least stream is fine :) Camera reports in logs as S20, severals others functions seems available. Most important would be to have a sensor to know when something is detected ! Log/config from integration is available below.

Thanks a lot, Regards,,

 "name": "Camera Jardin",
        "model": "S20",
        "category": "sp",
        "product_id": "ls4kjtchl1fwp411",
        "product_name": "Smart Camera ",
        "online": true,
        "sub": false,
        "time_zone": "+01:00",
        "active_time": "2023-01-29T09:26:10+00:00",
        "create_time": "2023-01-29T09:26:10+00:00",
        "update_time": "2023-01-29T09:26:26+00:00",
        "function": {
          "basic_flip": {
            "type": "Boolean",
            "value": {}
          },
          "basic_osd": {
            "type": "Boolean",
            "value": {}
          },
          "sd_format": {
            "type": "Boolean",
            "value": {}
          },
          "motion_record": {
            "type": "Boolean",
            "value": {}
          },
          "ptz_stop": {
            "type": "Boolean",
            "value": {}
          },
          "ptz_control": {
            "type": "Enum",
            "value": {
              "range": [
                "0",
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7"
              ]
            }
          },
          "nightvision_mode": {
            "type": "Enum",
            "value": {
              "range": [
                "auto",
                "ir_mode",
                "color_mode"
              ]
            }
          },
          "siren_sound": {
            "type": "Enum",
            "value": {
              "range": [
                "item_1",
                "item_2",
                "item_3",
                "item_4",
                "item_5",
                "item_6",
                "item_7",
                "item_8",
                "item_9",
                "item_10"
              ]
            }
          },
          "ptz_calibration": {
            "type": "Boolean",
            "value": {}
          },
          "wireless_lowpower": {
            "type": "Integer",
            "value": {
              "min": 10,
              "max": 50,
              "scale": 0,
              "step": 1
            }
          },
          "wireless_awake": {
            "type": "Boolean",
            "value": {}
          },
          "pir_switch": {
            "type": "Enum",
            "value": {
              "range": [
                "0",
                "1",
                "2",
                "3",
                "4"
              ]
            }
          }
        },
        "status_range": {
          "basic_flip": {
            "type": "Boolean",
            "value": {}
          },
          "basic_osd": {
            "type": "Boolean",
            "value": {}
          },
          "sd_storge": {
            "type": "String",
            "value": {
              "maxlen": 255
            }
          },
          "sd_status": {
            "type": "Integer",
            "value": {
              "min": 1,
              "max": 5,
              "scale": 0,
              "step": 1
            }
          },
          "sd_format": {
            "type": "Boolean",
            "value": {}
          },
          "motion_record": {
            "type": "Boolean",
            "value": {}
          },
          "movement_detect_pic": {
            "type": "Raw",
            "value": {}
          },
          "ptz_stop": {
            "type": "Boolean",
            "value": {}
          },
          "sd_format_state": {
            "type": "Integer",
            "value": {
              "min": -20000,
              "max": 200000,
              "scale": 0,
              "step": 1
            }
          },
          "ptz_control": {
            "type": "Enum",
            "value": {
              "range": [
                "0",
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7"
              ]
            }
          },
          "nightvision_mode": {
            "type": "Enum",
            "value": {
              "range": [
                "auto",
                "ir_mode",
                "color_mode"
              ]
            }
          },
          "siren_sound": {
            "type": "Enum",
            "value": {
              "range": [
                "item_1",
                "item_2",
                "item_3",
                "item_4",
                "item_5",
                "item_6",
                "item_7",
                "item_8",
                "item_9",
                "item_10"
              ]
            }
          },
          "ptz_calibration": {
            "type": "Boolean",
            "value": {}
          },
          "wireless_electricity": {
            "type": "Integer",
            "value": {
              "min": 0,
              "max": 100,
              "scale": 0,
              "step": 1
            }
          },
          "wireless_powermode": {
            "type": "Enum",
            "value": {
              "range": [
                "0",
                "1"
              ]
            }
          },
          "wireless_lowpower": {
            "type": "Integer",
            "value": {
              "min": 10,
              "max": 50,
              "scale": 0,
              "step": 1
            }
          },
          "wireless_awake": {
            "type": "Boolean",
            "value": {}
          },
          "pir_switch": {
            "type": "Enum",
            "value": {
              "range": [
                "0",
                "1",
                "2",
                "3",
                "4"
              ]
            }
          },
          "doorbell_pic": {
            "type": "Raw",
            "value": {}
          },
          "alarm_message": {
            "type": "String",
            "value": {}
          }
        },
        "status": {
          "basic_flip": false,
          "basic_osd": true,
          "sd_storge": "0|0|0",
          "sd_status": 1,
          "sd_format": false,
          "motion_record": false,
          "movement_detect_pic": "**REDACTED**",
          "ptz_stop": true,
          "sd_format_state": 0,
          "ptz_control": 3,
          "nightvision_mode": "auto",
          "siren_sound": "item_1",
          "ptz_calibration": false,
          "wireless_electricity": 70,
          "wireless_powermode": 1,
          "wireless_lowpower": 10,
          "wireless_awake": false,
          "pir_switch": 3,
          "doorbell_pic": "",
          "alarm_message": "**REDACTED**"
        },
        "home_assistant": {
          "name": "Camera Jardin",
          "name_by_user": null,
          "disabled": false,
          "disabled_by": null,
          "entities": [
            {
              "disabled": false,
              "disabled_by": null,
              "entity_category": "diagnostic",
              "device_class": null,
              "original_device_class": null,
              "icon": "mdi:battery",
              "original_icon": null,
              "unit_of_measurement": null,
              "state": {
                "entity_id": "sensor.smart_camera_battery",
                "state": "70.0",
                "attributes": {
                  "state_class": "measurement",
                  "icon": "mdi:battery",
                  "friendly_name": "Camera Jardin Battery"
                },
                "last_changed": "2023-01-31T13:21:52.039998+00:00",
                "last_updated": "2023-01-31T13:21:52.039998+00:00"
              }
            },
            {
              "disabled": false,
              "disabled_by": null,
              "entity_category": "config",
              "device_class": null,
              "original_device_class": null,
              "icon": null,
              "original_icon": "mdi:record-rec",
              "unit_of_measurement": null,
              "state": {
                "entity_id": "switch.smart_camera_motion_recording",
                "state": "off",
                "attributes": {
                  "icon": "mdi:record-rec",
                  "friendly_name": "Camera Jardin Motion Recording"
                },
                "last_changed": "2023-01-31T13:21:52.049905+00:00",
                "last_updated": "2023-01-31T13:21:52.049905+00:00"
              }
            },
            {
              "disabled": false,
              "disabled_by": null,
              "entity_category": "config",
              "device_class": null,
              "original_device_class": null,
              "icon": null,
              "original_icon": "mdi:flip-horizontal",
              "unit_of_measurement": null,
              "state": {
                "entity_id": "switch.smart_camera_flip",
                "state": "off",
                "attributes": {
                  "icon": "mdi:flip-horizontal",
                  "friendly_name": "Camera Jardin Flip"
                },
                "last_changed": "2023-01-31T13:21:52.051385+00:00",
                "last_updated": "2023-01-31T13:21:52.051385+00:00"
              }
            },
            {
              "disabled": false,
              "disabled_by": null,
              "entity_category": "config",
              "device_class": null,
              "original_device_class": null,
              "icon": null,
              "original_icon": "mdi:watermark",
              "unit_of_measurement": null,
              "state": {
                "entity_id": "switch.smart_camera_time_watermark",
                "state": "on",
                "attributes": {
                  "icon": "mdi:watermark",
                  "friendly_name": "Camera Jardin Time Watermark"
                },
                "last_changed": "2023-01-31T13:21:52.055999+00:00",
                "last_updated": "2023-01-31T13:21:52.055999+00:00"
              }
            },
            {
              "disabled": false,
              "disabled_by": null,
              "entity_category": null,
              "device_class": null,
              "original_device_class": null,
              "icon": null,
              "original_icon": null,
              "unit_of_measurement": null,
              "state": {
                "entity_id": "camera.smart_camera",
                "state": "idle",
                "attributes": {
                  "access_token": "REDACTED",
                  "model_name": "Smart Camera ",
                  "brand": "Tuya",
                  "frontend_stream_type": "hls",
                  "entity_picture": "**REDACTED**",
                  "friendly_name": "Camera Jardin",
                  "supported_features": 2
                },
                "last_changed": "2023-01-31T13:21:52.027849+00:00",
                "last_updated": "2023-01-31T13:33:07.842095+00:00"
              }
            }
          ]
        }
      } 
adi90x commented 1 year ago

Hello,

It seems the available switch for motion recording switch to unavailable and back to inactive when a motion is detected by the camera maybe there is something easy to do to change that ?

Regards,