Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for V330L-DU4L-VS pet feeder #2105

Merged
merged 8 commits into from
Jul 17, 2024
Merged

Conversation

e2equiel
Copy link
Contributor

Captura de Pantalla 2024-07-12 a la(s) 15 19 07

@e2equiel
Copy link
Contributor Author

Can't make work DP 115 (snapshot):

{
  "result": {
    "properties": [
      {
        "code": "movement_detect_pic",
        "custom_name": "",
        "dp_id": 115,
        "time": 1720804936027,
        "type": "raw",
        "value": "eyJ2IjoiMy4wIiwiYnVja2V0IjoidHktdXMtc3RvcmFnZTMwLXBpYyIsImZpbGVzIjpbWyIvODc4MTViLTgyMTY5MjQwLWd6ams5ZGFiN2ZlNmEwMDY3MDEyL2RldGVjdC8xNzIwODA0OTI5LmpwZWciLCIzNWUzY2NmMWYwMjAzZmM1Il1dfQ=="
      }
    ]
  },
  "success": true,
  "t": 1720809674649,
  "tid": "514e70fd407e11ef8e43562584fc0bdb"

When undecode the base64 value, it return another json and I don't know how to use it:

{"v":"3.0","bucket":"ty-us-storage30-pic","files":[["/87815b-82169240-gzjk9dab7fe6a0067012/detect/1720804929.jpeg","35e3ccf1f0203fc5"]]}

I will appreciate any help

@e2equiel
Copy link
Contributor Author

I'm not sure if this would help, but I just figured how to access via telnet to the pet feeder:

telnet xxx.xxx.xxx.xxx
ipc login: root
Password: AK2040jk

@make-all
Copy link
Owner

Arbitrary decoding of double encoded base64 image within json within base64 is not feasible, so it may be better to rename that attribute so the base64 decoded value can still be read so the image can be extracted by another more specialised integration or complex template, but it does not give any errors trying to use it as the snapshot directly.

@make-all
Copy link
Owner

Your latest change seems to have lost the record switch. I was actually meaning to make the image json an attribute of the camera entity named something else (snapshot_data would have worked), and leave the record function in there, but I guess having such a limited camera entity maybe does not make much sense. But a sensor entity for the snapshot data is not really necessary, as I don't think you would want it to show in the UI by default, so maybe keeping the record as a switch and putting the snapshot attribute on there would work.

@e2equiel
Copy link
Contributor Author

Hi @make-all, do you mean something like this?

  - entity: switch
    name: Record
    icon: "mdi:record-rec"
    category: config
    dps:
      - id: 113
        type: boolean
        optional: true
        name: record
        mapping:
          - dps_val: null
            value: false
      - id: 115
        type: base64
        name: snapshot_data
        optional: true

@make-all
Copy link
Owner

make-all commented Jul 16, 2024

yes, except your switch entity needs to have a dp named "switch" (instead of record)

@make-all make-all merged commit f6bcba8 into make-all:main Jul 17, 2024
4 checks passed
make-all added a commit that referenced this pull request Jul 18, 2024
Only differences in config were product id and name, and original used
camera entity, while new one used switch after review feedback because
the device is returning a filename in json not the image
data. Original report #2027 seems to say that one does too.

PR #2105
make-all added a commit that referenced this pull request Jul 18, 2024
PR #2105 (reverted and merged with older config for same family device)
PR #2119, #2123, #2125
timlaing pushed a commit to timlaing/tuya-local that referenced this pull request Aug 8, 2024
Only differences in config were product id and name, and original used
camera entity, while new one used switch after review feedback because
the device is returning a filename in json not the image
data. Original report make-all#2027 seems to say that one does too.

PR make-all#2105
timlaing pushed a commit to timlaing/tuya-local that referenced this pull request Aug 8, 2024
PR make-all#2105 (reverted and merged with older config for same family device)
PR make-all#2119, make-all#2123, make-all#2125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants