Duplicate zwave binary_sensors?

I recently upgraded to 0.60 and started having issues with some of my zwave automations that rely on door sensors. I started to troubleshoot and noticed something peculiar. There are duplicate entries for some but not all of my zwave devices. The duplicates found are only for devices that have binary sensors, example:

A list of duplicated binary sensors:

❩#─► curl -s -X GET -H 'Content-Type: application/json' http://localhost:8123/api/states | jq '.[]|{entity_id}' | grep -E 'zwave|binary_sensor' | grep -B2 _2
  "entity_id": "zwave.kitchen_glassdoor"
  "entity_id": "binary_sensor.kitchen_glassdoor_sensor"
  "entity_id": "binary_sensor.kitchen_glassdoor_sensor_2"
--
  "entity_id": "zwave.garage_back_door"
  "entity_id": "binary_sensor.garage_back_door_sensor"
  "entity_id": "binary_sensor.garage_back_door_sensor_2"
--
  "entity_id": "zwave.master_bed_door"
  "entity_id": "binary_sensor.master_bed_door_sensor"
  "entity_id": "binary_sensor.master_bed_door_sensor_2"
  "entity_id": "zwave.garage_laundry_door"
  "entity_id": "binary_sensor.garage_laundry_door_sensor"
  "entity_id": "binary_sensor.garage_laundry_door_sensor_2"
  "entity_id": "zwave.front_door"
  "entity_id": "binary_sensor.front_door_sensor"
  "entity_id": "binary_sensor.front_door_sensor_2"
  "entity_id": "zwave.master_bed_glassdoor"
  "entity_id": "binary_sensor.master_bed_glassdoor_sensor"
  "entity_id": "binary_sensor.master_bed_glassdoor_sensor_2"

More information for one of the sensors:

❩#─► curl -s -X GET -H 'Content-Type: application/json' http://localhost:8123/api/states | jq '.[]|select(.entity_id|contains("binary_sensor.front_door"))'
{
  "attributes": {
    "friendly_name": "Front Door Sensor",
    "new_entity_id": "binary_sensor.front_door_sensor",
    "node_id": 26,
    "old_entity_id": "binary_sensor.front_door_sensor_26_0",
    "value_id": "72057594479116288",
    "value_index": 0,
    "value_instance": 1
  },
  "entity_id": "binary_sensor.front_door_sensor",
  "last_changed": "2017-12-26T13:14:07.070106+00:00",
  "last_updated": "2017-12-26T13:14:07.070106+00:00",
  "state": "off"
}
{
  "attributes": {
    "friendly_name": "Front Door Sensor",
    "new_entity_id": "binary_sensor.front_door_sensor",
    "node_id": 26,
    "old_entity_id": "binary_sensor.front_door_sensor_26_0_2",
    "value_id": "144115188517044224",
    "value_index": 0,
    "value_instance": 2
  },
  "entity_id": "binary_sensor.front_door_sensor_2",
  "last_changed": "2017-12-26T13:14:07.099699+00:00",
  "last_updated": "2017-12-26T13:14:07.099699+00:00",
  "state": "off"
}

And the corresponding zwave entity that is not duplicated:

❩#─► curl -s -X GET -H 'Content-Type: application/json' http://localhost:8123/api/states | jq '.[]|select(.entity_id|contains("zwave.front_door"))'
{
  "attributes": {
    "averageRequestRTT": 0,
    "averageResponseRTT": 0,
    "battery_level": 88,
    "capabilities": [
      "beaming",
      "routing"
    ],
    "friendly_name": "Front Door",
    "is_awake": false,
    "is_failed": false,
    "is_info_received": true,
    "is_ready": false,
    "is_zwave_plus": false,
    "lastRequestRTT": 0,
    "lastResponseRTT": 0,
    "manufacturer_name": "FIBARO System",
    "max_baud_rate": 40000,
    "new_entity_id": "zwave.front_door",
    "node_id": 26,
    "node_name": "Front Door",
    "old_entity_id": "zwave.front_door_26",
    "product_name": "FGK10x Door Opening Sensor",
    "query_stage": "CacheLoad",
    "receivedCnt": 5,
    "receivedDups": 0,
    "receivedTS": "2017-12-26 08:57:08:191 ",
    "receivedUnsolicited": 5,
    "retries": 0,
    "sentCnt": 1,
    "sentFailed": 1,
    "sentTS": "2017-12-26 07:14:47:451 ",
    "wake_up_interval": 16777215
  },
  "entity_id": "zwave.front_door",
  "last_changed": "2017-12-26T13:14:07.226781+00:00",
  "last_updated": "2017-12-26T14:57:08.307467+00:00",
  "state": "initializing"
}

I don’t know if this is what’s causing my issues with the automations I’m having trouble with or when this started happening as I’ve not had many issues until recently after upgrading and adding a couple of new zwave nodes. I would be more than grateful if anyone has any information or tips about what’s going on or what else to check.

Did you get this resolved ? Same problem here, just one device, but sensor and switch nodes are affected. For some of these I see a second entity in HA with the attribute value_instance=“2”.

Lars

I did, but I resolved it by restoring the openzwave zwcfg_*.xml file from a previous backup (which I absolutely make sure I do now before every upgrade)

Probably not the answer you wanted to hear :frowning:

Thanks. Zwcfg_*.cfg is auto-generated anyway. I‘ll see if I can get rid of the unwanted nodes by editing the xml directly.

Lars