Hi
I have gotten automations working well with the Deconz sensors added via the Phoscon. Now I am trying to get automations based on sensors from the REST API working. Not sure if this is a bug or an issue with my configuration.
My trigger is:
(I have also tried with the variation of the id lumi.sensor_switch and the event 1000)
I have no condition and have tested the action is working.
With debugging on Home Assistant I am registering events for example:
2018-04-13 23:55:34 INFO (MainThread) [homeassistant.core] Bus:Handling <Event deconz_event[R]: id=lumisensor_switch, event=1000>
2018-04-13 23:55:36 DEBUG (MainThread) [pydeconz.websocket] Websocket data: b'\x81t{"e":"changed","id":"10","r":"sensors","state":{"buttonevent":1002,"lastupdated":"2018-04-13T13:55:36"},"t":"event"}'
2018-04-13 23:55:36 DEBUG (MainThread) [pydeconz.deconzdevice] lumi.sensor_switch: update buttonevent with 1002
2018-04-13 23:55:36 DEBUG (MainThread) [pydeconz.deconzdevice] lumi.sensor_switch: update lastupdated with 2018-04-13T13:55:36
The button appears in the REST API:
"10": {
"config": {
"on": true,
"reachable": true
},
"ep": 1,
"etag": "10ac<removed>",
"manufacturername": "LUMI",
"mode": 1,
"modelid": "lumi.sensor_switch",
"name": "lumi.sensor_switch",
"state": {
"buttonevent": 1002,
"lastupdated": "2018-04-13T13:55:36"
},
"type": "ZHASwitch",
"uniqueid": "<removed>00:01:f3:dd<removed>"
},
I have of course restarted HA during testing.
Thanks
jo-me
(Jochen Mehlhorn)
April 17, 2018, 4:52am
2
Have you tried to rename your button so that there is no dot in the name? It seems as if ha is removing it and maybe there are issues matching the old id to the new id.
I have the same event trigger for a aquara smart button and it works
1 Like
Robban
April 17, 2018, 6:01am
3
It could be as simple as you removing the " around your event (“1002”), since it’s supposed to be an integer, not a string.
1 Like
@jo-me and @Robban both of those together fixed the problem! Thank you both for the help. Its always the simple things…
1 Like
Oliviakrk
(Oliviakrk)
December 13, 2018, 10:15pm
5
@chrisvella
Could you post your yaml code for this automation?
@Oliviakrk my HA system isn’t up atm but I should be able to help you. What exactly do you want to do?
Oliviakrk
(Oliviakrk)
December 14, 2018, 6:10am
7
I am trying to use Xiaomi switch to toggle light…
I enabled debug for deconz. I can see the event…
2018-12-13 23:14:42 DEBUG (MainThread) [pydeconz.deconzdevice] KatesXiaomiSwitch: update buttonevent with 1000
2018-12-13 23:14:42 DEBUG (MainThread) [pydeconz.deconzdevice] KatesXiaomiSwitch: update lastupdated with 2018-12-13T22:14:42
2018-12-13 23:14:42 DEBUG (MainThread) [pydeconz.deconzdevice] KatesXiaomiSwitch: update buttonevent with 1002
I made automation:
alias: XiaomiButton in Kates room
trigger:
platform: event
event_type: deconz_event
event_data:
id: 5
event: 1002
action:
service: light.toggle
entity_id: light.katedeskled
But it doesn’t work. I tried to use numer and switch name in the od field, but it didn’t work.
Oliviakrk
(Oliviakrk)
December 14, 2018, 9:31pm
8
Ok found it. id is case sensitive and always small letters.
So did you fix your problem?
Christian
(Christian)
December 24, 2018, 10:32pm
11
Hi,
trying to avoid any errors mentioned above i still don’t get my simple switch automation to work.
Any help appreciated.
automation.yaml
- id: 'baumtoggle'
alias: baum_toggle
hide_entity: false
initial_state: 'on'
trigger:
platform: event
event_type: deconz_event
event_data:
id: Schalter1
event: 1002
action:
- service: switch.toggle
entity_id: switch.steckdose_ii
Fireing the event from hassbian gui is executing the automation rule. Pushing the button device isn’t…
Hassbian log:
2018-12-24 23:24:26 DEBUG (MainThread) [pydeconz.deconzdevice] Schalter1: update buttonevent with 1000
2018-12-24 23:24:26 DEBUG (MainThread) [pydeconz.deconzdevice] Schalter1: update lastupdated with 2018-12-24T22:24:26
2018-12-24 23:24:26 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {"e":"changed","id":"6","r":"sensors","state":{"buttonevent":1000,"lastupdated":"2018-12-24T22:24:26"},"t":"event","uniqueid":"00:15:8d:00:02:b2:21:8a-01-0006"}
2018-12-24 23:24:27 DEBUG (MainThread) [pydeconz.deconzdevice] Schalter1: update buttonevent with 1002
2018-12-24 23:24:27 DEBUG (MainThread) [pydeconz.deconzdevice] Schalter1: update lastupdated with 2018-12-24T22:24:27
2018-12-24 23:24:27 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {"e":"changed","id":"6","r":"sensors","state":{"buttonevent":1002,"lastupdated":"2018-12-24T22:24:27"},"t":"event","uniqueid":"00:15:8d:00:02:b2:21:8a-01-0006"}
Robban
December 25, 2018, 8:49am
12
id should only be lowercase
1 Like
Christian
(Christian)
December 25, 2018, 12:39pm
13
thank you!!! changed to lowercase - works
1 Like