Xiaomi switch raspbee deconz issue

Hi,
I try to configure some xiaomi switch. I use raspberry with raspbee card. I add the switch with the phoscon app. Then i put this in the configuration file:

logger:
  default: info
  logs:
    pydeconz: debug
    homeassistant.components.deconz: debug

to find the signal from the switch.
Then I create this automation:

- alias: 'bottone luce 1'
  trigger:
      platform: event
      event_type: deconz_event
      event_data:
        entity_id: Switch_32
        event: 1002
  action:
      service: light.toggle
      data: 
        entity_id: light.studio_2

the problem is that the light toggle also when I press another switch. Any idea to solv the problem? Here the log. Thank you

2019-01-30 20:48:19 DEBUG (MainThread) [pydeconz.deconzdevice] Switch 33: update lastupdated with 2019-01-30T19:48:19
2019-01-30 20:48:19 DEBUG (MainThread) [pydeconz.deconzdevice] Switch 33: update buttonevent with 1002
2019-01-30 20:48:19 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {“e”:“changed”,“id”:“33”,“r”:“sensors”,“state”:{“buttonevent”:1002,“lastupdated”:“2019-01-30T19:48:19”},“t”:“event”,“uniqueid”:“00:15:8d:00:02:13:6a:72-01-0006”}
2019-01-30 20:48:19 INFO (MainThread) [homeassistant.components.automation] Executing bottone luce 1
2019-01-30 20:48:19 INFO (MainThread) [homeassistant.helpers.script] Script bottone luce 1: Running script
2019-01-30 20:48:19 INFO (MainThread) [homeassistant.helpers.script] Script bottone luce 1: Executing step call service
2019-01-30 20:48:19 DEBUG (MainThread) [pydeconz.utils] Sending {‘data’: ‘{“on”: true}’} to http://192.168.86.32:80/api/65C8F8C560/lights/7/state
2019-01-30 20:48:19 DEBUG (MainThread) [pydeconz.utils] HTTP request response: [{‘success’: {’/lights/7/state/on’: True}}]
2019-01-30 20:48:19 DEBUG (MainThread) [pydeconz.deconzdevice] Studio: update on with True
2019-01-30 20:48:19 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {“e”:“changed”,“id”:“7”,“r”:“lights”,“state”:{“on”:true},“t”:“event”,“uniqueid”:“84:18:26:00:00:0f:71:c4-03”}
2019-01-30 20:48:21 DEBUG (MainThread) [pydeconz.deconzdevice] Switch 33: update lastupdated with 2019-01-30T19:48:21
2019-01-30 20:48:21 DEBUG (MainThread) [pydeconz.deconzdevice] Switch 33: update buttonevent with 1002
2019-01-30 20:48:21 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {“e”:“changed”,“id”:“33”,“r”:“sensors”,“state”:{“buttonevent”:1002,“lastupdated”:“2019-01-30T19:48:21”},“t”:“event”,“uniqueid”:“00:15:8d:00:02:13:6a:72-01-0006”}
2019-01-30 20:48:21 INFO (MainThread) [homeassistant.components.automation] Executing bottone luce 1
2019-01-30 20:48:21 INFO (MainThread) [homeassistant.helpers.script] Script bottone luce 1: Running script
2019-01-30 20:48:21 INFO (MainThread) [homeassistant.helpers.script] Script bottone luce 1: Executing step call service
2019-01-30 20:48:21 DEBUG (MainThread) [pydeconz.utils] Sending {‘data’: ‘{“on”: false}’} to http://192.168.86.32:80/api/65C8F8C560/lights/7/state
2019-01-30 20:48:21 DEBUG (MainThread) [pydeconz.utils] HTTP request response: [{‘success’: {’/lights/7/state/on’: False}}]
2019-01-30 20:48:21 DEBUG (MainThread) [pydeconz.deconzdevice] Studio: update on with False
2019-01-30 20:48:21 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {“e”:“changed”,“id”:“7”,“r”:“lights”,“state”:{“on”:false},“t”:“event”,“uniqueid”:“84:18:26:00:00:0f:71:c4-03”}
2019-01-30 20:48:24 DEBUG (MainThread) [pydeconz.deconzdevice] Switch 32: update lastupdated with 2019-01-30T19:48:24
2019-01-30 20:48:24 DEBUG (MainThread) [pydeconz.deconzdevice] Switch 32: update buttonevent with 1002
2019-01-30 20:48:24 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {“e”:“changed”,“id”:“32”,“r”:“sensors”,“state”:{“buttonevent”:1002,“lastupdated”:“2019-01-30T19:48:24”},“t”:“event”,“uniqueid”:“00:15:8d:00:02:04:a5:5d-01-0006”}
2019-01-30 20:48:24 INFO (MainThread) [homeassistant.components.automation] Executing bottone luce 1
2019-01-30 20:48:24 INFO (MainThread) [homeassistant.helpers.script] Script bottone luce 1: Running script
2019-01-30 20:48:24 INFO (MainThread) [homeassistant.helpers.script] Script bottone luce 1: Executing step call service
2019-01-30 20:48:24 DEBUG (MainThread) [pydeconz.utils] Sending {‘data’: ‘{“on”: true}’} to http://192.168.86.32:80/api/65C8F8C560/lights/7/state
2019-01-30 20:48:24 DEBUG (MainThread) [pydeconz.utils] HTTP request response: [{‘success’: {’/lights/7/state/on’: True}}]
2019-01-30 20:48:24 DEBUG (MainThread) [pydeconz.deconzdevice] Studio: update on with True
2019-01-30 20:48:24 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {“e”:“changed”,“id”:“7”,“r”:“lights”,“state”:{“on”:true},“t”:“event”,“uniqueid”:“84:18:26:00:00:0f:71:c4-03”}
2019-01-30 20:48:26 DEBUG (MainThread) [pydeconz.deconzdevice] Switch 32: update lastupdated with 2019-01-30T19:48:26
2019-01-30 20:48:26 DEBUG (MainThread) [pydeconz.deconzdevice] Switch 32: update buttonevent with 1002
2019-01-30 20:48:26 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {“e”:“changed”,“id”:“32”,“r”:“sensors”,“state”:{“buttonevent”:1002,“lastupdated”:“2019-01-30T19:48:26”},“t”:“event”,“uniqueid”:“00:15:8d:00:02:04:a5:5d-01-0006”}
2019-01-30 20:48:26 INFO (MainThread) [homeassistant.components.automation] Executing bottone luce 1
2019-01-30 20:48:26 INFO (MainThread) [homeassistant.helpers.script] Script bottone luce 1: Running script
2019-01-30 20:48:26 INFO (MainThread) [homeassistant.helpers.script] Script bottone luce 1: Executing step call service
2019-01-30 20:48:26 DEBUG (MainThread) [pydeconz.utils] Sending {‘data’: ‘{“on”: false}’} to http://192.168.86.32:80/api/65C8F8C560/lights/7/state
2019-01-30 20:48:26 DEBUG (MainThread) [pydeconz.utils] HTTP request response: [{‘success’: {’/lights/7/state/on’: False}}]
2019-01-30 20:48:26 DEBUG (MainThread) [pydeconz.deconzdevice] Studio: update on with False

Your automation is wrong

entity_id: Switch_32

Should be something like id: switch_32

Looks ok! Thank you very much!

1 Like