My Rooms Plugin - Under Development - Comments welcome

Posted on
Thu Jan 21, 2021 6:02 pm
whmoorejr offline
User avatar
Posts: 532
Joined: Jan 15, 2013
Location: Houston, TX

My Rooms Plugin - Under Development - Comments welcome

I'll probably delete this once I get it developed, but I wanted some discussion space specific to this.

Basically, this will be a copy of the My People plugin but for Rooms instead of humans. My current question / issue is CCTV implementation.

For My People, adding a picture of the person to a control page isn't hard. Create an image for each person and name it "MyPeople+friendlyname.png", put it in .../images/controls/devices folder and you should be able to scroll through faces when you go through your people using "NowShowing".

For My Rooms, I'd like to be a little more dynamic by implementing CCTV (if applicable to that room). You could do the same thing as above for a still image "MyRoom+roomname.png" and use that for the device's "roomname" state.

For a dynamic image, this may work, but it would have to be outside of the plugin because there are too many variables to overcome (how to access every type of camera, etc.). Also, as I'm typing this, I see that it will work, but I can't wrap my head around a way to limit the amount of traffic it would create (with your camera, with python scripts, etc.)

"Trigger A" would fire whenever the state (room name) of the "NowShowing" device changes
    Condition = state.roomname = RoomA
    "Script A"... Whatever mechanism you have for obtaining a snapshot of your camera, a script (Script A) would have to be added to pull the snapshot and save as a png file in the same /images/controls/devices folder. "MyRoomCCTV+RoomA.png"
    Change a variable "MyRoomCCTV" to "http://URLofIndigoServer/images/controls/devices/MyRoomCCTV+RoomA.png"

You now should be able to use Jay's variable URL Redirect plugin to put the image on a control page using the URL: "http://URLofIndogoServer/varialbe_url_redirect/redirect?name=MyRoomCCTV" as a refreshing image sized however you want it. This wouldn't be "live", but it would be a recent image.

Since this would only get one snapshot at a time, it would refresh whenever you forward or reverse through rooms. If you change the script to continually run and continually update the "RoomA.png" then you would also need scripts to shut them off. While they are running, like if you advance to a different "NowShowing" page and walk away, that script will be running continually (which I'm pretty sure will booger up something)

I would like peoples thoughts on this and what kind of device states would be good for a My Room plugin.

Bill
My Plugin: My People

Posted on
Sat Jan 23, 2021 8:30 am
ryanbuckner offline
Posts: 607
Joined: Oct 08, 2011

Re: My Rooms Plugin - Under Development - Comments welcome

Can you be a little more specific on the features of the plugin ? Is the intent to know who is occupying each room?

Posted on
Sat Jan 23, 2021 9:33 pm
whmoorejr offline
User avatar
Posts: 532
Joined: Jan 15, 2013
Location: Houston, TX

Re: My Rooms Plugin - Under Development - Comments welcome

ryanbuckner wrote:
Can you be a little more specific on the features of the plugin ? Is the intent to know who is occupying each room?


I probably should have started with a general description of what I have lined up for the plugin so far....

The My Rooms plugin will allow you to create a custom "Room" device. No set-up, just name the room. Example, if you name the room, "Master Bedroom". Now you have a device called "Master Bedroom." So now you will have 2 rooms, "Master Bedroom", and "Now Showing" <-- More on that below. :D

This is where it gets interesting. Each Room device will have multiple empty states. The states can be populate a few different ways. You can use the plugin's actions to add state information either directly or with a trigger you set up. The content of each state is an empty text field that can be anything you want including a VariableID or the Device.State of another device.

Available device states / examples (so far)
    Name : “Master Bedroom”
    Address: Used to populate the address field on indigo main page
    Occupied: Can use the device state of another occupied plugin or from your own trigger set up.
    MainLight: Device.state of the main room light
    AccentLight: A secondary automated light
    CeilingFan: Device.state of ceiling fan
    Audio1: Can be the power status of a radio, Sonos, airplay, etc.
    Audio2: Can be another audio device or use to display what’s playing on Audio1
    Video1: Can be the power status of a TV, etc.
    Video2: Can be another video device or use to display what’s playing on Video2

Other device states include:
    MotionDetect:
    MotionDetectLast:
    CCTV:
    Door1:
    Door2:

At the end of the list there will be some generic states as a catch all (not everyone has a Frog Warmer, as an example)
    AUX1:, AUX2, AUX3.


The benefit of setting up the Rooms of a house this way mostly has to do with control pages.
1) If you set up a control page, it will be easy to track down devices as you build out a room. Select “MasterBedroom” and the state you want to display (Main Light, MotionDetect, Occupied, CeilingFan, etc..)

2) If you delete an actual device, like the MasterBedroom Ceiling Fan, you don’t have to track down all the control pages that address it as a Room device. You will just need to add the new device state to your Room device and the control page will be just fine.

3) The plugin will create a “Now Showing” Room device. There will be actions that can go to First, Last, Forward and Reverse. So, you could make 1 control page for a Room and use the Room Device “Now Showing” and add buttons that go Forward, Back, etc. As you hit those buttons, the “Now Showing” device is overwritten by the Rooms you have created. So, 1 page for every room in your house. <— That’s my favorite part.

4) The other benefit to being able to make a single page for all your rooms is the simplicity. No more making pages then going back in to update all the links that go from page to page.

At this point, I’m waiting on some feedback to see what other states should be added and explore what other capabilities I can put in it…. Like having a CCTV image associated with a Room. <— I’m a little stuck on this one as Indigo Control Pages aren’t really meant to be Dynamic.

Bill
My Plugin: My People

Posted on
Mon Jan 25, 2021 5:03 pm
mundmc offline
User avatar
Posts: 863
Joined: Sep 14, 2012

Re: My Rooms Plugin - Under Development - Comments welcome

I love that you are doing this! This and your MyPeople plugin feel like the two things Indigo has been missing. Looking forward to testing...

Posted on
Tue Jan 26, 2021 9:30 am
whmoorejr offline
User avatar
Posts: 532
Joined: Jan 15, 2013
Location: Houston, TX

Re: My Rooms Plugin - Under Development - Comments welcome

Because this plugin "My Rooms" will have a lot more custom states than the "My People" version... I'm working on formatting at the moment. I have a question posted on the forum about the order of states on the GUI and Control page. Example, if you have states RoomName and MainLight, they will be in the order (MainLight, RoomName). I want it the other way.

So, I will probably group the device states.
    001 - 099 Identifier States [Room Name, Room State (for GUI), Building, Floor <-- For those with multiple levels, out buildings, etc.]
    100-199 Occupancy States [isOccupied, LastOccupied, LastVacant, WhoOccupied1, WhoOccupied2]
    200 - 299 Standard Device States [Lights, Fans, Blinds, Outlets]
    300-399 Audio-Visual Device States [Television, Roku, AppleTV, DomoPad, VisualDeviceOther, AirPlayDevice, AirfoilDevice, AlexaDevice, Sonos, AudioDeviceOther]
    400-499 Security Device States [FrontDoor, BackDoor, LeftDoor, RightDoor, SideDoor, Window1, Window2, MotionDetected, MotionLast, CCTV_Image, CCTV_State, OtherSensor]
    500-599 [Blank for now, pending comments, suggestions, or future use]
    600-699 [Blank for now, pending comments, suggestions, or future use]
    700-799 [Blank for now, pending comments, suggestions, or future use]
    800-899 [Blank for now, pending comments, suggestions, or future use]
    900-999 Auxiliary/Custom States [Aux01_Name, Aux01_State, Aux02_Name, Aux02_State.... [/list]

I think it will look a little odd, like for "FrontDoor" on a control page you will scroll down to "400 Front Door", but at least it will put it in a logical order. But I'm still experimenting with naming to see what other options I have.

There are some capabilities that I'm unsure of until I get further along in the plugin. Like Pop-Up UI Controls on a control page. If there is a "Fan State" on a Now Showing device, will that open up fan speed controls?

Any thoughts on additional states or state ordering/grouping/organizing?

Bill
My Plugin: My People

Posted on
Tue Feb 02, 2021 11:34 pm
whmoorejr offline
User avatar
Posts: 532
Joined: Jan 15, 2013
Location: Houston, TX

Re: My Rooms Plugin - Under Development - Comments welcome

I'm actually getting close to having a full-functioning plugin. There are a couple python hurdles I have left, but the concept is all laid out and functioning.

There is now a Plugin Config option to set the polling frequency. While testing with 4 rooms, my CPU never went over 0.2% with a 5 second refresh on device states. But just in case someone sets their rooms up a little funkier with more cross-referenced devices, there is the option to increase the time between polling.

There is an action to update all device states now... so if the polling is dialed way down, you can get the device states via action if you want.

The Now Showing Room address field on the GUI will display the name of the room that it's mirroring.

There is a Now Showing Room - Specific Room action that brings up the list of room devices to select from.

For state updating, there is one for the Room Display State (the icon and state on the GUI)

For the remainder of the states, there are three options: Update by text, update by state, update by variable. With all three, the dialog prompts you to select the room from a dropdown of all your rooms. Then select the state from a dropdown that shows all your states and their current value, then...
With update by text, you can enter any word, a %%d:device:statekey%% or %%v:VariableID%% and those will all be accepted.
With update by state, you select a device from a dropdown box with all your indigo devices, then a drop down to select the state for that device you want.
With update by variable, you select a variable from a dropdown off all your indigo variables.

On the bottom of the dialog there is an "UPDATE NOW" button. So if you are filling in multiple fields in a new room, you can click that then change the room.state and so on until your done... or you can save and execute like any other action.
Attachments
Screen Shot 2021-02-02 at 11.29.25 PM.png
Screen Shot 2021-02-02 at 11.29.25 PM.png (53.59 KiB) Viewed 488 times
Screen Shot 2021-02-02 at 11.27.40 PM.png
Screen Shot 2021-02-02 at 11.27.40 PM.png (56.41 KiB) Viewed 488 times
Screen Shot 2021-02-02 at 11.28.29 PM.png
Screen Shot 2021-02-02 at 11.28.29 PM.png (58.66 KiB) Viewed 488 times

Bill
My Plugin: My People

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest