Thanks Stefan,
TL;DR: I was actually creating the same entity name in 2 places.
In my /config/.storage/core.entity_registry I see only the new entities (with entity_id has a _2 suffix), but not the other entries.
{
"aliases": [],
"area_id": null,
"capabilities": null,
"config_entry_id": "cbf83fc72f1d75101383cb5411318600",
"device_class": null,
"device_id": "7efcf2c32fdd50b5a981310fd7c1fcc8",
"disabled_by": null,
"entity_category": null,
"entity_id": "sensor.pc191ha_107_voltage_2",
"hidden_by": null,
"icon": null,
"id": "2bf39d2f06251d05adc8bb99afb86b1c",
"has_entity_name": false,
"name": null,
"options": {},
"original_device_class": "voltage",
"original_icon": null,
"original_name": "pc191ha-107_voltage",
"platform": "localtuya",
"supported_features": 0,
"translation_key": null,
"unique_id": "local_7lmHRoyxlLzIeXTRCFo8_20",
"unit_of_measurement": "V"
},
{
"aliases": [],
"area_id": null,
"capabilities": {
"options": [
"on",
"off",
"memory"
]
},
Are you perhaps thinking of the “deleted_devices” section in core.device_registry ?
DOH !!! bangs head !
I can’t delete the entities, because they are created in configuration.yaml ! I followed the instructions in LocalTuya integration documentation for creating sensors from the attributes returned by the switch, like so …
#
pc191ha_107_voltage:
value_template: >-
{{ float(state_attr('switch.pc191ha_107', 'voltage') | default(0, true)) }}
unit_of_measurement: 'V'
pc191ha_107_current:
value_template: >-
{{ float(state_attr('switch.pc191ha_107', 'current') | default(0, true)) }}
unit_of_measurement: 'mA'
pc191ha_107_current_consumption:
value_template: >-
{{ float(state_attr('switch.pc191ha_107', 'current_consumption') | default(0, true)) / 1000 | round(1) }}
unit_of_measurement: 'W'
For a while i was also adding number entities for current, voltage when adding the device in the LocalTuya integration.
And I just discovered that the localTuya Integration now allows adding “sensor” entities when creating the device … so guess what I was trying (without commenting out the section in configuration.yaml).