Announcing HousePanel Control Panel [Alpha]

Thanks Joe @Keo for both awesome thoughts. I’m focused right now on getting webCoRE integrated. Good news @ady624 that I got the first integration version working tonight. Man was it easy using your Integrator code samples. I won’t upload it yet because I’m away on travel and I can’t really test it thoroughly without scaring the crap out of my dog sitter so you all will have to wait a few days. Here is how it is integrated:

  • first, the Options page was changed to be a standalone page instead of a Tab
  • each Piston is automatically read and listed on the Options table near the bottom right after the Modes are listed
  • When a piston is checked on a column, that Piston is shown as a tile that is executed when it is clicked on.
  • the CSS classes “piston webcore” and “piston pistonName” are assigned to the two text fields listed. In CSS the first one can be converted to a piston image and the second one contains the piston name.

Here’s a screen shot without any CSS styling added.
image

Now… regarding Hue IP calls, I will turn to this next and of course any help is always appreciated. If the V1 bridge is very different than what you currently use I think I will skip that and just buy a current one. I can justify this in the name of hobby research! LOL.

1 Like

Hey @ady624 I used this and it worked great. Can the list function be expanded to return other piston state information such as whether it is paused. Perhaps I can try adding select defined variables aimed at house panel to do custom styling. At a minimum I would want to show paused pistons differently. If I succeed do you have this in Github somewhere?

1 Like

Welll @ady624 - I stared at the code for hours and can’t figure out how to get more info from the pistons. There are so many state variables and levels of indirection that I got lost. Your help would be appreciated.

Announcing webCoRE integration!

Thanks to the super-easy connector code provided by @ady624 I am able to provide a simple but very effective integration of HousePanel with webCoRE. Any piston can be set up as a Tile in HousePanel and in keeping with the intent of HousePanel, those tiles can be customized and styled with CSS uniquely. Here is how it works. If you already have HousePanel, just reload your web page and then go to Options. All of your webCoRE pistons will show up on table as a tile that can be selected for inclusion in any page. The type shown in parentheses will be (piston).

Once you add a piston tile to a page of your choosing, you should go and edit your CSS file and style your piston to your liking. The CSS class tag is “piston pistonName” and “piston webcore”. The default skin-housepanel CSS file has been updated to include a reasonable default treatment, but you might want to add a cool “png” file of a piston. I might add one if I have the time.

Note that pistons are fired when clicked, but if there is an “if” condition in the piston the piston won’t do anything unless the “if” condition is satisfied (and it probably won’t be), so for pistons activated by the panel, you should make some pistons with just actions included like this one.

When this piston is clicked on in my setup, the office lights toggle. WooHoo!!!

Of course the whole point of adding this integration is to enable much more complex pistons that create actions that can’t be done any other way easily. I am leaving that up to the reader to play with.

Enjoy.

8 Likes

I figured out how to put the back-end groovy file into the SmartThingsPublic area on GitHub. Here’s what you need to do. Follow the directions for linking your GitHub account to your SmartThings IDE account. Click on Settings and enter “kewashi” in the Owner field, “SmartThingsPublic” in the Name field, and “master” in the Branch field. Don’t enter quotes. When done right it should look something like this:

image

Then hit save. After that you should select “Update From Repo” and then select the HousePanel file in the long list on the right side under kewashi/house-panel. Be sure to click on the little box that says publish.

Whenever you want to update you just go back and click “Update from Repo” again but this time the app will be shown as updated in the list on the left. Select the box and proceed.

It sounds harder than it is. If you want to do this manually, just go into GitHub and navigate over to my SmartThingsPublic/kewashi/house-panel fork and download the raw source as you have done before.

**** IMPT *** I will be removing the original GitHub repo that was not part of the SmartThingsPublic directory tree in the next few days.

So I’ve played with video feeds by injecting some HTML in your debug section. It’s not very straight forward due to the many standards. If there is an MJPEG stream then stuff kinda works okay but ONLY in Firefox. My recommendation would be to have a flexible widget/DIV that I can add to any room which simply allows me to add free-form HTML like the below. This extends abilities for anybody who wishes to do so.

<img src="http://uid:pwd@192.168.0.1/cgi-bin/snapshot.cgi?chn=1" alt="Amcrest" width="320" height="240" border="0">
<img src="http://uid:pwd@192.168.0.2/nphMotionJpeg?Resolution=320x240&Quality=Standard" alt="Panasonic" width="320" height="240" border="0">
<img src="http://uid:pwd@192.168.0.3/mjpeg.cgi" alt="D-Link" width="320" height="240" border="0">

As an FYI, Home Assistant, Node RED and MQTT Broker for ST are looking very impressive at the moment. So far, lots of Node Red learning. Now migrating to Home Assistant and MQTT Broker which runs as a Docker container.

I’ll download your latest to see how it’s moving forward.

All the best!

UPDATE:
Sadly, the below was supposed to fix Chrome (by adding this flag --allow-cross-origin-auth-prompt) but it doesn’t. When I right-click on the broken image from HPanel and “Open Image in New Window” the video feed works as expected. So it’s cross-site basic authentication that’s broken/secured in Chrome…
https://bugs.chromium.org/p/chromium/issues/detail?id=308999
https://bugs.chromium.org/p/chromium/issues/detail?id=513590

Yah… That’s a real bummer. We run into this in ActionTiles all the time, unfortunately.

Chrome is also blocking URLs with embedded basic auth: uid:pwd@192.168.0.1

darn - so close yet so far away. Thanks for making so much progress nonetheless.

1 Like

Hi good people… long time no post… well I’m super excited to share with you all the following update to HousePanel. With the latest version you can now use HousePanel as a generic EndPoint to call from either Python or EventGhost. Both work equally well but Python is more flexible of course. To use first update your code from the HousePanel main repository. Be sure to get both the front end housepanel.php file and the back end HousePanel.groovy file. They are in separate GIT repositories.

As a reminder, the front end is here:

and the back end is here:

To use HousePanel as an EndPoint start by launching your browser and invoking:
http://yoururl/housepanel.php?useajax=showid

Where yoururl should be replace by where you installed the housepanel.php web site. This will retrieve a page that gives you all the info you need to make your Python or EventGhost script. The page returned will look something like this:

Once you have this info, you can turn on any switch, query any thing, or do any other action that HousePanel knows how to do using strings that look like:

http://yoururl/housepanel.php?useajax=doaction?id=abcd1234
or
http://yoururl/housepanel.php?useajax=doquery?id=abcd1234

Of course you have to use the full id from the list returned by showid. The first call will toggle any switch. The second call will query any switch. You can use locks, momentary buttons, contacts, thermostats, and anything else supported by HousePanel in the above calls. The only catch is when you use doaction for something other than a switch you have to also supply the attr GET variable. You can find what those variables need to be by looking at the doAction and doQuery functions in the housepanel.groovy file. I will document it more fully at a later time when I get around to making a Wiki.

The doquery calls return a Json string that you can parse to use however you like. For example, the following call:
http://192.168.xx.xx/smartthings/housepanel.php?useajax=doquery&id=123abc3-1234-1234-1234-abcaf1234

will return the following result:
{“temperature”:75,“heat”:68,“cool”:72,“thermofan”:“fanAuto”,“thermomode”:“cool”,“thermostate”:“cooling”}

The parameters of the above example were redacted of course but notice that I only had to provide the ID and HousePanel figured out that it was a Thermostat device on its own.

You’re probably wondering why this is such an exciting development. Well, just take a look at the EventGhost website (http://www.eventghost.net/) and you’ll immediately connect the dots. With this feature you can now tie HousePanel to any event invoked by your PC via the EventGhost application. If you are the adventurous type you can skip EventGhost and write your own Python application that interacts with your Smart Home. The possibilities are endless here folks.

Hope you enjoy. I would love to see your feedback, ideas, and examples.

6 Likes

I should have mentioned that you can also use the POST method and it works equally well and is more secure. Also, you will need to provide the access_token and endpt variables as either GET or POST variables. You can skip this is you are using a web browser since it will pick up the Cookies from HousePanel. If you invoke from Python or EventGhost you will need to provide these variables in your invoke string. This is why POST is better.

1 Like

A few more updates related to the above. First, the name of the parameters you need to use for token and endpt are “hmtoken” and “hmendpoint”. This is demonstrated in the example below.

Also, I wanted to use this to keep my office alive when I am sitting at the computer. So I wrote a modified zWave device handler that allows me to manually set the mode to active and inactive. Coupled with the EndPoint features of HousePanel this allowed me to write a Python script (EventGhost could have also been used) to trick my SmartThings environment into thinking that I are moving around the room actively when instead I am sitting intensely writing code or playing my favorite game. The script is in the same GitHub as the front end php of HousePanel - sorry, but I was being lazy and didn’t want to set up a separate GIT repository for just this.

Below is the script that I wrote that uses a HousePanel endpoint and the above referenced custom motion sensor to keep my office motion alive. Replace “blahblahblah” with your specific data and you should be good to go. Just load it into Python and run it. Don’t forget to launch http://yoururl/housepanel.php?useajax=showid first to reveal your ID numbers. If you use the same browser that you use for HousePanel you will be able to skip the authentication step.

import urllib
# Keeping the motion sensor alive in my office when I am on the computer
# Start with identifying my HousePanel generic access information
# this can be obtained from running housepanel.php?useajax=showid
token = "blahblahblah"
endpt = "https://graph.api.smartthings.com:443/api/smartapps/installations/blahblahblah"
url = "http://192.168.11.20:80/smartthings/housepanel.php"

# specific the ID of the motion sensor in my office
# this can also be obtained from running housepanel.php?useajax=showid
swid = "blahblahblah"

# to speed things up we specify a motion sensor, but this could be blank or auto
swtype = "motion"

# specify the token, endpoint, flags, and sensor information
params = {"hmtoken":token, "hmendpoint":endpt, "useajax":"doaction","id":swid,"type":swtype,"value":"active"}

# invoke the action by using default Python calls
params = urllib.urlencode(params)
result = urllib.urlopen(url, params)

# show the result which should be a simple Json string of the new status for the motion sensor
print result.read()

To set dimmers and operate Thermostats you will have to also set the attr parameter. Basically you will need to mimic the AJAX calls made in the housepanel.js file so take a look at the source and it will be obvious.

Next version coming soon… new features will include battery indicators, sprinklers/valves, and more flexibility for invoking via Python. Should post tomorrow… Let me know if you have any major requests.

1 Like

Hi. Do I need some sort of invitation to test your House Panel ?
I have two Pine64`s I dont use for anything atm,

Is there a video of this in action?

Nope. It is open. Just clone and give it a try.

1 Like

No but that is a great idea. I will add to my todo list. In the meantime there are static screen shots earlier in this same topic thread. I am also working on a Wiki to explain the increasingly complex features including how it can be used as a web endpoint with python.

A video tutorial for the install on a Pi would be great as well

Hi everyone… I posted on GitHub an update that does some cleanup. This includes a browser icon and faster background loads. I added a cool icon for WebCore pistons that are now supported. This version also includes support for Valves which I have only tested with a Rachio sprinkler system since that is what I have. No cool graphics for that one yet unfortunately. Finally as always I squashed a few bugs along the way.

I am not ignoring the requests for video tutorials. I’m working on it and will post soon as it is done.

2 Likes

No, but several still photos are earlier in this thread. I will include a video in action as part of the overall video install project that I am working on. Good idea.