Tracking Open Windows

I couldn't find this in HPM (might not have refreshed yet...?), but was able to manually install it just fine. I agree with you, the only way tying it to Rooms would be similar to how it's setup with RL, where it pre-populates the respective windows and doors, but then you can add others. I'm not sure if your logic could differentiate between what contact sensors are for windows and which are for doors though - seems to be more headache than it's worth. It's not an issue to me to have to manually check which windows and doors you want to apply to the group.

I haven't fully set things up to test it completely, but I do have a few questions based on my first trial:

  1. Did you mean for this to be a new app or to be a sub-app under your Sensor Groups+? I had to install it as it's own app. That's fine by me, just didn't know if that's how you wanted it setup.
  2. When installing the app and being prompted to create a sensor group, it's being added as an app and then a virtual device... but in order to create multiple groups, you have to create multiple instances of the app. Can you rework the app to create one app and then the different room groupings are created underneath that app? That would make it much cleaner on the UI. See below photo for reference.

FWIW, if the coding doesn't matter on your end, I could see this being just another child-app of your Sensor Groups+ app.

  1. To minimize on confusion, I'd rename it "Whole House Fan Sensor Groups+" and not "Attic Fan Sensor Groups+" - an attic fan is installed on the exterior of your roof to help pull hot air/humidity out of your attic. A whole house fan is mounted on the ceiling of the floor below your attic to pull air from the house out through the attic. A small nuance, but could create confusion down the line for others trying to find your app.

Separately - if you did keep it as a separate app and were able to do child-apps for the different room groupings, if there was a way to then add a 2nd piece to the app that added each of the counts from the child apps to get your total count, that would be the crème de la crème for whole house fan automation!

1 Like

This is all good feedback. I started running it standalone in case it deviated too much from the idea behind Sensor Groups+.

Let me put in some work on the other points. In the mean time, would you mind setting one up (maybe the room that you have the two door situation) and testing a bit? I do most of my testing with virtual devices, so some real world use would be nice.

1 Like

I created a group for my primary bedroom (5 windows behind 1 door) and a group for the ensuite primary bathroom (1 window behind 2 doors) - both are working as desired with their respective doors closing zeroing out the window count!

1 Like

Cool. I'll get this added as an additional child app in SG+.

And I totally know the difference between an attic and whole house fan. What I get for trying to slap this together in a hurry :joy:.

2 Likes
2 Likes

I was able to create WHF device groups for the rooms that have doors just fine with the updated app, @FriedCheese2006. But I'm having difficulty trying to figure out how to get them added together with RM. I figured I could do it with RM and a global variable, adding the device attribute "TotalOpen" of each of the window groupings together... But that doesn't seem to be an option in RM like I was hoping...
You can set the variable to be equal to a device attribute. You can add a number to a variable. You can add 2 variables together. But, it doesn't seem like you can set a variable to device A attribute + device B attribute + device C attribute, etc. You also can't add more than 2 variables together - otherwise I could have several rules to set several variables equal to the different rooms' "TotalOpen" and then add the various variables up... Not ideal, but could work.
@danabw - how were you planning on using the TotalOpen data for controlling your Whole House Fan?
@bravenel - am I missing something? Do you know a way how to add up several global variables or add up several device attributes to equal a global variable that can then be used in RM?

This is the part I was getting at with being able to get you most of the way to your end goal.

You'll have to set a local variable for each TotalOpen attribute.
Then have multiple actions to add them together into a "Total" variable.

Unless someone else can think of something. I could write another child app as an "overwatch" of sorts but that's getting a little sidetracked from my original intent with SensorGroups+.

I hadn't gotten there yet, busy w/silly stuff my wife calls "important" :wink: so haven't been thinking about it in detail yet. But the issues you raise do seem to complicate things more than I expected. I should note that I don't even have sensors on the internal doors yet, so putting those sensors on in a way that my wife is happy about (or not too unhappy about) will be the first hurdle before the next steps.

Ahh, I see... You can use the Variable Math option and then just have to keep referencing the variable and adding to it for each line of the RM rule...

Interesting approach. I guess it works, albeit a bit clunky. It would be nice if you could just select from the list of variables to add them together under the "add number" option or an additional option to "Add variables".

And yes, @FriedCheese2006, I agree, an additional "overwatch" portion to your SG+ app doesn't really fit the purpose of that app, which is why I was saying earlier that it'd work better as a standalone app specific for window counting for a whole house fan.

It seems like it's doable to piece together with what you've already put together and the different variables + RM logic, but I imagine a dedicated app would be better suited for this purpose.

It would, but being that SG+ was the first app I've ever written, I was trying to focus on getting it to where I wanted; mostly to figure out mistakes along the way.

For example, I realized I could've just had a single device driver that covers all the app capabilities. Now, I'm trying to figure out the best way to flip to a single device type. At this point, it looks like I'd have to get users to manually switch existing devices. Stuff like that is mostly immaterial for front end users, but it would make maintenance a heck of a lot easier on the dev side.

There's other things on the backside I'm still figuring out. Like HPM. The docs for devs are pretty bare bones so it's a lot of trial and error.

3 Likes

Happy hunting. Removed tags.

Well, I'm trying not to bother folks every time I run into a hurdle. I don't mind the work of try, test, try again...

1 Like

OK, I get what you mean, investigation can be fun, and solving things rewarding. I'll un-tag them.

1 Like

It just has to be done with serial actions, each adding a one variable to another, keeping a growing sum. Or, you could write a small Groovy app to do this.

@nathaniel.knautz @danabw

"Window Tracker" has been released to HPM. There's a child app for monitoring the windows and doors and a second child app to aggregate stats.

2 Likes

Exciting! I'm looking forward to testing it out. Thanks @FriedCheese2006!

Wow...I don't know who hired you, but that person deserves a raise! :wink: :smiley:

Thanks for all the stuff you're sharing.

If my basic math skills still hold, it looks good to me!

Aggregate:
2022-09-24 16_06_42-Chrome Main

First Child:
2022-09-24 16_07_03-Chrome Main

Second Child:
2022-09-24 16_07_24-Chrome Main

1 Like

I managed to get it installed and all the rooms setup, and it works great! I like that I can just use the virtual group devices from SG+ for rooms that don't have a door restricting access so I don't need to set them up in this app too, and it still includes those open windows in the count. Truly excellent work. I'm envious of your skills! Thanks again for putting it together, especially so quickly!

1 Like