rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.84k stars 545 forks source link

Not able to add new entities to existing devices #875

Open CDaxi opened 2 years ago

CDaxi commented 2 years ago

The problem

I have existing devices in the configuration. Editing and removing of entities is possible, but not adding new entities like at creating the device.

Environment

Steps to reproduce

  1. Edit an existing device
  2. You can change the device setting and existing entities
  3. There is no option on the end of the flow to add new entities.

Configuration configuration.yaml or config_flow

No configuration yaml, I have removed it after update to 4.0.0

Device diagnose information

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.6.6",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.12",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "5.15.45",
    "supervisor": "2022.05.3",
    "host_os": "Home Assistant OS 8.2",
    "docker_version": "20.10.14",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.25.5",
      "requirements": [
        "aiogithubapi>=22.2.4"
      ]
    },
    "nodered": {
      "version": "1.0.8",
      "requirements": []
    },
    "waste_collection_schedule": {
      "version": "1.21.0",
      "requirements": [
        "icalendar",
        "recurring_ical_events",
        "icalevents",
        "bs4"
      ]
    },
    "omada": {
      "version": "0.2.2",
      "requirements": []
    },
    "linkplay": {
      "version": "3.1.8",
      "requirements": [
        "async-upnp-client>=0.27",
        "validators~=0.12",
        "chardet>=4.0.0"
      ]
    },
    "localtuya": {
      "version": "4.0.0",
      "requirements": []
    },
    "ical": {
      "version": "1.3",
      "requirements": [
        "icalendar==4.0.7"
      ]
    },
    "browser_mod": {
      "version": "1.5.3",
      "requirements": []
    },
    "reversotts": {
      "version": "1.0.2",
      "requirements": [
        "pyttsreverso==0.4"
      ]
    }
  },
  "integration_manifest": {
    "domain": "localtuya",
    "name": "LocalTuya integration",
    "version": "4.0.0",
    "documentation": "https://github.com/rospogrigio/localtuya/",
    "dependencies": [],
    "codeowners": [
      "@rospogrigio",
      "@postlund"
    ],
    "issue_tracker": "https://github.com/rospogrigio/localtuya/issues",
    "requirements": [],
    "config_flow": true,
    "iot_class": "local_push",
    "is_built_in": false
  },
  "data": {
    "device_config": {
      "friendly_name": "WC Diffuser",
      "host": "XXXXXXX",
      "local_key": "XXXXXXX",
      "protocol_version": "3.3",
      "entities": [
        {
          "friendly_name": "WC Diffuser",
          "id": 1,
          "platform": "switch"
        },
        {
          "friendly_name": "WC Diffuser Licht",
          "id": 11,
          "platform": "switch"
        },
        {
          "friendly_name": "WC Diffuser Fehler",
          "state_on": "1",
          "state_off": "0",
          "device_class": "problem",
          "id": 12,
          "platform": "binary_sensor"
        }
      ],
      "model": "Smart Aroma Diffuser--Wi-Fi\u3001BLE",
      "device_id": "XXXXX",
      "dps_strings": [
        "1 (value: False)",
        "11 (value: False)",
        "12 (value: 0)",
        "13 (value: 0)",
        "14 (value: 0)",
        "103 (value: off)",
        "108 (value: )",
        "109 (value: white)",
        "110 (value: 1)",
        "111 (value: 255)"
      ]
    },
    "device_cloud_info": {
      "active_time": 1653542122,
      "biz_type": 18,
      "category": "jsq",
      "create_time": 1653512457,
      "icon": "smart/icon/ay1496289297888GkNKB/e37dc3d5bed7147b344e6eda5073f40e.jpg",
      "id": "XXXXXX",
      "ip": "XXXXX",
      "lat": "XXXXX",
      "local_key": "XXXXX",
      "lon": "XXXXX",
      "model": "DT-1522-X",
      "name": "WC Diffuser",
      "online": true,
      "owner_id": "XXXXX",
      "product_id": "XXXXX",
      "product_name": "Smart Aroma Diffuser--Wi-Fi\u3001BLE",
      "status": [
        {
          "code": "switch",
          "value": false
        },
        {
          "code": "switch_led",
          "value": true
        }
      ],
      "sub": false,
      "time_zone": "+02:00",
      "uid": "XXXXX",
      "update_time": 1654099553,
      "uuid": "d21cdefe216bfdc8"
    }
  }
}
fiolux commented 2 years ago

I have the same issue: Trying to add new entities to an existing device. If this is a not an issue just us not knowing how to, please explain the process. Thanks.

rjodwyer commented 2 years ago

Also hit the same issue when removing a DP and then wanting to add it back with different options.

No way to add a DP after the device is added in v4.

Also appears to be no way to delete the device so that you may add it back in with new DP settings.

Ro4cHii commented 2 years ago

Also hit the same issue when removing a DP and then wanting to add it back with different options.

No way to add a DP after the device is added in v4.

Also appears to be no way to delete the device so that you may add it back in with new DP settings.

I am unsure if we mean the same but once a DP has been usued for configuration, it cannot be used again. Back when configuration was done via YAML, I had a binary sensor AND a switch for one DP. Now, this is not possible anymore.

CDaxi commented 2 years ago

I am unsure if we mean the same but once a DP has been usued for configuration, it cannot be used again. Back when configuration was done via YAML, I had a binary sensor AND a switch for one DP. Now, this is not possible anymore.

No, it‘s a different topic. But to be honest, I don‘t know why a switch an binary sensor with the same value is needed. A switch is more or less the same but with interaction.

If you will need a binary sensor with the inverted logic, you can change the compares or add a binary sensor temple. ;-)

AFumi39 commented 2 years ago

I've the same problem. I need to add a entity, but it's not possible anymore (it was possible in versions <4). Please this is a fundamental feature

AFumi39 commented 2 years ago

Why no response? It's unusable if you can't add entities to devices, nor delete devices and add again. You have to completely remove the integration ad add it again, but it's impossible with more than 15 devices (you have to configure correctly any device at first try, or you have to delete integration again).

Please

flicker581 commented 2 years ago

I am able to delete and recreate a device (there is a button "Remove device" in device's page). But still unable to add additional entity to the existing device. LocalTuya 4.0.1.

rjodwyer commented 2 years ago

Given this is getting no attention through a couple of updates now are we doing something wrong here?

Ro4cHii commented 2 years ago

Just the other day, I bought four more smart sockets and tried to integrate them (six in total) into Home Assistant. It was literally a pain in the ass 😞

For me it was even worse; I did a slip mistake on the fifth one and misconfigured one DP. There was no way to correct it. Even removing the whole device and readding it was not solving my problem. I had to even remove the whole integration, restart HA and then do another attempt.

Having a reliable means to delete and edit devices would be such a huge gain!

seanmccabe commented 1 year ago

This too, I have a Kettle I've since discovered the additional DPS for and would like to add, but to do so, need to fully remove and re-add, which I can't do as I always get the unknown DPS index 1 when trying as the yaml config no longer apparently works.

vinzouilleus commented 1 year ago

I am able to delete and recreate a device (there is a button "Remove device" in device's page). But still unable to add additional entity to the existing device. LocalTuya 4.0.1.

Agree. Although the option is a little hidden it does solve the main issue for me, since I can remove and re-add. Not as easy as adding a new entity only, but at least a workaround that works.

AFumi39 commented 1 year ago

Agree. Although the option is a little hidden it does solve the main issue for me, since I can remove and re-add. Not as easy as adding a new entity only, but at least a workaround that works.

I will try it again, but the last time, delete device from the "remove" button didn't work (you have to remove the Local Tuya integration and add it again (and remap ALL the devices). Still I don't understand why they ignore us and don't even reply to this tread.

patrik-malina commented 1 year ago

You need to delete device and eventually reboot hass. No need to delete whole integration

glebsterx commented 1 year ago

I have the same issue. Trying to аdd a device duplicate manually ruins the whole integration config. Thanks god I have a backup

janivr commented 1 year ago

I have the same issue. I have a device with 8 DPs. I'd like to add a new one. I don't want to delete and add all 8 again.

clinta commented 1 year ago

This is so incredibly frustrating. Get 20 DPs added and forget to untick that "do not add any more entities" box and have fun starting over.

Especially fun now that yaml configs aren't supported anymore. I could be done already if I could have just pasted the config for the device I want.

Avlonitis commented 1 year ago

The easiest way is to use .storage/core.config_entries file in order to add or edit the DPs

glebsterx commented 1 year ago

The easiest way is to use .storage/core.config_entries file in order to add or edit the DPs

This is not the easiest way 🙃

especially considering that we have been deprived of the ability to configure via yaml 🤨

luke2700k commented 1 year ago

Any updates on this? Its been ages.....

jamezpolley commented 1 year ago

9 months later, still an issue, still annoying, still no response from devs.

voicubabiciu commented 1 year ago

Any updates on this topic?

marvin2024a commented 8 months ago

Theres a solution now: Go to the LocalTuya Integration Click Configure -> Edit Device Select the device you want to edit

Now you have 3 Options:

qrockz commented 2 months ago
* Check the "Add more...." at the very bottom, then press submit to reopen the  dialog to add more entities

I can add entities this way you have described. veg1

But home assistant/devices does only show 1 entity for a device. veg2