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

project_dashboard

(Chris Wilson) #1023

I was having trouble with smartapp acting wonky when I tried using the latest updates. Maybe try reinstalling your smartapp? I found settings were being lost every time I tried to authorize. May be worth trying to reinstall the smartapp?


#1024

So you’ve got your Hubitat devices showing up? I may try installing from scratch in case an ID changed, but I had double checked all that, permissions etc.


#1025

I tried reinstalling both ST and Hubitat apps. If I turn off ST from the Hubitat app, it disables ST, so there seems to be some interaction. However, I still can’t get the Hubitat devices to show up at all, including options page. The ST devices show up and work normally. I don’t know if it’s just me missing something on the Hubitat side?


#1026

I’m making some progress and now have it recognizing the Hubitat devices. The complete reinstall helped and I corrected an error I had on the clientinfo.php after I had reinstalled. Seeing some strange things on selecting devices, but probably user error still :(.


(HousePanel Author) #1027

Wish I could test mine but I’m not home so I can’t get inside my firewall. Are others having any problems with hubitat devices?


#1028

Hubitat side working fine now. The issues I’m having now are more on the options side and may be just me getting used to the new app. For instance, the good morning routine keeps populating pages and multiplying itself despite me removing it.


(HousePanel Author) #1029

Okay - this is good to know. I stared at the code and couldn’t see any reason Hubitat should be any different than before. Thanks for validating that. Regarding routines, I don’t use them often so they haven’t been battled tested. With that said, I just added one to a page and ran it and it showed up in the log as expected with no weird side effects, so it appears to be working. This was after I dragged it from the catalog. Be sure to go into Operation mode after dragging and before invoking, otherwise you will just end up dragging it to a new location. I then removed it and that worked too. Not sure what’s going on with your setup.


(Dan Fox) #1030

Hubitat seems to be working OK, but some devices look funny in the tiles.


For instance, all the doors are contact sensors, but Garage Door & Inside Garage Door have no icons and I don’ t know what the blue bar at the botttom of the side door is about.


(HousePanel Author) #1031

Doors typically also support the contact capability so you may need to drive the door type in your CSS file. Best thing to do is to inspect the tile in Chrome to see what is going on and then adjust your CSS file accordingly.

The extra blue bar is likely a healthStatus or a power report. Again, an inspect will reveal what it is and then you can set the display:none for that type in your CSS file. Please share what you discover so I can update the default file if appropriate.


(Dan Fox) #1032

I found the blue bar was two things: acceleration and threeAxis
Thanks for your help!


#1033

Hi Kewashi,
So, on the api front I’ve figured out why there is a timeout issue. We are loosing the “allthings” session.

So no matter what I need to load up housepanel.php if my app is not currently running to initially create the session. After that I use a refresh_session.php file that I post to on a timer in my js file every 10 minutes to keep the session alive.

refresh_session.php

<?php session_start(); if(isset($_SESSION['allthings'])) $_SESSION['allthings'] = $_SESSION['allthings']; ?>

In my js file.
function refreshSession() {
console.log(“refresh”);
$.post(‘refresh_session.php’);
}
setInterval(function() { refreshSession() }, 600000);

Maybe not the most elegant way of doing it but it works. :slight_smile:


(HousePanel Author) #1034

Very clever workaround … but…

I still don’t understand why allthings isn’t just re-read from the ST groovy side because the auth info is in a cookie that should survive across sessions. The way it works is getAllThings should see that the session is gone and then it should do a CuRL call to reload it and set it again. It won’t stick so each api call will rbe grieve it again which is slow but not too slow. I like your jack because it makes api calls fast. I’m still puzzled why it doesn’t work slower without your hack instead of failing.

Anyway - thanks for sharing this super cool hack. By the way, another workaround is to just keep a browser window open and minimize it. The session will hang around even if the HP page isn’t showing.


#1035

I think it is not reloading after an api call because the “session_start();” is not happening during the call. Now if the page (housepanel.php) is loaded then closed, the session is started and if calls are made consistently within a time frame (my php.ini is set to 24 minutes) before the session expires that should keep it alive.

Or, like you said, keep housepanel.php in another tab or window… or iframe. Or use my script.

I wonder if adding the session_start() in the doaction function would work?


(HousePanel Author) #1036

It should but even if session doesn’t load the cookies and auth should still work. Let me stare at it tonight after work.


#1037

I don’t believe there are any issue with the cookies or auth, I think just the session.


(HousePanel Author) #1038

Okay…

So I did some examining of the code and came to a few conclusions. First - it isn’t a sessions issue because start_session() is called at the very top of the PHP file so it always starts. Also, sessions always end when all browser windows are closed so that wouldn’t help anyway.

Second - looking at the code near the bottom - roughly line 1860 and beyond, you can see that it should always load the access_token and endpt from a cookie, or you could get it from a post or get command if you are setting it in your API call, which most people won’t do. If you had a browser open recently then the cookie will have these values. These two variables being set should load the $valid variable with TRUE. So when your API call gets to doAction all should be well with the world.

If you don’t get that far and you are forced to reauthorize, then that means the $valid variable wasn’t set. So I still think you have a Cookies problem. Please check in the Chome dev window to see if they are set.


#1039

But the start_session() does not get called if i’m doing a post to the page though, correct? <- not sure on this.

Also, I had the housepanel.php window closed all day yesterday and my app with my refresh script worked all day. And that is without it making any calls to housepanel.php. With out the script, it stops after 30 minutes.

Closing the housepanel.php tab won’t destroy the session. It will stick around until the server specified timeout period.

I’ll check out the cookies too, I don’t think that is it though.


(HousePanel Author) #1040

Not correct. All calls to the php file invoke the session_start call.

See the top of the file.


(HousePanel Author) #1041

[DEV RELEASE] Important bug fixes implemented today folks. I’m being cautious and sharing them in a separate branch called “newedit”. Please give it a try. This fix includes a few long standing issues with the thermostat and music tiles that made some of the controls not work. Now the fan setting works and on the music tile the mute button works. There was also a bug with “cool” that instead would have turned on heat… I don’t use AC much here in Michigan so I hadn’t witnessed this bug until I saw it visually today. Sorry if that bit anyone before.

I also cleaned up the video hack and am using it now to show my Arlo video feed thanks to a pretty cool Python hack shared in the ActionTiles forum. Any video mp4 can be displayed with this hack as long as the video file is stored somewhere accessible. See the returnVideo() function. When you click on video tile the movie will replay now.

The drag/drop feature was also updated to work better. It still needs a little more fine tuning but for the most part I’m happy with it. I will let this sit in a separate branch for a few days before merging into the master. Feedback always welcome.

Here’s a current screen shot showing the video feed…


(Chris Wilson) #1042

Hey Ken,
Trying to get the hubitat side of things running and I cannot seem to figure it out.

A few questions - In your install instructions in mentions renaming the groovy file

The only thing you need to do on the Hubitat side is install the HousePanelHubitat.groovy file and name it HousePanel.groovy

I am unsure where to rename this file? So I plugged forward and installed the app.

image

I then enable oauth and I can get the access token and app id to show in the logs.
I provide this info clientinfo.php - However my selected devices never appear to me in housepanel.

What is the correct settings for use st and use hubitat? Should they both be on?

image

Do I have something wrong somewhere?

Never mind - got it all working - Once again user error on my part.
You would have thought I’d have learned better by now lol