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

Genio Door/Window Sensor #63

Open sambarlick opened 3 years ago

sambarlick commented 3 years ago

Device normal info

https://www.mirabellagenio.com.au/product-range/mirabella-genio-wi-fi-door-and-window-sensor/

Device info (please complete the following information, which can be found in log): like this: { "active_time": 1618641785, "biz_type": 18, "category": "qt", "create_time": 1613889193, "icon": "smart/icon/15318135469lzeqin2vrq_0.jpg", "id": "600076082cf4322ab446", "ip": "xxxxxxxxxxxxxxxx", "lat": "30.30286857361191", "local_key": "6a51ab4bebcfd41e", "lon": "120.0639743842656", "model": "I002575", "name": "Study Window", "online": true, "owner_id": "12386163", "product_id": "3ibf4tshedrzkijl", "product_name": "Genio Door/Window Sensor", "status": [], "sub": false, "time_zone": "+10:00", "uid": "eu1589623177329OFGIL", "update_time": 1625376119, "uuid": "600076082cf4322ab446" }

No Home Assistant Logs as the device didn't come into Home Assistant.

"success": true, "t": 1625394703343 }

iSteeb commented 3 years ago

I have the same device and the same issue.

{
  "result": {
    "active_time": 1618445311,
    "biz_type": 0,
    "category": "mcs",
    "create_time": 1618445311,
    "icon": "smart/icon/ay1492157177580zScr2/813192b87d9eec3f4c3aa294abdff0a0.jpg",
    "id": "",
    "ip": "",
    "lat": "-35.15611145235048",
    "local_key": "",
    "lon": "149.1165401931699",
    "name": "Garage Door Sensor",
    "online": true,
    "owner_id": "4609908",
    "product_id": "iqoy7jgeosgbgk9i",
    "product_name": "Genio Door/Window Sensor",
    "status": [],
    "sub": false,
    "time_zone": "+10:00",
    "uid": "eu1560319739463bEUgX",
    "update_time": 1621299882,
    "uuid": "3dec91259053be56"
  },
  "success": true,
  "t": 1625446483187
}

I think our issue may not be an integration bug but either a product bug or the API itself. Notice under "status" there is no status. If we try the API call for get device status we get this:

{
  "code": 2003,
  "msg": "function not support",
  "success": false,
  "t": 1625446661361
}

I think, for some reason, this particular product doesn't allow it's status to be pulled, which may explain the failed integration... I'm not feeling confident, but perhaps the developers have some more information to assist us?

tsutsuku commented 3 years ago

@sambarlick The product id 3ibf4tshedrzkijl is standardized now, try again. @iSteeb same to iqoy7jgeosgbgk9i.

sambarlick commented 3 years ago

@sambarlick The product id 3ibf4tshedrzkijl is standardized now, try again.

Thank you, the device has now appeared in Home Assistant after a full reboot. I see the Battery Status and Open/Close entities, the tamper alarm entity didn't come through though.

However, the state for open/close is only updated with a full Reboot of Home assistant, the state doesn't update as the state in the Smart Life updates. Not sure if this is the same with the Battery entity, too early to tell.

kuchel77 commented 3 years ago

In Configuration Wizard, select Device status notification API.

Make sure you have selected this as this was what stopped me from getting it working and updating. You can go back and add to you overall thing by going Cloud-> Cloud Products and then All Products and add it to you account (you just add the trial version that runs for a year and costs nothing). You then need to authorise it for the project by going Cloud->Cloud Products and then Subscribed Products and add your Project from there.

I now have it running with the standard cloud delay.

sambarlick commented 3 years ago

In Configuration Wizard,

Where is this? In HA or Tuya Developer Portal?

select Device status notification API.

Make sure you have selected this as this was what stopped me from getting it working and updating. You can go back and add to you overall thing by going Cloud-> Cloud Products and then All Products and add it to you account (you just add the trial version that runs for a year and costs nothing). You then need to authorise it for the project by going Cloud->Cloud Products and then Subscribed Products and add your Project from there.

I now have it running with the standard cloud delay.

@tsutsuku I got this set up and the Door/Window Sensor works but the Motion Sensor still doesn't update the status. Have I missed something?

kuchel77 commented 3 years ago

That is in the Tuya Developer Portal and the line came from their instructions, but I missed this on the first setup of this project.

sambarlick commented 3 years ago

Yea I missed this too, thanks @kuchel77