Page 1 of 1

how to know exactly a reason for event

Posted: Tuesday 29 May 2018 22:18
by torM6
I want to use Xiaomi Xiaofang camera motion detection features. Problem that it not supported by domoticz because it communicates with xiaomi gateway in limited way.
idea that I will make automation inside xiaomi app/cloud and cause something which can be detected inside domoticz.
First idea to come - use Gateway to make light off if it off and on if it on.
I try to write a dzVent script to catch the event which set state "Off" on the attached gateway device.
The problem that I can't find a place where I can detect exactly a reason for event.
it just set state of the device "changed" and I don't really know what happens - can't make a distinction between my external Off command and e.g. lux or door bell induced from outside.
In what field I can find event reason?

Re: how to know exactly a reason for event

Posted: Wednesday 30 May 2018 8:11
by dannybloe
Well, Domoticz triggers the event system when there is a state change for a device like a switch being triggered or a temperature being changed. dzVents only gets a list of devices that have such a change. But the reason for the triggering is unknown. So if someone presses a switch in the GUI of presses a wall switch.. that information is unknown and in some situation cannot be known at all.