Hello,
why not all actions are listed in the event log?
How decides z-way if a action will be listet in event log and when not?
We poll the event log and need the feedback from the device in the event log to confirm the status.
Regards
Steffen
Why not all actions in Event Log?
Re: Why not all actions in Event Log?
All data the device sends should be in the z-way-server.log file, regardless if higher level layer knows what to do with it. Some devices don't send reports, in that case you may have to query frequently. For example my Aspire RF send in reports while my GE switches don't.
Re: Why not all actions in Event Log?
viper384 wrote:All data the device sends should be in the z-way-server.log file, regardless if higher level layer knows what to do with it. Some devices don't send reports, in that case you may have to query frequently. For example my Aspire RF send in reports while my GE switches don't.
Thank you for your answere.
Yes in the logfile all the data are listed. But not all in the Event Log. And we use the Event Log for poll.
I.e. the switchbinary class of the Fibaro FGR-222 v2.5 Roller Shutter. It will nothing listed in the Event Log but in the Dataholder the Value will be changed and in the logfile we see the response.
Or the Battery class. The same. In Event Log nothing but I see the response in the logfile and the new Value in the Dataholder.
There are a few other Devices or Classes with the same "problem".
If I know how Z-way handle it. What rules have Zway if a event will be listed in the Event Log? Then I can react and grab the Value from the dataholder.
PS: To avoid misunderstandings. The Event Log is not the Zway Logfile.
Re: Why not all actions in Event Log?
Please explain what and where it is. I could not find a reference to it in the Developers ManualSReibert wrote:The Event Log is not the Zway Logfile.
v2.1.1 raspi2
Re: Why not all actions in Event Log?
Sorry it is named "Notifications" not "Events"remoticz wrote:Please explain what and where it is. I could not find a reference to it in the Developers ManualSReibert wrote:The Event Log is not the Zway Logfile.
In the Developers Manual under Chapter 6 is only a link to the full doku:
http://docs.zwayhomeautomation.apiary.i ... tification
Code: Select all
$url ='http://'.$ZWayUser.':'.$ZWayPassword.'@'.$ZWayIP.':'.$ZWayWebPort.'/ZAutomation/api/v1/notifications since='.$timestamp;
Re: Why not all actions in Event Log?
I'm not sure how well developed the Zautomation Event Log for what you are trying to do. Is this a shell script? Can you use the raw data from z-way-server.log instead? The program monit can monitor the z-way-server.log, using 1 second increments, use the "check file" "if match" in monit to catch a unique event and launch your script of choice.
While running monit in 1 second increments takes a small CPU hit, that hit can be further reduced by using inotifywait to call monit when the file content changing via SIGUSR1, in a loop, removing the need for monit to check in 1 second increments, it's default is 5 minutes.
While running monit in 1 second increments takes a small CPU hit, that hit can be further reduced by using inotifywait to call monit when the file content changing via SIGUSR1, in a loop, removing the need for monit to check in 1 second increments, it's default is 5 minutes.
Re: Why not all actions in Event Log?
Hello,
The last days I looked into the /automation folder files to understand what is going on.
What we poll was the notifications from the "InbandNotifications" Modul.
This Modul use the vDev API to become the data.
And the vDev do lot of filtering.
I need a way to grab the Data before the vDev is working on it.
I think I have found the part were the vDev catch the Data (VirtualDevice.js, see picture). But my knowledge about Javascript is not enough to change my Code that it works.
My Code is simply the "InbandNotifications" code that I have changed, that the Data will be send by Websocket. It works fine, but, of course only limited of the data that I become with the old poll method.
How must be the Code that If the Zwave Core (see picture) or JavaScript Core (see picture) send a message then this raw data pushed to the websocket.
Or If in the Dataholder a Value will be changed then push the device data to the websocket.
i hope, if I catch the infos in a low level that there are the Infos I.e. that the switchbinary class from the Fibaro FGR-222 has switched or the battery value and lot of other infos that the zwave devices send but only is visible in the dataholder or zway.log file.
Thank you for your answer. But this is not the solution I need. I will use this, among other to confirm if i.E. a switch has switched. This must go fast as possible. And I will not use a extra program to make that.The program monit can monitor the z-way-server.log, using 1 second increments
The last days I looked into the /automation folder files to understand what is going on.
What we poll was the notifications from the "InbandNotifications" Modul.
This Modul use the vDev API to become the data.
And the vDev do lot of filtering.
I need a way to grab the Data before the vDev is working on it.
I think I have found the part were the vDev catch the Data (VirtualDevice.js, see picture). But my knowledge about Javascript is not enough to change my Code that it works.
My Code is simply the "InbandNotifications" code that I have changed, that the Data will be send by Websocket. It works fine, but, of course only limited of the data that I become with the old poll method.
Code: Select all
function TestModul (id, controller) {
TestModul.super_.call(this, id, controller);
}
inherits(TestModul, AutomationModule);
_module = TestModul;
TestModul.prototype.init = function () {
var self = this,
lastChanges = [];
this.writeNotification = function (vDev) {
if(!Boolean(vDev.get('permanently_hidden'))){
var devId = vDev.get('id'),
devType = vDev.get('deviceType'),
devProbeType = vDev.get('probeType'),
devName = vDev.get('metrics:title'),
scaleUnit = vDev.get('metrics:scaleTitle'),
lvl = vDev.get('metrics:level'),
eventType = function(){
if(vDev.get('metrics:probeTitle')){
return vDev.get('metrics:probeTitle').toLowerCase();
}else {
return 'status';
}
},
createItem = 0,
item, msg;
if(lastChanges.filter(function(o){
return o.id === devId;
}).length < 1){
item = {
id: devId,
l: lvl
};
lastChanges.push(item);
createItem = 1;
}
for(var i = 0; i < lastChanges.length; i++){
var cl = lastChanges[i]['l'],
cid = lastChanges[i]['id'];
if(lvl === +lvl && lvl !== (lvl|0)) {
lvl = lvl.toFixed(1);
}
if((cid === devId && cl !== lvl) || (cid === devId && cl === lvl && (createItem === 1 || devType === "toggleButton" || devType === "switchControl"))){
msg = {
devId: devId,
devType: devType,
devProbeType: devProbeType,
devName: devName,
scaleUnit: scaleUnit,
lvl: lvl,
eventType: eventType
};
ws.push("TestModul", msg);
lastChanges[i]['l'] = lvl;
createItem = 0;
}
}
}
};
self.controller.devices.on('change:metrics:level', self.writeNotification);
};
TestModul.prototype.stop = function () {
var self = this;
self.controller.devices.off('change:metrics:level', self.writeNotification);
TestModul.super_.prototype.stop.call(this);
};
TestModul.prototype.deviceCollector = function(deviceType){
var allDevices = this.controller.devices,
filteredDevices = [];
if(deviceType === 'all'){
return allDevices;
} else {
filteredDevices = allDevices.filter(function (vDev){
return vDev.get('deviceType') === deviceType;
});
return filteredDevices;
}
};
How must be the Code that If the Zwave Core (see picture) or JavaScript Core (see picture) send a message then this raw data pushed to the websocket.
Or If in the Dataholder a Value will be changed then push the device data to the websocket.
i hope, if I catch the infos in a low level that there are the Infos I.e. that the switchbinary class from the Fibaro FGR-222 has switched or the battery value and lot of other infos that the zwave devices send but only is visible in the dataholder or zway.log file.