make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.4k stars 535 forks source link

Cannot successfully reload when using constraints and mapping in select entity #968

Closed blakadder closed 1 year ago

blakadder commented 1 year ago

Describe the bug Cannot reload integration for device without errors when using constraints and mapping. Error message:

2023-08-07 19:11:04.415 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry M9 Robot Vacuum for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 112, in async_setup_entry
    return await component.async_setup_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 187, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

Device config snippet responsible:

  - entity: select
    name: Water setting
    icon: "mdi:water"
    dps:
      - id: 10
        name: option
        type: string
        mapping:
          - constraint: mopstate
            conditions:
              - dps_val: installed
                mapping:
                  - dps_val: closed
                    value: "Off"
                  - dps_val: low
                    value: Low
                  - dps_val: middle
                    value: Middle
                  - dps_val: high
                    value: High
              - dps_val: none
                mapping:
                  - dps_val: closed
                    value: "Off"

If the bug involves a device, then please include device diagnostics from Settings / Devices & Services / Tuya Local (your device) / "1 device"

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2023.9.0.dev20230806",
    "dev": true,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.11.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Vienna",
    "os_name": "Linux",
    "os_version": "4.9.0-19-amd64",
    "run_as_root": true
  },
  "custom_components": {
    "xiaomi_miio_cooker": {
      "version": "2022.3.3.0",
      "requirements": [
        "construct==2.10.56",
        "git+https://github.com/sschirr/python-miio.git@dev_version#python-miio==0.5.11+sschirrdev"
      ]
    },
    "toiletlid": {
      "version": "1.1.1",
      "requirements": []
    },
    "petkit": {
      "version": "0.1.0",
      "requirements": []
    },
    "xiaomi_cloud_map_extractor": {
      "version": "v2.2.0",
      "requirements": [
        "pillow",
        "pybase64",
        "python-miio",
        "requests",
        "pycryptodome"
      ]
    },
    "bodymiscale": {
      "version": "3.0.8",
      "requirements": [
        "cachetools==5.3.0"
      ]
    },
    "electrolux_status": {
      "version": "1.2.0",
      "requirements": [
        "pyelectroluxconnect==0.3.19"
      ]
    },
    "moonraker": {
      "version": "0.9.2",
      "requirements": [
        "moonraker-api==2.0.5"
      ]
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "catlink": {
      "version": "0.0.1",
      "requirements": []
    },
    "tuya_local": {
      "version": "2023.8.0",
      "requirements": [
        "pycryptodome~=3.18",
        "tinytuya==1.12.9"
      ]
    },
    "xjx_toilet_pro": {
      "version": "2022.3.1",
      "requirements": [
        "python-miio>=0.5.11"
      ]
    },
    "binance": {
      "version": "0.1.0",
      "requirements": []
    },
    "xiaomi_miot": {
      "version": "0.7.10",
      "requirements": [
        "construct==2.10.56",
        "python-miio>=0.5.6",
        "micloud>=0.3"
      ]
    },
    "cololight": {
      "version": "v2.0.2",
      "requirements": [
        "pycololight==2.1.0"
      ]
    },
    "sonoff": {
      "version": "3.5.2",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    }
  },
  "integration_manifest": {
    "domain": "tuya_local",
    "name": "Tuya Local",
    "codeowners": [
      "@make-all"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/make-all/tuya-local",
    "integration_type": "device",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/make-all/tuya-local/issues",
    "requirements": [
      "pycryptodome~=3.18",
      "tinytuya==1.12.9"
    ],
    "version": "2023.8.0",
    "is_built_in": false
  },
  "data": {
    "name": "M9 Robot Vacuum",
    "type": "proscenic_m9_vacuum",
    "device_id": "**REDACTED**",
    "device_cid": "",
    "local_key": "**REDACTED**",
    "host": "**REDACTED**",
    "protocol_version": 3.3,
    "tinytuya_version": "1.12.9",
    "api_version_set": 3.3,
    "api_version_used": 3.3,
    "api_working": true,
    "status": {},
    "cached_state": {
      "updated_at": 1691428511.4746826,
      "1": false,
      "2": false,
      "4": "goto_charge",
      "5": "charge_done",
      "6": 48,
      "7": 55,
      "8": 100,
      "9": "normal",
      "10": "closed",
      "11": true,
      "17": 11202,
      "19": 17242,
      "21": 8242,
      "23": 9000,
      "25": false,
      "26": 0,
      "27": true,
      "28": 0,
      "29": 765,
      "30": 46,
      "31": 728,
      "37": 1,
      "38": false,
      "39": false,
      "40": "none",
      "41": "only_sweep",
      "130": true,
      "131": true,
      "132": "dustbin",
      "133": "rotate_tank",
      "134": "normal",
      "135": "closed",
      "137": true,
      "138": true,
      "139": 1002,
      "198": 0,
      "199": 0
    },
    "pending_state": {},
    "connected": true,
    "force_dps": [],
    "home_assistant": {
      "name": "M9 Robot Vacuum",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "number.m9_robot_vacuum_volume",
            "state": "0",
            "attributes": {
              "min": 0,
              "max": 100,
              "step": 1.0,
              "mode": "auto",
              "icon": "mdi:volume-high",
              "friendly_name": "M9 Robot Vacuum Volume"
            },
            "last_changed": "2023-08-07T17:11:04.650059+00:00",
            "last_updated": "2023-08-07T17:11:04.650059+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": "switch",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.m9_robot_vacuum_led_lights",
            "state": "on",
            "attributes": {
              "device_class": "switch",
              "icon": "mdi:car-parking-lights",
              "friendly_name": "M9 Robot Vacuum LED lights"
            },
            "last_changed": "2023-08-07T17:11:04.658205+00:00",
            "last_updated": "2023-08-07T17:11:04.658205+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": "switch",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.m9_robot_vacuum_mute_sound",
            "state": "on",
            "attributes": {
              "device_class": "switch",
              "icon": "mdi:volume-mute",
              "friendly_name": "M9 Robot Vacuum Mute sound"
            },
            "last_changed": "2023-08-07T17:11:04.658404+00:00",
            "last_updated": "2023-08-07T17:11:04.658404+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "vacuum.m9_robot_vacuum",
            "state": "docked",
            "attributes": {
              "fan_speed_list": [
                "Off",
                "Gentle",
                "Normal",
                "Strong"
              ],
              "fan_speed": "Normal",
              "activate": false,
              "pause": false,
              "command": "return_to_base",
              "status": "charged",
              "locate": true,
              "error": 0,
              "chaging_base_type": "dustbin",
              "water_tank_type": "rotate_tank",
              "realtime_fanspeed": "normal",
              "realtime_water_level": "closed",
              "cloud_map": true,
              "friendly_name": "M9 Robot Vacuum",
              "supported_features": 14260
            },
            "last_changed": "2023-08-07T17:11:04.653584+00:00",
            "last_updated": "2023-08-07T17:11:04.653584+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "duration",
          "icon": null,
          "unit_of_measurement": "min",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_cleaning_time",
            "state": "48",
            "attributes": {
              "unit_of_measurement": "min",
              "device_class": "duration",
              "icon": "mdi:timer-star",
              "friendly_name": "M9 Robot Vacuum Cleaning time"
            },
            "last_changed": "2023-08-07T17:11:04.659887+00:00",
            "last_updated": "2023-08-07T17:11:04.659887+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": "m\u00b2",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_cleaned_area",
            "state": "55",
            "attributes": {
              "unit_of_measurement": "m\u00b2",
              "icon": "mdi:vector-square-close",
              "friendly_name": "M9 Robot Vacuum Cleaned area"
            },
            "last_changed": "2023-08-07T17:11:04.660401+00:00",
            "last_updated": "2023-08-07T17:11:04.660401+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "duration",
          "icon": null,
          "unit_of_measurement": "min",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_side_brush_life",
            "state": "11202",
            "attributes": {
              "unit_of_measurement": "min",
              "device_class": "duration",
              "icon": "mdi:timer-sand",
              "friendly_name": "M9 Robot Vacuum Side brush life"
            },
            "last_changed": "2023-08-07T17:11:04.661377+00:00",
            "last_updated": "2023-08-07T17:11:04.661377+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "duration",
          "icon": null,
          "unit_of_measurement": "min",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_main_brush_life",
            "state": "17242",
            "attributes": {
              "unit_of_measurement": "min",
              "device_class": "duration",
              "icon": "mdi:timer-sand",
              "friendly_name": "M9 Robot Vacuum Main brush life"
            },
            "last_changed": "2023-08-07T17:11:04.661918+00:00",
            "last_updated": "2023-08-07T17:11:04.661918+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "duration",
          "icon": null,
          "unit_of_measurement": "min",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_filter_life",
            "state": "8242",
            "attributes": {
              "unit_of_measurement": "min",
              "device_class": "duration",
              "icon": "mdi:timer-sand",
              "friendly_name": "M9 Robot Vacuum Filter life"
            },
            "last_changed": "2023-08-07T17:11:04.666717+00:00",
            "last_updated": "2023-08-07T17:11:04.666717+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": "m\u00b2",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_total_cleaned_area",
            "state": "765",
            "attributes": {
              "unit_of_measurement": "m\u00b2",
              "icon": "mdi:archive-marker-outline",
              "friendly_name": "M9 Robot Vacuum Total cleaned area"
            },
            "last_changed": "2023-08-07T17:11:04.667816+00:00",
            "last_updated": "2023-08-07T17:11:04.667816+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_total_clean_count",
            "state": "46",
            "attributes": {
              "icon": "mdi:counter",
              "friendly_name": "M9 Robot Vacuum Total clean count"
            },
            "last_changed": "2023-08-07T17:11:04.668297+00:00",
            "last_updated": "2023-08-07T17:11:04.668297+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "duration",
          "icon": null,
          "unit_of_measurement": "min",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_total_clean_time",
            "state": "728",
            "attributes": {
              "unit_of_measurement": "min",
              "device_class": "duration",
              "icon": "mdi:archive-clock-outline",
              "friendly_name": "M9 Robot Vacuum Total clean time"
            },
            "last_changed": "2023-08-07T17:11:04.668802+00:00",
            "last_updated": "2023-08-07T17:11:04.668802+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "duration",
          "icon": null,
          "unit_of_measurement": "min",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_sensor_life",
            "state": "1002",
            "attributes": {
              "unit_of_measurement": "min",
              "device_class": "duration",
              "icon": "mdi:eye-circle-outline",
              "friendly_name": "M9 Robot Vacuum Sensor life"
            },
            "last_changed": "2023-08-07T17:11:04.669367+00:00",
            "last_updated": "2023-08-07T17:11:04.669367+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_event_message",
            "state": "0",
            "attributes": {
              "icon": "mdi:eye-circle-outline",
              "friendly_name": "M9 Robot Vacuum Event message"
            },
            "last_changed": "2023-08-07T17:11:04.669834+00:00",
            "last_updated": "2023-08-07T17:11:04.669834+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_error_message",
            "state": "0",
            "attributes": {
              "icon": "mdi:eye-circle-outline",
              "friendly_name": "M9 Robot Vacuum Error message"
            },
            "last_changed": "2023-08-07T17:11:04.670304+00:00",
            "last_updated": "2023-08-07T17:11:04.670304+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.m9_robot_vacuum_working_mode",
            "state": "unavailable",
            "attributes": {
              "restored": true,
              "options": [
                "Vacuum and mop",
                "Vacuum only",
                "Mopping only"
              ],
              "icon": "mdi:broom",
              "friendly_name": "Working mode",
              "supported_features": 0
            },
            "last_changed": "2023-08-07T17:03:03.017602+00:00",
            "last_updated": "2023-08-07T17:03:03.017602+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "button.m9_robot_vacuum_side_brush_reset",
            "state": "unknown",
            "attributes": {
              "icon": "mdi:autorenew",
              "friendly_name": "M9 Robot Vacuum Side brush reset"
            },
            "last_changed": "2023-08-07T17:11:04.653901+00:00",
            "last_updated": "2023-08-07T17:11:04.653901+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "button.m9_robot_vacuum_main_brush_reset",
            "state": "unknown",
            "attributes": {
              "icon": "mdi:autorenew",
              "friendly_name": "M9 Robot Vacuum Main brush reset"
            },
            "last_changed": "2023-08-07T17:11:04.654047+00:00",
            "last_updated": "2023-08-07T17:11:04.654047+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "button.m9_robot_vacuum_sensor_reset",
            "state": "unknown",
            "attributes": {
              "icon": "mdi:autorenew",
              "friendly_name": "M9 Robot Vacuum Sensor reset"
            },
            "last_changed": "2023-08-07T17:11:04.657424+00:00",
            "last_updated": "2023-08-07T17:11:04.657424+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "duration",
          "icon": null,
          "unit_of_measurement": "min",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_mop_life",
            "state": "9000",
            "attributes": {
              "unit_of_measurement": "min",
              "device_class": "duration",
              "icon": "mdi:timer-sand",
              "friendly_name": "M9 Robot Vacuum Mop life"
            },
            "last_changed": "2023-08-07T17:11:04.667315+00:00",
            "last_updated": "2023-08-07T17:11:04.667315+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": "switch",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.m9_robot_vacuum_resume_cleaning_option",
            "state": "on",
            "attributes": {
              "device_class": "switch",
              "icon": "mdi:replay",
              "friendly_name": "M9 Robot Vacuum Resume cleaning option"
            },
            "last_changed": "2023-08-07T17:11:04.657742+00:00",
            "last_updated": "2023-08-07T17:11:04.657742+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "button.m9_robot_vacuum_filter_reset",
            "state": "unknown",
            "attributes": {
              "icon": "mdi:autorenew",
              "friendly_name": "M9 Robot Vacuum Filter reset"
            },
            "last_changed": "2023-08-07T17:11:04.654185+00:00",
            "last_updated": "2023-08-07T17:11:04.654185+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "button.m9_robot_vacuum_mop_reset",
            "state": "unknown",
            "attributes": {
              "icon": "mdi:autorenew",
              "friendly_name": "M9 Robot Vacuum Mop reset"
            },
            "last_changed": "2023-08-07T17:11:04.654324+00:00",
            "last_updated": "2023-08-07T17:11:04.654324+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.m9_robot_vacuum_dust_collection_frequency",
            "state": "unavailable",
            "attributes": {
              "restored": true,
              "options": [
                "Never",
                "After each clean",
                "After 2 cleans",
                "After 3 cleans"
              ],
              "icon": "mdi:numeric-1",
              "friendly_name": "Dust collection frequency",
              "supported_features": 0
            },
            "last_changed": "2023-08-07T17:03:03.018108+00:00",
            "last_updated": "2023-08-07T17:03:03.018108+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "binary_sensor.m9_robot_vacuum_mop_installed",
            "state": "off",
            "attributes": {
              "icon": "mdi:connection",
              "friendly_name": "M9 Robot Vacuum Mop installed"
            },
            "last_changed": "2023-08-07T17:11:04.659239+00:00",
            "last_updated": "2023-08-07T17:11:04.659239+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "switch",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.m9_robot_vacuum_mop_rotation",
            "state": "on",
            "attributes": {
              "device_class": "switch",
              "icon": "mdi:rotate-360",
              "friendly_name": "M9 Robot Vacuum Mop rotation"
            },
            "last_changed": "2023-08-07T17:11:04.658606+00:00",
            "last_updated": "2023-08-07T17:11:04.658606+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "button.m9_robot_vacuum_empty_dustbin",
            "state": "2023-07-22T15:25:53.013803+00:00",
            "attributes": {
              "icon": "mdi:delete-restore",
              "friendly_name": "M9 Robot Vacuum Empty dustbin"
            },
            "last_changed": "2023-08-07T17:11:04.654484+00:00",
            "last_updated": "2023-08-07T17:11:04.654484+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.m9_robot_vacuum_water_setting",
            "state": "unavailable",
            "attributes": {
              "restored": true,
              "options": [
                "Off"
              ],
              "icon": "mdi:water",
              "friendly_name": "Water setting",
              "supported_features": 0
            },
            "last_changed": "2023-08-07T17:03:03.018367+00:00",
            "last_updated": "2023-08-07T17:03:03.018367+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": "switch",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.m9_robot_vacuum_customize_mode",
            "state": "off",
            "attributes": {
              "device_class": "switch",
              "icon": "mdi:store-cog",
              "friendly_name": "M9 Robot Vacuum Customize mode"
            },
            "last_changed": "2023-08-07T17:11:04.657999+00:00",
            "last_updated": "2023-08-07T17:11:04.657999+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "battery",
          "icon": null,
          "unit_of_measurement": "%",
          "state": {
            "entity_id": "sensor.m9_robot_vacuum_battery",
            "state": "100",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "%",
              "device_class": "battery",
              "friendly_name": "M9 Robot Vacuum Battery"
            },
            "last_changed": "2023-08-07T17:11:04.660803+00:00",
            "last_updated": "2023-08-07T17:11:04.660803+00:00"
          }
        }
      ]
    }
  }
}
make-all commented 1 year ago

I don't think this is related to constraints or anything else in the config, it is that the device communication takes some time to disconnect, and the reload is not waiting for it due to the connection being handled on a worker thread. A similar issue exists when trying to reconfigure devices, and nothing I have tried so far to resolve it seems to work.

blakadder commented 1 year ago

Yes I've noticed the same today. To me it keeps happening on select entities

make-all commented 1 year ago

The underlying cause for this may have been #1110, which is fixed in 2023.9.1