Vera device extended attributes ?
-
rafale77replied to cw-kid on Mar 3, 2021, 2:14 PM last edited by rafale77 Mar 3, 2021, 9:33 AM
@cw-kid said in Vera device extended attributes ?:
Its a fudge fix for Vera being crap at handling these motion sensors, seems a later firmware update at some point in time made this happen, as it never happened in the past and those sensors never use to say "Can't Detect Device".
The vera will flag battery operated devices it fails to receive a wakeup signal for a time >2x the wakeup interval. It is a common behavior in controllers and I don't think it is new. You should see complains about this from the beginning of vera. I thought I had suggested to vera dev to change this behavior to run this flag so as not to only consider the wakeup packets but all packets as the "last alive" time to eliminate exclusive dependency on the wakeup process. I guess I was ignored. If I remember correctly made the same suggestion to z-wave.me and it got quickly implemented.
The vera has the tendency to miss a lot of zwave traffic due to its very bizarre "maintenance" scheme whereby it sends request to every battery devices to do a network heal whenever they wakeup (wakeup NNU) which basically disables the device and the network nodes around it while it is polling them for about a minute. And the nightly heal which essentially does the same for all devices no matter how they are powered, freezing the entire network for 30min (depending on how large your network is) at least and causing luup engine hangs and crashes as the unfinished tasks accumulate. All very unique "features" of the vera. There was another thing about the battery operated devices which I had requested for the longest time to eliminate but it escapes me at the moment.
Combine this with a weak antenna and a noisy RF environment and you get a lot of "Can't detect device"
-
@rafale77 Yes I'm sure they could of improved many things.
I only get "Can't detect device" on mainly two motion sensor devices and its always the same two.
I have other motion sensor devices that don't seem to have this issue or certain not all the time like these two do.
I have polling set to 0 for all battery operated devices and their wakeup interval is 86400 / 24 hrs.
-
Try also update the LastWakeupTime to be the same as LastTrip and reset the sensor failure with the setFailure command in luup code for that device or maybe even waking them up manually. I think these devices may not be waking up at all or may just happen to be waking up when your zwave network is doing something else like a heal or an nnu so it is missing them every time.
-
cw-kidreplied to rafale77 on Mar 3, 2021, 5:40 PM last edited by cw-kid Mar 3, 2021, 12:54 PM
@rafale77 Looking at one of the motion sensors that has "Can't detect device" on it now, its lastwakeup time is: 1606495613 or Friday, 27 November 2020 16:46:53
Its an Everspring SP816-1 outdoor one. Looking in its user manual it does say its maximum wakeup interval is 1 day, so I should be OK with 86400 seconds I have it set as.
Wonder why its not waking up? It's still detecting motion events perfectly fine. Might have to take it down and check the batteries and wake it up manually.
-
The other problem motion sensor is a Neo Cool Cam NAS-PD02Z. I can't even see a "LastWakeup" variable / value on that device at all, it has no field for it in the GUI showing.
-
Yep that's the problem. The vera tags its battery operated devices as "can't detect" using this variable. For your information:
WakeupInterval is a parameter of the vera. It is the interval the vera is going to measure to as it expects the device to update.
ConfiguredWakeupInterval is a parameter stored in the device. It is the number the vera got the last time the device was configured and told the vera that's the setting it has.
LastWakeup is the date the last time the vera saw the device to have woken up.The logic in the vera is as I said before, "if os.time() - LastWakeup > WakeupInterval*2 then set Device fail =1"....
Now more funny... The device wakes up to its lifeline associated group. (group 1). It is possible that your device was not completely configured and that the association was not setup correctly. The best way to know is to wake the device up to see if you see the variable. If not then try reconfiguring.
More fun... some devices won't accept any other nodeID than "1" in this association group so if your vera's zwave has a different ID... well it will never report to the vera that it has woken up. -
@rafale77 said in Vera device extended attributes ?:
WakeupInterval is a parameter of the vera. It is the interval the vera is going to measure to as it expects the device to update.
ConfiguredWakeupInterval is a parameter stored in the deviceConfiguredWakeupInterval on both of these motion sensor is
86400 I can see this value on each device.The WakeupInterval on both of these motion sensor is
86400 I can see this value on each device.I've just woken up the Neo Cool Cam one that had the missing LastWakeUp value and its still missing. I then polled it OK but still no LastWakeUp field showing up. Might have to try and reconfigure it.
As for the Everspring one outside, Vera says it hasn't woken up since November LOL. I'll have to take it down and have a look also.
-
Idea popping in my head to make this behave more like z-way... have a scene to update the LastWakeup variable every time the Tripped variable changes... That would be a quick patch to overcome the stupidity of the firmware.
-
rafale77replied to cw-kid on Mar 3, 2021, 7:02 PM last edited by rafale77 Mar 3, 2021, 2:12 PM
It's possible to do it on the MSR but this is the version on the vera:
- Create a scene with trigger being your sensor's tripped event (tripped or untripped)
- Add the following lua code as the scene lua:
local dev = --the device id of the sensor-- local t = os.time() luup.variable_set("urn:micasaverde-com:serviceId:ZWaveDevice1", "LastWakeup", t, dev) if luup.variable_get("urn:micasaverde-com:serviceId:HaDevice1", "CommFailure", dev)=="1" then luup.set_failure(false,dev) end
Done...
You could possibly even implement this to all sensors by making it a function and set a variable watch on all the tripped values in the startup lua... After this, you would also have to run
-
Great thank you. I will give it a try.
-
Just tried the code in the Vera test window against the outdoor Everspring motion sensor. It works. Its updated its lastwakeup value to just now and gotten rid of the "Can'r detect device" red banner also.
-
I ran the code against the other Neo Cool Cam motion sensor with the missing LastWakeUp field and now that field is present and up to date with that time stamp.
I've setup two functions in the Vera startup for each motion sensor to run this LUA code and two MSR rules to trigger upon their motion being tripped etc.
-
-
Note that if you don't trip these sensors regularly, you will still see a problem eventually so it is best to fix the wakeup. If they get tripped regularly then you don't need to worry too much about it.
On your last edit: Please ensure to use the code I updated. I made a mistake the first time around using the wrong service ID.
-
This is what I have in the functions:
-- Porch Motion Sensor Fix LastWakeUp and Can't Detect Device Errors function PorchMotionSensorFix() luup.log('VeraScenes.PorchMotionSensorFix') local dev = 304 local t = os.time() luup.variable_set("urn:micasaverde-com:serviceId:ZWaveDevice1", "LastWakeup", t, dev) if luup.variable_get("urn:micasaverde-com:serviceId:HaDevice1", "CommFailure", dev)=="1" then luup.set_failure(false,dev) end end
-- Lounge Motion Sensor Fix LastWakeUp and Can't Detect Device Errors function LoungeMotionSensorFix() luup.log('VeraScenes.LoungeMotionSensorFix') local dev = 331 local t = os.time() luup.variable_set("urn:micasaverde-com:serviceId:ZWaveDevice1", "LastWakeup", t, dev) if luup.variable_get("urn:micasaverde-com:serviceId:HaDevice1", "CommFailure", dev)=="1" then luup.set_failure(false,dev) end end
-
Yup it should work. I don't see why it would flag them as failed again... The firmware checks every 10min so you have to wait 10min to be sure it doesn't come back.
-
I tripped the Everspring motion sensor and then untripped it. Started a stop watch and I'm up to 13 minutes now and the error has just come back again. Also the motion sensor hasn't been re-tripped again during this time.
-
I have two of these everspring sensors and have no problem with them. I highly recommend to reconfigure it. Now I don't know why the error would come back. There has to be another mechanism causing this. Likely some variable not set properly.
13/38