Page 1 of 1
Add text to Device Log when updating Value
Posted: Monday 13 February 2017 11:12
by nickb512
I have had a few instances recently of random devices not doing what they were told or doing strange things. Example being I woke up this morning and my kitchen light was on. It was off when I went to bed last night and I ran an 'All Off' scene at about 10pm from a flic button next to the bed which all worked fine. Now the device log for the kitchen light shows me that the light turned on at 11:30pm last night - but I have no info as to why this turned on. At the moment I'm blaming the cat but who knows...
This could have been one of my LUA scripts triggering something funny, but I have no idea.
My idea is could we add a 'reason' or 'method' string to a device update which appears on the device value log? Eg when doing an LUA update we pass something like
commandArray['Kitchen Light'] = "On FROM Security LUA Script"
With the next after the BY getting added to a new column on the log (Date, Data, From). Would make troubleshooting a lot easier rather than having to go back through the full domoticz log.
Thanks
Nick
Re: Add text to Device Log when updating Value
Posted: Monday 13 February 2017 13:30
by Siewert308SW
nickb512 wrote:I have had a few instances recently of random devices not doing what they were told or doing strange things. Example being I woke up this morning and my kitchen light was on. It was off when I went to bed last night and I ran an 'All Off' scene at about 10pm from a flic button next to the bed which all worked fine. Now the device log for the kitchen light shows me that the light turned on at 11:30pm last night - but I have no info as to why this turned on. At the moment I'm blaming the cat but who knows...
This could have been one of my LUA scripts triggering something funny, but I have no idea.
My idea is could we add a 'reason' or 'method' string to a device update which appears on the device value log? Eg when doing an LUA update we pass something like
commandArray['Kitchen Light'] = "On FROM Security LUA Script"
With the next after the BY getting added to a new column on the log (Date, Data, From). Would make troubleshooting a lot easier rather than having to go back through the full domoticz log.
Thanks
Nick
1. log is possible, you can create a print command in you script which will end up in Domoticz log.
2. Are you using 433mhz modules, can't find it in your OP?
If so, then if your light is switched on without a reason i would think one of your neighbours has a device with the same device ID.
There for they triggered it (not on purpose) and there for no log in Domoticz other then that the light is turned on.
There is no way to tell domoticz a neighbour turned it on.
Re: Add text to Device Log when updating Value
Posted: Monday 13 February 2017 17:12
by nickb512
I'm well aware of the normal logging procedure and have plenty of LUA scripts writing logs but this is more to record the reason a device changed state. I have not been saving my domoticz log to disk until now because its been pretty reliable but now today 3 different devices have turned on randomly at times that are not linked to any other scheduled events or actions. Being able to see if it was an LUA event, or a User event, API event etc from the device summary/log page would simplify things with probably not a lot of development.
All devices are either Z Wave or LAN connected (RasPI GPIOs etc). The 3 devices today have all been Z Wave.
I'm not using OpenZWave because I find it to be quite unreliable and the Z Wave network management features are not great. Instead I'm using Razberry Z Way with switches polled using LUA and switch changes sent back to the Z-Automation API by an LUA script. Non switch devices are posted into the Domoticz API using the Z-Automation JS API. So far this setup has been pretty reliable - much more so than OpenZWave or the Razberry device handler.
Nick
Re: Add text to Device Log when updating Value
Posted: Sunday 16 April 2017 12:50
by passie
nickb512 wrote:I have had a few instances recently of random devices not doing what they were told or doing strange things. Example being I woke up this morning and my kitchen light was on. It was off when I went to bed last night and I ran an 'All Off' scene at about 10pm from a flic button next to the bed which all worked fine. Now the device log for the kitchen light shows me that the light turned on at 11:30pm last night - but I have no info as to why this turned on. At the moment I'm blaming the cat but who knows...
This could have been one of my LUA scripts triggering something funny, but I have no idea.
My idea is could we add a 'reason' or 'method' string to a device update which appears on the device value log? Eg when doing an LUA update we pass something like
commandArray['Kitchen Light'] = "On FROM Security LUA Script"
With the next after the BY getting added to a new column on the log (Date, Data, From). Would make troubleshooting a lot easier rather than having to go back through the full domoticz log.
Thanks
Nick
Could you tell me, how you have setup the flic button to pair with your domoticz ?