home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.48k stars 29.41k forks source link

overlapping node ids - ozw.scene_activated event does not supply openzwave instance id or entity_id #43828

Closed m3ki closed 3 years ago

m3ki commented 3 years ago

The problem

When ozw.scene_activated event is fired I have no way of knowing which light switch in my setup triggers the central scene due to the fact that I have multiple instances of openzwave across the house.

Environment

Version | 0.118.4 Installation Type | Home Assistant Supervised Development | false Supervisor | true Docker | true Virtual Environment | false Python Version | 3.8.6 Operating System Family | Linux Operating System Version | 4.19.0-12-amd64 CPU Architecture | x86_64 Timezone | America/Chicago


6 Raspberry pis running OZWDaemon 0.1.176 (OpenZWave 1.6.1392) 100s+ light switches with 20 or so in each instance = overlapping node_ids since these are on different networks.

Press scene on one device located in instance one

Traceback/Error logs

{
    "event_type": "ozw.scene_activated",
    "data": {
        "node_id": 2,
        "scene_id": 2,
        "scene_label": "Scene 2",
        "scene_value_id": 1,
        "scene_value_label": "Pressed 1 Time"
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-01T20:03:50.101897+00:00",
    "context": {
        "id": "1120c23404618f7093159e1bba5bb65e",
        "parent_id": null,
        "user_id": null
    }
}

Switch pressed on another instance of ozw

{
    "event_type": "ozw.scene_activated",
    "data": {
        "node_id": 2,
        "scene_id": 2,
        "scene_label": "Scene 2",
        "scene_value_id": 4,
        "scene_value_label": "Pressed 2 Times"
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-01T20:01:59.402901+00:00",
    "context": {
        "id": "3549f929cdf17d4e4be2adf66600acb4",
        "parent_id": null,
        "user_id": null
    }
}

Additional information

firstof9 commented 3 years ago

The new instance_id added to the event data should resolve this for you with the linked PR.