localtuya icon indicating copy to clipboard operation
localtuya copied to clipboard

Not able to add new entities to existing devices

Open CDaxi opened this issue 2 years ago • 23 comments

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

  • Localtuya version: 4.0.0
  • Last working localtuya version (if known and relevant):
  • Home Assistant Core version: 2022.6.6
  • [] Are you using the Home Assistant Tuya Cloud component ?
  • [x] Are you using the Tuya App in parallel ? (SmartLife)

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"
    }
  }
}

CDaxi avatar Jun 15 '22 13:06 CDaxi

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.

fiolux avatar Jun 16 '22 15:06 fiolux

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.

rjodwyer avatar Jun 18 '22 13:06 rjodwyer

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.

Ro4cHii avatar Jun 19 '22 18:06 Ro4cHii

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. ;-)

CDaxi avatar Jun 19 '22 23:06 CDaxi

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 avatar Jul 19 '22 14:07 AFumi39

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

AFumi39 avatar Aug 04 '22 16:08 AFumi39

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.

flicker581 avatar Aug 12 '22 15:08 flicker581

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

rjodwyer avatar Sep 03 '22 14:09 rjodwyer

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!

Ro4cHii avatar Sep 03 '22 15:09 Ro4cHii

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.

seanmccabe avatar Sep 13 '22 23:09 seanmccabe

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.

vinzouilleus avatar Sep 22 '22 08:09 vinzouilleus

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.

AFumi39 avatar Sep 22 '22 09:09 AFumi39

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

patrik-malina avatar Sep 22 '22 09:09 patrik-malina

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

glebsterx avatar Oct 07 '22 09:10 glebsterx

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.

janivr avatar Oct 19 '22 15:10 janivr

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.

clinta avatar Jan 03 '23 23:01 clinta

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

Avlonitis avatar Feb 25 '23 21:02 Avlonitis

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 🤨

glebsterx avatar Feb 26 '23 09:02 glebsterx

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

luke2700k avatar Mar 25 '23 03:03 luke2700k

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

jamezpolley avatar Apr 09 '23 01:04 jamezpolley

Any updates on this topic?

voicubabiciu avatar May 02 '23 09:05 voicubabiciu

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:

  • Under entities you can uncheck entities to remove them
  • Press submit without doing anything to cycle through existing entities to edit them
  • Check the "Add more...." at the very bottom, then press submit to reopen the dialog to add more entities

marvin2024a avatar Dec 30 '23 21:12 marvin2024a

* 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

qrockz avatar Jul 10 '24 12:07 qrockz