[RELEASE] HousePanel Dashboard Beta 1.0 Under Open-Dash Brand

project_dashboard

#1063

Hello,

I have been following your project and posts, first of all, great work! I wanted to ask how direct push method would work for hubitat or smartthings? I know you can subscribe to devices within smartthings, and ST sends instant update to let’s say a logstash server you may be running on AWS, but if my HP is also on the same AWS server, what would I change in the php code to compensate of ST sending me data rather than HP doing a GET/polling?

Thank you


(HousePanel Author) #1064

First - thank you for the positive comment. Replacing polling with a direct notification push was one of the first things I looked into doing in the early days of HousePanel. I learned how to do it and eventually abandoned the idea because I was concerned about opening my home to the open web. So before going further let me state the obvious that to do this you will need to either host your HP on a public server like AWS or open your home server or rPi to the open Internet by poking a hole in your home firewall. I wasn’t willing to do either.

So, it looks like you may try going the AWS route. If you get that working I’m sure others would love to hear about your experiences, so please do share here. Once you have HP set up and working in AWS, making the changes to do a direct poll are pretty straightforward. Basically you will just need to push a JSON object to the updateTile routine in the housepanel.js javascript file. This can be found in roughly around line 1100 in the file. Basically this function finds the jQuery handle and then updates all tiles on screen with the items loaded in the “presult” JSON object. Something like:

 function updateTile(aid, presult) {
    // do something for each tile item returned by ajax call
    $.each( presult, function( key, value ) {
        var targetid = '#a-'+aid+'-'+key;
        $(targetid).html(value);
    }

This is pseudo code - the real code has other stuff in it to handle sliders, weather, batteries, and complications, but this is all you need for push updates. The presult JSON object has to have valid variables like {switch: on} for lights. In this simple example, the key is “switch” which is converted to the jQuery target, and the value to add to the HTML code is “on”.

The polling calls groovy code which loads these objects in an Ajax callback. The PHP is used only as a pass through wrapper. You can see how this works by staring at the doAction function in the PHP code. However, none of this will be used in your direct push method. To implement direct push you will need to write changes to the HousePanel.groovy code to subscribe to all things you want to direct push update. Then you need to write the groovy function to send the update to your AWS server with the JSON object loaded reflecting the subscription result. This is the step that will require you to know the AWS server location and handle any authentication stuff. This is the hardest part by far. If you were to use a local rPi one way would be to just open your firewall, use a weird port number, and you’re all set with a groovy HTTP post. Anyone with a web sniffer and basic hacking knowledge would be able to grab your codes and wreak havoc on your sanity so you’ve been warned.

I have no experience with AWS so I don’t know how the authentication and remote function calling works. Ask Alexa uses it so I think you could use that as a template. It might be easier to convert updateTile routine to a node.js function that AWS seems to prefer. Again, I’m now out of my domain of experience so enlighten us all if you make progress here.

Good luck!


(HousePanel Author) #1065

Okay folks… one last teaser before I post the updated TileEdit feature. Here is a screen shot of what the new editor looks like doing its thing on a Music tile… I just have to fix one last bug and do a few more days of testing…


(HousePanel Author) #1066

[RELEASE] HousePanel Version 1.6

Includes major rewrite of TileEdit function. See prior post for a screen shot of its many new capabilities. Every item on any tile can be edited visually. To edit an item, click on it before selecting the desired icon or color on the left. If that item has multiple states those states will cycle upon each click. Even level sliders can be changed in color.

The media icon directory is now available to use as an alternate source. Fonts can be picked. Almost everything can be resized. Special background effects are included.

Original idea and inspiration credit goes to @nitwit

Please play around with this and report any bugs here. The custom header name is the only thing I don’t yet have working. The rest of it should work as designed, but with any major new feature there are likely bugs.

One big change from prior versions is the customtiles.css file is no longer a skin specific thing. There is only ONE custom file that can use any skin that is active. That file MUST be placed in your main directory and given write priviledges. That should happen automatically but if it doesn’t you need to do it manually.

Enjoy.


(Saj Varghese) #1067

how to update to the new stuff?


(HousePanel Author) #1068

Download or clone the files at the GitHub here:

This update requires a manual update to HousePanel.groovy and several others files on your local server.


(Bilal Bham) #1069

Hi Ken,

Thankyou for your hardwork, I just got this working on my windows server, Lots of trial and error but your wiki was very good.

Only stumble i had was curl (Had to update the php.ini “extension=php_curl.dll”)
updating IIS for a local website
and the permission for windows (iusr) user

My big reason for this was to try and get a video feed working, How have you managed this ?, I can’t seem to see in this thread or action tiles anything on a returnvideo() function?

Is this something documented ?

again thanks for all your hard work.


(HousePanel Author) #1070

Glad you got it working. Video suppprt is a bit of a hack at present. I use Arlo cameras so I have a python hack that save a video mp4 file on my rPI that HousePanel reads. Take a look at the HousePanel.php code by searching for “video” and you will see how to do it.

Ken


(Bilal Bham) #1071

Thanks, Im looking now, Im not a coder so apologies if this is a daft question, I’ll google my way though this but am i correct the src=“media/arlovideo.mp4” is a single video file.

Can this approach be used if we have multiple cameras ?


(HousePanel Author) #1072

Yes - this is a single video file. My server has a script installed to grab the latest video taken every 5 minutes and save it to this file name. I do it this way only because arlo does not support a direct IP video feed. So this is a workaround that uses a python script to grab the feed using their provided user web page.

Most cameras provide a direct method to grab a video mp4 or stream so this isn’t needed. Depends on your camera. Scroll up and search for lots of examples of how others have done this more directly with HousePanel


(HousePanel Author) #1073

I can update the code to support 4 video feeds. Presently there is only one. There are 4 image tiles that can show video if you use the iFrame trick described in an earlier post 230.


(Chris Wilson) #1074

@kewashi
Hi Ken the new tile editor is phenomenal.
If I could make a request though - it would be nice to have confirm button for the color pickers. I find clicking elsewhere to confirm can lead to clicking other t hings you may not want to. - just suggesttion.

At this point HousePanel is the only theing keeping my smartthings hub online. - Could really use the ability to not have smartthings as a requirement. hint hint…


(Chris Wilson) #1075

Also just noticing it seems some tile types will not open the tile editor? Piston, SHM, blanks?

Weather tile has this box around it - can it be removed?

image


(HousePanel Author) #1076

I agree - great suggestion. I have that issue too. This is a minicolors issue but I will explore a workaround.

On the other issue I got the hint. I think it is an easy update but I’m not home this week. Maybe this weekend.


(HousePanel Author) #1077

Hmmmm sounds like a bug. Probably an uncaught JavaScript error. Will explore this weekend.

On the weather tile, yes the box can be styled and removed via a css edit. Not sure what you mean by the box.


(Chris Wilson) #1078

I think what I am seeing is the border around the weather tile. I suppose you are right - should be easy enough to find in the css file I hope.

Not a big deal really.

You are a smart guy lol I looked right after you I saw your post.

Uncaught TypeError: Cannot read property 'indexOf' of undefined
    at sizepicker (tileeditor.js:508)
    at editSection (tileeditor.js:450)
    at editTile (tileeditor.js:583)
    at HTMLDivElement.<anonymous> (housepanel.js:805)
    at HTMLDivElement.dispatch (jquery-1.12.4.js:5226)
    at HTMLDivElement.elemData.handle (jquery-1.12.4.js:4878)
sizepicker @ tileeditor.js:508
editSection @ tileeditor.js:450
editTile @ tileeditor.js:583
(anonymous) @ housepanel.js:805
dispatch @ jquery-1.12.4.js:5226
elemData.handle @ jquery-1.12.4.js:4878

(HousePanel Author) #1079

Yea I fixed a few like this but looks like I missed a few. Will fix it this weekend when I get home.


(HousePanel Author) #1080

On the border, try:

div.overlay.weather div.weather-thing {

border-left: none;
border-top: none;
border-right: none;
border-bottom: none;

}

(Chris Wilson) #1081

I just have to keep coming back to say HousePanel is awesome.

@kewashi
I think the api is a very overlooked feature. I found Node Red recently and having all these endpoints available is super convenient. I can query status of devices through alexa.

Thank you again Ken.


(HousePanel Author) #1082

Thanks again Chris. I haven’t played with Node Red but it sounds like a perfect HP companion. I agree about the API. It is my favorite feature yet hardly anyone uses it.