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
877 stars 206 forks source link

Add Support for BNETA IoT Smart Pet Feeder #132

Open 0xa51f opened 3 years ago

0xa51f commented 3 years ago

Device normal info

Device info (please complete the following information, which can be found in log): like this: { "active_time": 1608450719, "biz_type": 0, "category": "sp", "create_time": 1608450719, "icon": "smart/icon/ay1539074879262GYXmu/8f221d8164944466887c7febfa87595b.jpg", "id": "ip": "lat": "local_key": "lon": "model": "中性", "name": "PetFeeder", "online": true, "owner_id": "product_id": "aehfntztbgk0nf8e", "product_name": "PetFeeder", "status": [ { "code": "basic_indicator", "value": true }, { "code": "basic_flip", "value": false }, { "code": "basic_osd", "value": true }, { "code": "motion_sensitivity", "value": "0" }, { "code": "basic_nightvision", "value": "0" }, { "code": "motion_record", "value": false }, { "code": "movement_detect_pic", "value": "eyJidWNrZXQiOiJ0eS1ldS1zdG9yYWdlMzAiLCJmaWxlcyI6W1siLzEyZDBkMC0xMzM2MjExNC1wdzExZTM1ZDJjY2QzZDcyMmYwYy9kZXRlY3QvMTYyMTkyMDc2NS5qcGVnP3BhcmFtPThqK29zZENnUXo4VjRZNTBLK2F4b2xYdjcwdHZXNTlZYXpobmtZSmdMNUE9IiwiIl1dLCJ2IjoiMy4wIn0=" }, { "code": "motion_switch", "value": false } ], "sub": false, "time_zone": "+02:00", "uid": "eu1592714041500wKFYL", "update_time": 1625965119, "uuid": "pw11e35d2ccd3d722f0c" },

Device specifications (please complete the following information, which can be found in log): Same device's id, like this: { "active_time": 1608450719, "biz_type": 0, "category": "sp", "create_time": 1608450719, "icon": "smart/icon/ay1539074879262GYXmu/8f221d8164944466887c7febfa87595b.jpg", "id": "ip": "lat": "local_key": "lon": "model": "中性", "name": "PetFeeder", "online": true, "owner_id": "product_id": "aehfntztbgk0nf8e", "product_name": "PetFeeder", "status": [ { "code": "basic_indicator", "value": true }, { "code": "basic_flip", "value": false }, { "code": "basic_osd", "value": true }, { "code": "motion_sensitivity", "value": "0" }, { "code": "basic_nightvision", "value": "0" }, { "code": "motion_record", "value": false }, { "code": "movement_detect_pic", "value": "eyJidWNrZXQiOiJ0eS1ldS1zdG9yYWdlMzAiLCJmaWxlcyI6W1siLzEyZDBkMC0xMzM2MjExNC1wdzExZTM1ZDJjY2QzZDcyMmYwYy9kZXRlY3QvMTYyMTkyMDc2NS5qcGVnP3BhcmFtPThqK29zZENnUXo4VjRZNTBLK2F4b2xYdjcwdHZXNTlZYXpobmtZSmdMNUE9IiwiIl1dLCJ2IjoiMy4wIn0=" }, { "code": "motion_switch", "value": false } ], "sub": false, "time_zone": "+02:00", "uid": "eu1592714041500wKFYL", "update_time": 1625965119, "uuid": "pw11e35d2ccd3d722f0c" },

iSteeb commented 3 years ago

I second this request, with a Mirabella Genio Pet Feeder with Camera. Same 'sp' category so I won't bog down the thread with more details, just adding interest.

Write commented 3 years ago

Not the same model but I wish the same with my device which is not in sales anymore

https://www.amazon.fr/gp/product/B08HCWBY7N

It also shows only information about the camera and nothing about the "feeding" interaction in the API. Product is DU4L-VS on iot.tuya.com website and also 'sp' category. I don't have much hope but who knows ¯\(ツ)

tiaanv commented 2 years ago

This Petfeeder is terrible from an integration perspective. The instruction set does NOT include any mechanism to trigger a feed cycle. IT support changing a few settings related to the camera and motion recording. The camera feed, although available in the TUYA integration, does not work. times out. I've had this for more than a year now, and I have all but given up on this becoming a smart device as part of my HA eco-system. My next move is to rip out the brains and camera (quite a shame) and go the ESPhome route with a camera, and custom logic.

frenck commented 2 years ago

@tiaanv Thanks for the non-constructive criticism.

Would have been nicer if you provided e.g., diagnostic data for your device and or examples on how you think things kan be improved.

Good luck on your journey though!

tiaanv commented 2 years ago

Hey, @frenck . I feel privileged to have you comment on one of my most useless posts (embarrassed). I posted in this particular thread to essentially give fellow owners a heads-up to not hold their breath, as this device does not even support proper functionality within the Tuya app. It's not really me criticizing the HA integration. I read back my post, and it's not clear in that regard. The Device does not allow you to respond to motion events (scenes), nor does it actually have an endpoint available to trigger feeding. This is not something that can be overcome in HA, nor is it an HA issue in my opinion.

I guess the only thing that can be looked at is the camera stream not working, albeit a little less useful if the device cannot be controlled in any way. I am happy to assist in that regard and will do some reading, compiling some debug info.

The potential userbase for this device out there might not warrant much effort from the team though.

edit: Let me know what info I can provide. from HA, Tuya IOT portal etc...

frenck commented 2 years ago

@tiaanv Thanks for your extensive response! ❤️

Yeah agreed, it would not be possible to create new functionalities. We are limited to what the device and Tuya API provides though.

Nevertheless, maybe there are usable endpoint exposed that we are not aware of. For example, camera functionality for pet feeders isn't documented.

Would you be so kind to share diagnostics information of your device? They are anonymized and can be downloaded on the device page in Home Assistant

../Frenck

tiaanv commented 2 years ago

No Problem:

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.2.6",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.7",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Africa/Johannesburg",
    "os_name": "Linux",
    "os_version": "5.10.98",
    "supervisor": "2022.01.1",
    "host_os": "Home Assistant OS 7.4",
    "docker_version": "20.10.9",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "localtuya": {
      "version": "3.2.1",
      "requirements": []
    },
    "auto_backup": {
      "version": "0.10.1",
      "requirements": []
    },
    "sonoff": {
      "version": "v2.4.6",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "blueiris": {
      "version": "1.0.7",
      "requirements": []
    },
    "hacs": {
      "version": "1.21.0",
      "requirements": [
        "aiogithubapi>=21.11.0"
      ]
    },
    "entity_controller": {
      "version": "9.2.10",
      "requirements": [
        "transitions==0.8.8"
      ]
    },
    "eskom_loadshedding": {
      "version": "1.0.0",
      "requirements": [
        "aiohttp-retry==1.0"
      ]
    }
  },
  "integration_manifest": {
    "domain": "tuya",
    "name": "Tuya",
    "documentation": "https://www.home-assistant.io/integrations/tuya",
    "requirements": [
      "tuya-iot-py-sdk==0.6.6"
    ],
    "dependencies": [
      "ffmpeg"
    ],
    "codeowners": [
      "@Tuya",
      "@zlinoliver",
      "@METISU",
      "@frenck"
    ],
    "config_flow": true,
    "iot_class": "cloud_push",
    "dhcp": [
      {
        "macaddress": "105A17*"
      },
      {
        "macaddress": "10D561*"
      },
      {
        "macaddress": "1869D8*"
      },
      {
        "macaddress": "381F8D*"
      },
      {
        "macaddress": "508A06*"
      },
      {
        "macaddress": "68572D*"
      },
      {
        "macaddress": "708976*"
      },
      {
        "macaddress": "7CF666*"
      },
      {
        "macaddress": "84E342*"
      },
      {
        "macaddress": "D4A651*"
      },
      {
        "macaddress": "D81F12*"
      }
    ],
    "is_built_in": true
  },
  "data": {
    "endpoint": "https://openapi.tuyaeu.com",
    "auth_type": 0,
    "country_code": "27",
    "app_type": "smartlife",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "name": "PetFeeder",
    "model": null,
    "category": "sp",
    "product_id": "aehfntztbgk0nf8e",
    "product_name": "PetFeeder",
    "online": true,
    "sub": false,
    "time_zone": "+02:00",
    "active_time": "2020-10-14T06:58:35+00:00",
    "create_time": "2020-10-14T06:58:35+00:00",
    "update_time": "2022-02-11T07:23:39+00:00",
    "function": {
      "basic_indicator": {
        "type": "Boolean",
        "value": {}
      },
      "basic_flip": {
        "type": "Boolean",
        "value": {}
      },
      "basic_osd": {
        "type": "Boolean",
        "value": {}
      },
      "motion_sensitivity": {
        "type": "Enum",
        "value": {
          "range": [
            "0",
            "1",
            "2"
          ]
        }
      },
      "basic_nightvision": {
        "type": "Enum",
        "value": {
          "range": [
            "0",
            "1",
            "2"
          ]
        }
      },
      "motion_record": {
        "type": "Boolean",
        "value": {}
      },
      "motion_switch": {
        "type": "Boolean",
        "value": {}
      }
    },
    "status_range": {
      "basic_indicator": {
        "type": "Boolean",
        "value": {}
      },
      "basic_flip": {
        "type": "Boolean",
        "value": {}
      },
      "basic_osd": {
        "type": "Boolean",
        "value": {}
      },
      "motion_sensitivity": {
        "type": "Enum",
        "value": {
          "range": [
            "0",
            "1",
            "2"
          ]
        }
      },
      "basic_nightvision": {
        "type": "Enum",
        "value": {
          "range": [
            "0",
            "1",
            "2"
          ]
        }
      },
      "motion_record": {
        "type": "Boolean",
        "value": {}
      },
      "movement_detect_pic": {
        "type": "Raw",
        "value": {}
      },
      "motion_switch": {
        "type": "Boolean",
        "value": {}
      }
    },
    "status": {
      "basic_indicator": true,
      "basic_flip": false,
      "basic_osd": true,
      "motion_sensitivity": 0,
      "basic_nightvision": 0,
      "motion_record": false,
      "movement_detect_pic": "**REDACTED**",
      "motion_switch": false
    },
    "home_assistant": {
      "name": "PetFeeder",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "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.petfeeder",
            "state": "idle",
            "attributes": {
              "access_token": "04de03aacad5968ec1702c8e982148f79e0cd96fc45acc47ef87eeac65137e8b",
              "model_name": "PetFeeder",
              "brand": "Tuya",
              "frontend_stream_type": "hls",
              "entity_picture": "**REDACTED**",
              "friendly_name": "PetFeeder",
              "supported_features": 2
            },
            "last_changed": "2022-02-13T04:20:13.810588+00:00",
            "last_updated": "2022-02-14T07:24:34.376918+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "original_icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "light.petfeeder_indicator_light",
            "state": "on",
            "attributes": {
              "supported_color_modes": [
                "onoff"
              ],
              "color_mode": "onoff",
              "friendly_name": "PetFeeder Indicator Light",
              "supported_features": 0
            },
            "last_changed": "2022-02-13T04:20:13.810951+00:00",
            "last_updated": "2022-02-13T04:20:13.810951+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": "tuya__basic_nightvision",
          "icon": null,
          "original_icon": "mdi:theme-light-dark",
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.petfeeder_night_vision",
            "state": "0",
            "attributes": {
              "options": [
                "0",
                "1",
                "2"
              ],
              "device_class": "tuya__basic_nightvision",
              "icon": "mdi:theme-light-dark",
              "friendly_name": "PetFeeder Night Vision"
            },
            "last_changed": "2022-02-13T04:20:13.811212+00:00",
            "last_updated": "2022-02-13T04:20:13.811212+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": "tuya__motion_sensitivity",
          "icon": null,
          "original_icon": "mdi:motion-sensor",
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.petfeeder_motion_detection_sensitivity",
            "state": "0",
            "attributes": {
              "options": [
                "0",
                "1",
                "2"
              ],
              "device_class": "tuya__motion_sensitivity",
              "icon": "mdi:motion-sensor",
              "friendly_name": "PetFeeder Motion Detection Sensitivity"
            },
            "last_changed": "2022-02-14T07:02:57.224608+00:00",
            "last_updated": "2022-02-14T07:02:57.224608+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.petfeeder_motion_recording",
            "state": "off",
            "attributes": {
              "icon": "mdi:record-rec",
              "friendly_name": "PetFeeder Motion Recording"
            },
            "last_changed": "2022-02-13T04:20:13.812698+00:00",
            "last_updated": "2022-02-13T04:20:13.812698+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.petfeeder_flip",
            "state": "off",
            "attributes": {
              "icon": "mdi:flip-horizontal",
              "friendly_name": "PetFeeder Flip"
            },
            "last_changed": "2022-02-14T06:55:31.076812+00:00",
            "last_updated": "2022-02-14T06:55:31.076812+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.petfeeder_time_watermark",
            "state": "on",
            "attributes": {
              "icon": "mdi:watermark",
              "friendly_name": "PetFeeder Time Watermark"
            },
            "last_changed": "2022-02-13T04:20:13.813037+00:00",
            "last_updated": "2022-02-13T04:20:13.813037+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "original_icon": "mdi:motion-sensor",
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.petfeeder_motion_alarm",
            "state": "off",
            "attributes": {
              "icon": "mdi:motion-sensor",
              "friendly_name": "PetFeeder Motion Alarm"
            },
            "last_changed": "2022-02-13T04:20:13.813218+00:00",
            "last_updated": "2022-02-13T04:20:13.813218+00:00"
          }
        }
      ]
    }
  }
}
frenck commented 2 years ago

Thanks, @tiaanv!

Looking at that list is kinda interesting, as it only supplies camera values, and indeed nothing to control the feeder.

I've seen a couple of pet feeder diagnostics, however, non like this one. This is the first one I see with camera support and the first one with really 0 controls on the feeder itself.

You could try sending a support ticket about that directly to Tuya. You can submit one directly to Tuya by logging in into the Tuya IoT dashboard.

../Frenck

tiaanv commented 2 years ago

Yes.. I know right.. It's basically just presenting as a camera. Yet the Tuya APP experience is pretty rich: image

Unfortunately, none of the key functions are available via IoT.

The way I understand it, the device "capabilities" and endpoints are developed/maintained by the individual provider. This BNETA pet feeder is an OEM product made by a Chinese company called PETWAY. Not even an English website, unfortunately.. But I will see if I can get somewhere with the Tuya IOT support.

Thx for the feedback though!

frenck commented 2 years ago

The way I understand it, the device "capabilities" and endpoints are developed/maintained by the individual provider.

Not always! Sometimes Tuya support/their cloud API developers are able to provide a solution by adding some standardization to existing devices 🙏

tiaanv commented 2 years ago

An Update. I tried engaging with Tuya support. Seems this is likely a dead-end from a control perspective. The repeated the fact that the device does not support "transparent transmission", because it is a IPC (camera) device, it is considered a security device, and this seems to prevent further IOT integration. I honestly am not quite sure what they are saying, but the message was pretty definitive. screenshot of conversation for reference below: image

frenck commented 2 years ago

Yes, that is pretty much a dead end :(

tiaanv commented 2 years ago

FWIW:

So if anything, perhaps we can see if we can get the camera stream to work. Not sure if this issue is related to my setup only, or for everyone. Log data

Logger: homeassistant.components.stream.stream.camera.petfeeder
Source: components/stream/__init__.py:340
Integration: Stream (documentation, issues)
First occurred: February 14, 2022, 08:21:47 (22 occurrences)
Last logged: 13:13:10

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsps://****:****@aws-tractor2.tuyaeu.com:443/v1/proxy/echo_show/0afe8547c1864d91b11cf1da2bdc3510138ed7d3408b24d3
Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsps://****:****@aws-tractor1.tuyaeu.com:443/v1/proxy/echo_show/78697510149241c68306640b902ac1ed59cf45d1c7747348
Logger: haffmpeg.tools
Source: /usr/local/lib/python3.9/site-packages/haffmpeg/tools.py:49
First occurred: February 14, 2022, 08:21:19 (13 occurrences)
Last logged: 13:14:51

Timeout reading image.
stboch commented 2 years ago

Trying again with support to see if anyone is interested on their end to take a look about a consolidated instruction set or letting me know what the api commands are to for the category to cwwsq instead of sp.

pergolafabio commented 1 year ago

Guy, just for info, also bought an pet feeder, and I also saw a list of DP's , but the one for feeding wasn't included... Only those from 101 to ...

Then I installed fiddler , a tool to decode the https traffic on the smart life app, and I obtained finally the final list for my pet feeder, the other DP were starting from 201 to 208... They are most all sensors, like last pet feed record .. but DP 201 was in my case the one needed for feed...

I now use localtuya for the moment so I can send a feed portion ....

huseyint commented 1 year ago

@pergolafabio do you have a sample HTTP request that sends a feed command?

pergolafabio commented 1 year ago

No, that traffic wasnt avaible, also when looking on IOT platform, it was not avaible either... But I thought, if the app can do it there must be a way... So I started looking for the DP, and for some reason they are all hidden, well the important ones at least... But I was able to find them when I decoded...

pergolafabio commented 1 year ago

So I think if you setup localtuya, you can use the feed fuction

pergolafabio commented 1 year ago

Here are my DP, the ones I needed were from 201 to 208... The others are easily to find on iot platform

image

For feeding I use this service... Where value is the amount of portions...

service: localtuya.set_dp
data:
  device_id: xxxx
  dp: 201
  value: 2
0xa51f commented 1 year ago

Guy, just for info, also bought an pet feeder, and I also saw a list of DP's , but the one for feeding wasn't included... Only those from 101 to ...

Then I installed fiddler , a tool to decode the https traffic on the smart life app, and I obtained finally the final list for my pet feeder, the other DP were starting from 201 to 208... They are most all sensors, like last pet feed record .. but DP 201 was in my case the one needed for feed...

I now use localtuya for the moment so I can send a feed portion ....

this worked for me for this model petfeeder, thanks @pergolafabio

pergolafabio commented 1 year ago

You are welcome :-)

Now my next goal is to figure out the wbertc feed, but I can't get the url stream trough the API explorer , not sure why

tiaanv commented 1 year ago

This is great!!! A missing piece of the puzzle! I could successfully action feeding on mine using the service call above. Now if someone could just figure out how to get the camera feed. Thx @pergolafabio

pergolafabio commented 1 year ago

Great!! Didn't find the camera feed yet, but gonna try later to tcpdump the traffic on my wifi, and I found a tool to decode the tuya stuff, fingers crossed

Shredder5262 commented 1 year ago

leaving a comment to monitor this thread as i have an 'unsupported' tuya pet feeder, I think this may help in my case as well. I have a model: DU4L-VS pet feeder with a camera. That i was able to get connected, but any sensor that displayed was essentially useless. It will be exciting to see how this progresses.

pergolafabio commented 1 year ago

Use this for getting the DP that you can use with localtuya...

https://github.com/rospogrigio/localtuya/issues/1188

jfhenriques commented 8 months ago

I've activated the DP Instruction in my petoneer Nutri vision mini Reference: https://github.com/rospogrigio/localtuya/issues/1188#issuecomment-1452499755

It seems there's an express_feed instruction that can be used, and a lot other functions.

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2024.1.6",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.11.6",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Lisbon",
    "os_name": "Linux",
    "os_version": "6.1.21-v8+",
    "run_as_root": true
  },
  "custom_components": {},
  "integration_manifest": {
    "domain": "tuya",
    "name": "Tuya",
    "codeowners": [
      "@Tuya",
      "@zlinoliver",
      "@frenck"
    ],
    "config_flow": true,
    "dependencies": [
      "ffmpeg"
    ],
    "dhcp": [
      {
        "macaddress": "****"
      }
    ],
    "documentation": "https://www.home-assistant.io/integrations/tuya",
    "integration_type": "hub",
    "iot_class": "cloud_push",
    "loggers": [
      "tuya_iot"
    ],
    "requirements": [
      "tuya-iot-py-sdk==0.6.6"
    ],
    "is_built_in": true
  },
  "data": {
    "endpoint": "https://openapi.tuyaeu.com",
    "auth_type": 0,
    "country_code": "351",
    "app_type": "tuyaSmart",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "name": "Nutri Vision Mini",
    "model": "",
    "category": "sp",
    "product_id": "gmp8ri3cbnlbdkzq",
    "product_name": "Nutri Vision Mini",
    "online": true,
    "sub": false,
    "time_zone": "+01:00",
    "active_time": "2022-06-28T19:02:18+00:00",
    "create_time": "2022-06-28T19:02:18+00:00",
    "update_time": "2024-02-05T21:17:24+00:00",
    "function": {
      "basic_indicator": {
        "type": "Boolean",
        "value": {}
      },
      "basic_flip": {
        "type": "Boolean",
        "value": {}
      },
      "motion_record": {
        "type": "Boolean",
        "value": {}
      },
      "motion_switch": {
        "type": "Boolean",
        "value": {}
      },
      "feed_num": {
        "type": "Integer",
        "value": {
          "unit": "\u4efd",
          "min": -2000,
          "max": 20,
          "scale": 0,
          "step": 1
        }
      },
      "control": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": 0,
          "max": 2147483646,
          "scale": 0,
          "step": 1
        }
      },
      "weight": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": 1,
          "max": 255,
          "scale": 0,
          "step": 1
        }
      },
      "schedule": {
        "type": "String",
        "value": {
          "maxlen": 255
        }
      },
      "feed_voice_record": {
        "type": "Enum",
        "value": {
          "range": [
            "0",
            "1",
            "2"
          ]
        }
      },
      "beep_enable": {
        "type": "Boolean",
        "value": {}
      },
      "factory_reset": {
        "type": "Boolean",
        "value": {}
      },
      "pet_schedule": {
        "type": "String",
        "value": {
          "maxlen": 255
        }
      },
      "express_feed": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": 0,
          "max": 12,
          "scale": 0,
          "step": 1
        }
      }
    },
    "status_range": {
      "basic_indicator": {
        "type": "Boolean",
        "value": {}
      },
      "basic_flip": {
        "type": "Boolean",
        "value": {}
      },
      "motion_record": {
        "type": "Boolean",
        "value": {}
      },
      "movement_detect_pic": {
        "type": "Raw",
        "value": {}
      },
      "motion_switch": {
        "type": "Boolean",
        "value": {}
      },
      "feed_num": {
        "type": "Integer",
        "value": {
          "unit": "\u4efd",
          "min": -2000,
          "max": 20,
          "scale": 0,
          "step": 1
        }
      },
      "food_weight": {
        "type": "Integer",
        "value": {
          "unit": "g",
          "min": 1,
          "max": 100,
          "scale": 1,
          "step": 1
        }
      },
      "control": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": 0,
          "max": 2147483646,
          "scale": 0,
          "step": 1
        }
      },
      "realtime_data": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": 0,
          "max": 2147483647,
          "scale": 0,
          "step": 1
        }
      },
      "weight": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": 1,
          "max": 255,
          "scale": 0,
          "step": 1
        }
      },
      "history_data": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": 0,
          "max": 2147483645,
          "scale": 0,
          "step": 1
        }
      },
      "schedule": {
        "type": "String",
        "value": {
          "maxlen": 255
        }
      },
      "feed_voice_record": {
        "type": "Enum",
        "value": {
          "range": [
            "0",
            "1",
            "2"
          ]
        }
      },
      "ipc_player_flip": {
        "type": "Enum",
        "value": {
          "range": [
            "flip_rotate_90"
          ]
        }
      },
      "beep_enable": {
        "type": "Boolean",
        "value": {}
      },
      "factory_reset": {
        "type": "Boolean",
        "value": {}
      },
      "pet_schedule": {
        "type": "String",
        "value": {
          "maxlen": 255
        }
      },
      "power_mode": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": 0,
          "max": 1,
          "scale": 0,
          "step": 1
        }
      },
      "express_feed": {
        "type": "Integer",
        "value": {
          "unit": "",
          "min": 0,
          "max": 12,
          "scale": 0,
          "step": 1
        }
      }
    },
    "status": {
      "basic_indicator": true,
      "basic_flip": false,
      "motion_record": false,
      "movement_detect_pic": "**REDACTED**",
      "motion_switch": false,
      "feed_num": 3,
      "food_weight": 10,
      "control": 0,
      "realtime_data": 16777216,
      "weight": 103,
      "history_data": 16777984,
      "schedule": "",
      "feed_voice_record": 0,
      "beep_enable": true,
      "factory_reset": false,
      "pet_schedule": "7F081E0301",
      "power_mode": 0,
      "express_feed": 0
    },
    "home_assistant": {
      "name": "Nutri Vision Mini",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "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.nutri_vision_mini",
            "state": "idle",
            "attributes": {
              "access_token": "***",
              "model_name": "Nutri Vision Mini",
              "brand": "Tuya",
              "frontend_stream_type": "hls",
              "entity_picture": "**REDACTED**",
              "friendly_name": "Nutri Vision Mini",
              "supported_features": 2
            },
            "last_changed": "2024-02-06T00:04:29.804890+00:00",
            "last_updated": "2024-02-06T00:04:29.804890+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "original_icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "light.nutri_vision_mini_indicator_light",
            "state": "on",
            "attributes": {
              "supported_color_modes": [
                "onoff"
              ],
              "color_mode": "onoff",
              "friendly_name": "Nutri Vision Mini Indicator light",
              "supported_features": 0
            },
            "last_changed": "2024-02-06T00:04:29.806228+00:00",
            "last_updated": "2024-02-06T00:04:29.806228+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.nutri_vision_mini_motion_recording",
            "state": "off",
            "attributes": {
              "icon": "mdi:record-rec",
              "friendly_name": "Nutri Vision Mini Motion recording"
            },
            "last_changed": "2024-02-06T00:04:29.812584+00:00",
            "last_updated": "2024-02-06T00:04:29.812584+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.nutri_vision_mini_flip",
            "state": "off",
            "attributes": {
              "icon": "mdi:flip-horizontal",
              "friendly_name": "Nutri Vision Mini Flip"
            },
            "last_changed": "2024-02-06T00:04:29.813121+00:00",
            "last_updated": "2024-02-06T00:04:29.813121+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "original_icon": "mdi:motion-sensor",
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.nutri_vision_mini_motion_alarm",
            "state": "off",
            "attributes": {
              "icon": "mdi:motion-sensor",
              "friendly_name": "Nutri Vision Mini Motion alarm"
            },
            "last_changed": "2024-02-06T00:04:29.813625+00:00",
            "last_updated": "2024-02-06T00:04:29.813625+00:00"
          }
        }
      ]
    }
  }
}