domoticz / domoticz

Open source Home Automation System
http://www.domoticz.com
GNU General Public License v3.0
3.49k stars 1.12k forks source link

Confusing user ID on switch status history (2020.2) #4135

Open jefft4 opened 4 years ago

jefft4 commented 4 years ago

Domoticz 2020.2 In the switch status history, there is a user ID which I guess is intended to indicate what service or which user set the device state. Good idea; however, the data in it at present is not helpful.

When a z-wave switch is changed externally - e.g. by finger - the user id in the history shows 'MQTT'. That's misleading; the state of the switch wasn't changed by a MQTT command (at least, not one from outside domoticz).

Can it please show 'zwave' or 'external' to indicate the real source of the change?

Same would, I expect, for other hardware subsystems like Zigbee and plugins that create devices - when the trigger comes via the hardware, use the hardware item name as the user id. Use 'MQTT' only when the change really came as a MQTT message from outside domoticz.

Confirmed the same behaviour ('MQTT') with the Shelly devices plugin, which shows 'MQTT' for all external changes; 'Shelly' or 'external' would be more accurate.

Claude2666 commented 4 years ago

Same behavior here on 2020.2 Actually I have noticed this already a while in the Beta versions. I have some Z-wave door sensors and sometimes the user in the log is MQTT, Admin, sometimes blank...

gizmocuz commented 4 years ago

Yes we have noticed this, and it has to be addressed ... Ignore it for now, It was not in the previous version

SargonofAssyria commented 4 years ago

I have the same kind of issue, see: https://www.domoticz.com/forum/viewtopic.php?f=31&t=33193

waltervl commented 2 years ago

Is being worked on https://github.com/domoticz/domoticz/commit/7f0720dd93bb393a3d2fde14eabb553b84f168ce

gizmocuz commented 2 years ago

Maybe it is solved not, please do some testing

Claude2666 commented 2 years ago

Before with Openzwave

Now when I switch on/off one of my zwave power plugs, the user is always ZwaveJS (the name of my Zwave MQTT DA), no difference if it is done from the GUI or from the device. I was expecting to see the user that operated the switch when done from the GUI.

gizmocuz commented 2 years ago

The reason for this is that the switch command is send to the node, and the node reports it's status back (received by ZWaveJS2MQTT) What needs to be done is store this value in the database first (with the user), so when the actual state is received from the node, it matches the current state, and it will not be updated in the database