Showing posts with label monitoring. Show all posts
Showing posts with label monitoring. Show all posts

Wednesday, May 1, 2019

Sample adventure

Still trying to sort this one out. So far no lightning I know of or chewed wires found.

First draft: to record details while getting things working again.

What happened:

  • All of a sudden several cams (mainly connected to barn) go offline. 
  • Go to try and reset power and find the WiFi plugs are offline. 
  • Thinking main breaker in barn must have tripped but on inspection that is fine.
  • Come back in and find home controller not responding, more cams offline and lots of red on MyMonitor screen. Can ping servers, all in next room, showing down but not talk to web interfaces on ones I try. Decide to sort barn first.
  • Checking edge switches I can see the north and south walls of the barn are not talking
  • Nothing appeared loose or chewed in exposed areas so ran temp line. (Note diff port on south wall switch so both lines available at north wall.)
  • Most stuff came back online implying the line was bad in some way that was flooding the network with bad packets.
  • Note barn east motion detector does not seem to be turning lights on.
  • But the Etekcity plug powering cam6 in garage was still offline and needed repowered to work again. Getting plug online did not seem to sort cam6 though.
  • The Inovelli dual plug switch controlling cams 15 and 58 seem to to have stop functioning. I can switch it manually, the status changes in screen and Z-seer says it is responding but it does not seem to respond to command via script or screen controls. 58 kept going off and on so moved off switch to see if that helped.
  • IP cam 73 also on Inovelli dual plug switch in barn that also seems unresponsive to commands. Toggled power via the on button switch but cam still appeared down for several minutes then cam back. Oddly the status only updated for one of the plugs. The side that appears to still be supplying power. 


Some of this might be coincidence or even I just had not noticed but pretty sure cams 58 and 73 have been repowered via script recently. Both are temperamental though in the case of 58 it might be the switch. 73 is on WiFi and WiFi cams I've found just get confused and need resetting a lot.

I should note too even with all the stats in Unifi I'm still not seeing anything that would point to a packet storm though the way non barn things became unreachable till I unplugged the line in the barn would sure indicate that the bad line had something to do with the issue.


Note the final hump in the charts are where the issue happened. But the hump is there it is a good deal less than others shown. Though this is hourly summarized data. I wish I'd thought to grab 5 minute summarized data before it aged off. So I guess there could have been a spike of just few minutes that got normalized over the hour(s).

While writing this I've seen 73 go offline a few times while writing / updating this but it seems it did not connect to the closest AP for some reason so that might be the issue there. Forced to diff AP to see if that helps. 58 though seems more stable but still dropping offline some.

Looks like Netatmo stopped updating the server about the same time as the other mess too. Oddly some of the monitors built into Homeseer are still showing updates with no real pattern.  Rebooted the main indoor module and it seemed to sort itself out after a few minutes.

Update:
Still not sure what happened though I did experience something similar since on a smaller scale after a nearby lightning strike seemed to crash a few things despite them being on surge protectors. There too the Z-wave switch cam 58 was on seems to have died the day the above incident happened.

Update 3/18/2020:
I had replaced cam 58 with an upgrade and thought to use cam 58 to replace and older 1080p WiFi cam as it has been fairly stable running wired. Found if cam 58 runs with WiFi on it crashes after just a few minutes yet still works fine wired. Further implying some sort of EMP issue damaged some of its parts.

Monday, April 1, 2019

Another example of why monitoring is a big part of home automation.

As mentioned in Monitoring: the often overlooked automation. I was alerted my Rachio was offline by Homeseer monitoring my Rachio. Today I received an email the Rachio had detected an issue with one of the solenoids it controls.

This lets me know to go check it, and this case replace it, before the plants start showing distress. 

Saturday, November 10, 2018

Triggering Homeseer from Blue Iris

Using MyMonitor is is more reliable and more automatic than just using trigger URLs but using triggers URLs is quick and simple.

First you need a virtual object to update. An easy way to do this is using the createMonDev method in MyMonitor.vb call it from an event with Parameters of Name,type like
Shot of HS event calling the script

This gets you a device similar to this
Shot of HS object
Note this a full MyMonitor object. If you are just using trigger URLs you only need status for values 0, 3 and 4. Note the ref ID of the object created http://10.10.1.45/deviceutility?ref=5596&edit=1

Now open the camera properties and set action on the Alerts tab for the profiles you use


When triggered
HS_IP/JSON?user=USERNAME&pass=PASSWORD&request=controldevicebyvalue&ref=5596&value=3

When reset
HS_IP/JSON?user=USERNAME&pass=PASSWORD&request=controldevicebyvalue&ref=5596&value=4

Replace the bits in yellow with the value for your setup.


The URLs are set via Configure

Now set the Watchdog URLs
Watchdog triggered (offline)
HS_IP/JSON?user=USERNAME&pass=PASSWORD&request=controldevicebyvalue&ref=5596&value=0
When reset
HS_IP/JSON?user=USERNAME&pass=PASSWORD&request=controldevicebyvalue&ref=5596&value=4


If you want to go the other way (trigger cameras from Homeseer) look at this post in my camera blog

Monday, October 1, 2018

Wanting to monitor your fridge / freezer?

For fridge / freezer monitoring this Wireless Tag is definitely the way to go.   They also give you motion alerts, talk to about anything, cheap compared to most and will even give you verbal alerts in a browser.

There is both a simple interface for things like basic notifications


And a scripting interface called Kumo Apps that lets you do even more and call local URLs making it easy to interface with home automation like Homeseer. There are lots of templates to get you started.

Here is an example of how to send the data to Homeseer
var tags = <#tags_[12|13|26|32|52|62|72|21]_N#>;
tags.forEach(
function (tag) {
tag.updated = function () {

//KumoApp.Log("Updating:"+tag.name);
if(tag.name === "Comp Rack 0"){
 KumoApp.httpCall("http://10.10.1.45/JSON?user=USERNAME&pass=PASSWORD&request=controldevicebyvalue&ref=3121&value="+((tag.batteryVolt - 2.75) / 0.45 * 100),"GET");
 KumoApp.httpCall("http://10.10.1.45/JSON?user=USERNAME&pass=PASSWORD&request=controldevicebyvalue&ref=3122&value="+(tag.moisture),"GET");
 KumoApp.httpCall("http://10.10.1.45/JSON?user=USERNAME&pass=PASSWORD&request=controldevicebyvalue&ref=3123&value="+(tag.eventState),"GET");
 KumoApp.httpCall("http://10.10.1.45/JSON?user=USERNAME&pass=PASSWORD&request=controldevicebyvalue&ref=3126&value="+(tag.rssi),"GET");
 KumoApp.httpCall("http://10.10.1.45/JSON?user=USERNAME&pass=PASSWORD&request=controldevicebyvalue&ref=3124&value="+(tag.temperature * 9 / 5 + 32),"GET");
}

Change the bits in orange of course to match your set up.
That gets you:

  • Battery as percentage (note battery voltage reading is affected temperature. From my experience with my tags, at room temp 3.2 volts is what you will see for fully changed and is about to die around 2.75.  But in the freezer it will bounce between ~2.6 @ 10F and ~2.5 @ 0F. When it drops below 2.5 it is near the end. A little experimenting might be needed to dial yours in. UPDATE: After starting to phase in rechargeables I'm thinking just sending the voltage might be better and adjusting status on the HS side based on historical data. See UPDATE 5/24/2019 below.)
  • Humidity (moisture)
  • Armed Status (eventState)
  • Signal strength (RSSI) in -db
  • Temperature converted to Fahrenheit

See end for sample status setting for virtuals.

How well do they work?

I've been using them for years and on a whim stuck one in the fridge and another in freezer last February along with a AcuRite 00782A2 Wireless Indoor/Outdoor Thermometer (outdoor module in freezer). They stayed close to each other in readings. Note battery life is reduced by the cold. Freezer one lasts only about 3-4 months. Generally they last closer to a year.

You will need a hub "Ethernet Tag Manager" for them to talk to but it is low cost too.

Note though I have had no luck with the Wireless Water/Moisture Sensors The soil moisture never worked and even the temp sensors seem erratic in the new ones. Plus the batteries are not replaceable like the indoor models.

Also if you start seeing random false motion alerts it probably means the battery is about ready to be changed.


Sample Status Graphic setting for the virtuals for above.

Nothing fancy, just using standard icons though I should probably go through and make a full set of 32 by 32 icons given I'm almost to 2000 devices. An 8 kb is does not take long to send and render but 2000 of them plus all associated data can slow your browser down more than you would like.

Note on battery sometimes the batteries read as high as 3.3 volts even in the freezer fresh from the pack. Homeseer will just ignore and value sent that is out of range.

To avoid this set the high end on battery at 120 to 200 so even if you set the freezer formula to a more accurate ((tag.batteryVolt - 2.5) / 0.45 * 100) it will just should overcharged till it settles down. That way a checker like ChkSensors.vb will not mark it as offline. Again, tweak as needed for your setup.


Note the mismatched default sized icons in the following examples that should be made all to be 32 by 32.



UPDATE 5/24/2019:
Note you should probably adjust the battery notification levels.

The default is 2.5. For a tag in the freezer that is a bit high or low depending on battery type. Below shows a tag's voltage report over 3 standard CR2032s followed by 2 rechargeable LIR2032s. Note the "dead voltage" (just before it spikes up from the battery change) for the rechargeables seems lower despite the much shorter run time.
For tags in warmer areas though it looks like more the reverse is true. 2.85 to 2.75 seems a better setting for these with CR2032s but the rechargeable have held a steady 2.84 since install 15 days ago.
In the fridge the batteries seem to almost match. Here is the chart for the tag in there. The first 2 are CR2032s and the third a LIR2032.

I should note the gaps in the above charts point to how important monitoring the battery level and or a heartbeat of a sensor is. With your notification level too low you might not know for days that the sensor if offline.

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.