Monday, September 10, 2018

Monitoring: the often overlooked automation.

What do I mean by monitoring

Being able to control things like your lights, TV excreta with your voice is nice and seems to be enough for a lot of people. At least till they discover a few well placed sensors with turn those lights off and on automatically. That is making the jump from remote control to automation and in a way could be considered monitoring but is not what I'm referring to. Simple monitoring would be like:

  • What I posted in UPS monitoring to tell me if a UPS monitor is offline.
  • Having IFTTT update a Homeseer virtual timer that triggers an alert if your Fitbit has not posted sleep in over 30 hours to monitoring the system itself. 
  • Having a smart plug power a cycle a camera that has dropped offline for several minutes

Stuff breaks, crashes or batteries simply die. In the case of batteries they might die while the system is still reporting them as good. Unless you are watching for missing data you might not know it is missing until you try and use the data or the control it is linked to.

My ChkSensors.vb script

Inspired by the BLRadar Plug-In for HomeSeer I wrote simple script ChkSensors.vb that is called hourly and looks at any Homeseer device object not in an ignored location and has the HomeSeerAPI.Enums.dvMISC.SET_DOES_NOT_CHANGE_LAST_CHANGE flag unset. The HomeSeerAPI.Enums.dvMISC.SET_DOES_NOT_CHANGE_LAST_CHANGE flag when set only updates the Last Change value if the value is changed from the previous update. The rub of course is that while many hardware devices update all values at the same time not all so and some plugins even set the HomeSeerAPI.Enums.dvMISC.SET_DOES_NOT_CHANGE_LAST_CHANGE flag during updates so those need to be ignored.  Currently my script is checking 449 of my 1788 "devices". Note a device in Homeseer is data stream or control so an Aeon 6in1 sensor for example is 8 Homeseer devices.

That may not seem like much but it covers all my Z-wave, Hue and Harmony devices along with several things monitored via Ethernet / WiFi. For example My alarm panel is seen by Homeseer as 19 devices. 16 zones and 3 other devices. In know "Root" and "Partition 1" change every time I open a door or change modes so that will happen at least a few times a day. Even if I was out of town someone would have to come feed the animals. Anyway that means I really only need to monitor 1 device to confirm Homeseer and the alarm are still talking to each other.
You will notice the script tags the devices (not in ignored locations) that it is not monitoring with a  which is a bit of a hack but makes it easy to know which devices have the flag set without having to open them up. Especially since, as mentioned above, some plugins force that flag unset.
There to you will notice with the Aeon 6in1 above I'm monitoring only Humidity, Luminance, UV and Temperature. Root nodes on Z-wave devices never seem to update. UV never reaches this sensor so it is never sent. Motion and tamper are not monitored because the location is were there should not be any animals and I want to alert me is any get in there. Hence the motion and Home Security devices should not update unless there is a problem.

Note too the script checks devices at 3 age levels. Anything not ignored over 48 hours old, any in the chk24 group over 24 hours old and anything in the chk1 group over 1 hours old.

Reporting

If a device is found to be last updated too long ago has its current Location2 (called Category in my system) saved to the device's UserNote field before setting its Location2 to offline. This makes listing all the devices that need looked at simple. The last thing the script does if there are any devices found offline is to give you a verbal warning. Assuming warnings are not muted. See SayIt.vb. What you get is something like this
To give some examples the Laundry door sensors tell me for some reason I have not opened that door in 24 hours which is odd but not a big deal. Same UPSBox_DC_Sensor_chan4 not getting triggered since yesterday when I went out get a package. Again normally I open the box each evening when filling the south feeder but yesterday it was raining so I skipped it. The WirelessTag ones though are an issue. And a very strange one at that. Looking on the server all the data is there and no errors are in the logs. Even stranger there appears to be no pattern to which data is getting updated and what is not. I have 8 tags linked. Each has 4 data streams (plus battery level which has never worked for some reason). This happened once before. Then tags 0 and 2 were not updating. Rebooting the WirelessTag hub did not help but repowering it did. This time 0 and 1 are the only ones updating. Worse yet only the temp of tag 1 has updated since I repowered this time.
There was an exception in the logs this time at 9/8/2018 at 5:06 PM but nothing before or since which makes me suspect the hub is going out. Though it might be a bad update from what I see here.

Want some more examples of why you might need monitoring?

Last week my Rachio got knocked offline by a storm. It shows in the list. I reboot it and all is well. Better than finding when wondering why the plants are wilting.

Today I had an alert for the north lights in the barn. A Z-wave wall switch. A quick check and I found the breaker had tripped. Better than finding by needing to see in the barn and not having lights that work.

An event example in case you need

If you have read this far you probably already know how to trigger this from an event but in case you are not that deep in the woods yet here is what the event looks like.

Helper methods

There are a couple other helpful things in that script as well to simplify life. For example
fixFlagsByType lets you set the HomeSeerAPI.Enums.dvMISC.SET_DOES_NOT_CHANGE_LAST_CHANGE flag on any device in offline by passing it part of the type name. For instance any BLOnkyo Plug-in device
fixFlagsByRoom does similar by room (dv.Location)

initFlags unsets HomeSeerAPI.Enums.dvMISC.SET_DOES_NOT_CHANGE_LAST_CHANGE flag on all devices not in the filtered locations to get you started.


Honeywell Vista 20P linked to Homeseer


Since this is mainly a wired panel I'll assume your house is wired. If not you will need to run wires and install switches and or sensors around the house. Or optionally get the wireless interface and sensors.

Items you will want

Honeywell VISTA-20P Ademco Control Panel, PCB in Aluminum Enclosure 
Eyez-On Envisalink EVL-4EZR IP Security Interface Module For DSC and Honeywell (Ademco) Security Systems
Honeywell Security 6160 Ademco Alpha Display Keypad (You seem to still need this to program the panel despite adding the above web interface.)
For a battery I used a Mighty Max Battery 12V 9Ah Compatible Battery for APC Back-UPS NS1250 mainly because I buy them in bulk for my UPSs.
Unless you get a battery for an alarm system it will probably have standard tabs so will need these F2 to F1 Sealed Lead Acid Battery Terminal Adapters
You will also need some 18 gauge wire to go from the panel to the transformer.

Useful guides:

Vista 20P / 15P wiring guide Note the keypad and the IP interface connect to the same place.

Envisalink install programming guide which gets you the first 8 zones programmed.

Honeywell VISTA 15P, 20P Programming Guide

Note if you wired doubled zones of need to change the hardwire type on those zones. See this doc for info on that. Also you need to program both zones. For example if 2 is doubled then you need to set the type on zone 2 and enable zone 10. And confirm Zone Type is correct for both.

Once done the local web interface should loo like this
And the network page like this

Not much there really. It is really only useful for setup. If you do have a problem you will still need to go to the EyezOn status page to get more than a "trouble" indicator. Note EnvisaLink TPI Status will offline till the Homeseer plugin is configured.

The EyezOn status page will look like this (Note MAC and public IP blacked out)

 Oddly the *29 error does not seem to really matter. The docs say it means the "Enable IP/GSM/LRR Shadowing" option is not checked in the local interface but it seems not to matter and be a 21P thing as flipping options did not seem to make it go away and it does not seem to be stopping anything from working. Ignoring for now and will update if solution found later.

Again not a lot useful here accept the log activity. By default the zones are labeled by number. You can put names on them to make them clearer by going to Settings

Then Zone Labels. Then add a name for each zone. When done it will look something like this.

Now your log will look like this

Note however it only seems to only keep closures in the log after a sensor has been closed.
To unhighlight the sensor that was tripped / clear fault on keypad (even in unarmed mode) you need to disarm a couple times. Note there may be a lag in seeing this in the web interfaces.

Homeseer plugin

In Homeseer you will need to add the Envisalink Ademco (Spud) plugin
The config screen looks like this

The devices create (by clicking the Update zone devices button) look like
Note your may not have the  as that indicates it is not health checked in my setup. See my ChkSensors.vb script.

A cheat sheeting on arming and disarming from the panel Note the Chime disarmed option is not supported by the plugin as a control but it does recognize it when set on a keypad.





Friday, September 7, 2018

Running a camera on battery


What I wanted to achieve.

I wanted to get a cam on my mailbox which across the street. But the closest place to an outlet that could get line of sight is over 300 feet from any building and across the driveway. So we are talking major construction to run a line or POE cable out there. I already have a couple cams down by the creek running longer distances from my super AP ( a UniFi AP Outdoor+ with a Ubiquiti Airmax Omni AMO-2G10 10Dbi 2.4 GHz Rocket antenna) so I started to wonder what kind of battery would it take to power a camera.

Moved the body of this to my camera blog where it makes more sense after adding camera compare info. Leaving this here to make it easier to find.