[RELEASE] HousePanel Dashboard for SmartThings and Hubitat

Is too bad. It took a little fiddling to get the hang of it, I initially had a bit of trouble as well. I hope you manage to get it working.

Like I said feel free to ignore my observations. Pistons and music tiles are not high priority for me.

Here is the link for the webcore stuff - they have it working pretty well actually. I have been trying to stick with RM, however I have hard time wrapping my head around it.

Yes they have added sonos support as well as vlc thing presents itself much like a sonos device (device handler that remote controls vlc on another machine) I believe. (i have not been able to make the excuse to get sonos yet, maybe soon.)

Of course… anything is possible… it is just code!!

Take a look at the showInfo function at line 1763 in housepanel.php

That can be used to just do a text dump of the “allthings” variable. This variable holds all of the objects. Add this to the code after line 1804…

$tc.= "<br /><hr><br />";
$tc.= "<div>json dump of the 'allthings' variable</div>";
$tc.= json_encode($allthings);

I just tried it and it works… ain’t pretty but it works. You can dump any subset you like…

This is better… will post it in a few moments:

$tc.= "<div><b>json dump of each thing</b></div>";
foreach ($allthings as $bid => $thing) {
    $tc.= "<div class='jsonid'>" . $bid . "</div>";
    $tc.= "<div class='jsondump'>" . json_encode($thing) . "</div>";
}

plus some styling in the default css file

[EDIT] Posted as Revision 1.622

Ha, well I figured that - I have also realized there is often the easy way and then there is MY way.

See it would have taken me forever to figure this out - So now for more questions how do I access this?
Ahh I see it is at the end of the page…

Also noticed right after I posted this call seems to give what I want. Was crossing my eyes trying to figure out how to use it.

/housepanel.php?useajax=queryhubitat&type=all

Yup - that will produce the same output without any css formatting I believe. Enjoy.

Thanks again for the guidance ken. Once I finally uncrossed my eyes I figured out how to parse this in node red. i do believe I will be able to make exactly the sort of voice report I am looking for.

At time like these I wish i knew a little more about the coding, so I could make exactly the Alexa skill I am looking for it. It just is not quite simple enough… maybe I will get there one day.

Still getting this error over and over - it changes search for # currently 19.

Is this an issue with the file corruption you were talking about? Or something different?
seems currently my clock is device 19

@kewashi

I don’t think so because that bug was fixed. Is this a JavaScript error? I can’t find where I use the “in” function except in strObject which is for debug purposes only. Can you share the full traceback?

@kewashi
sorry thought i had it all in there

Uncaught TypeError: Cannot use 'in' operator to search for '19' in {"1":{"name":"Air","id":"357","value":{"name":"Air","switch":"on"},"type":"switch"},"2":{"name":"Floor fan","id":"1059","value":{"name":"Floor fan","switch":"on"},"type":"switch"},"3":{"name":"Heater","id":"290","value":{"name":"Heater","switch":"on"},"type":"switch"},"4":{"name":"Iris1","id":"897","value":{"name":"Iris1","switch":"on"},"type":"switch"},"5":{"name":"Iris2","id":"865","value":{"name":"Iris2","switch":"off"},"type":"switch"},"6":{"name":"Lights","id":"616","value":{"name":"Lights","switch":"on"},"type":"switch"},"7":{"name":"PC","id":"1156","value":{"name":"PC","switch":"on"},"type":"switch"},"8":{"name":"tuya","id":"1153","value":{"name":"tuya","switch":null},"type":"switch"},"33":{"name":"Vlc","id":"132","value":{"name":"Vlc","switch":null},"type":"switch"},"25":{"name":"Fan","id":"615","value":{"name":"Fan","switch":"on","level":50},"type":"switchlevel"},"15":{"name":"dads room","id":"7","value":{"name":"dads room","switch":"on","level":99,"hue":62,"saturation":28,"color":"#000000","colorTemperature":2732},"type":"light"},"9":{"name":"Entertainment area 1","id":"8","value":{"name":"Entertainment area 1","switch":"on","level":99,"hue":62,"saturation":28,"color":"#000000","colorTemperature":2732},"type":"light"},"10":{"name":"Girls room","id":"2","value":{"name":"Girls room","switch":"off","level":100,"hue":12,"saturation":78,"color":"#FFBC54","colorTemperature":2732},"type":"light"},"11":{"name":"Lightstrip","id":"3","value":{"name":"Lightstrip","switch":"on","level":99,"hue":62,"saturation":28,"color":"#F5FFF4","colorTemperature":3003},"type":"light"},"12":{"name":"Main light","id":"4","value":{"name":"Main light","switch":"on","level":99,"colorTemperature":6173},"type":"light"},"13":{"name":"My light","id":"5","value":{"name":"My light","switch":"on","level":99,"hue":62,"saturation":28,"color":"#F5FFF4","colorTemperature":2732},"type":"light"},"14":{"name":"My room","id":"6","value":{"name":"My room","switch":"on","level":100,"colorTemperature":2732},"type":"light"},"26":{"name":"contact","id":"801","value":{"name":"contact","temperature":75.65,"battery":100,"contact":"closed","threeAxis":{"x":-1006,"y":-4,"z":9},"acceleration":"inactive"},"type":"contact"},"27":{"name":"door sensor","id":"614","value":{"name":"door sensor","contact":"closed"},"type":"contact"},"16":{"name":"Front Door","id":"1030","value":{"name":"Front Door","battery":60,"lock":"locked"},"type":"lock"},"28":{"name":"Generic Zigbee Motion Sensor","id":"802","value":{"name":"Generic Zigbee Motion Sensor","temperature":76.37,"battery":33,"motion":"inactive"},"type":"motion"},"29":{"name":"Alicia","id":"1065","value":{"name":"Alicia","presence":"absent"},"type":"presence"},"30":{"name":"Chris","id":"1058","value":{"name":"Chris","presence":"absent"},"type":"presence"},"31":{"name":"presence new","id":"1090","value":{"name":"presence new","presence":"present"},"type":"presence"},"32":{"name":"Tina","id":"803","value":{"name":"Tina","presence":"present"},"type":"presence"},"18":{"name":"contact","id":"801","value":{"name":"contact","temperature":75.65},"type":"temperature"},"17":{"name":"Generic Zigbee Motion Sensor","id":"802","value":{"name":"Generic Zigbee Motion Sensor","temperature":76.37},"type":"temperature"},"19":{"id":"clockdigital","name":"Digital Clock","value":{"name":"Digital Clock","weekday":"Monday","date":"Jun 04, 2018","time":"9:48 pm","tzone":"EDT"},"type":"clock"}}
    at HTMLDivElement.<anonymous> (housepanel.js:1423)
    at Function.each (jquery-1.12.4.js:370)
    at jQuery.fn.init.each (jquery-1.12.4.js:137)
    at Object.success (housepanel.js:1416)
    at fire (jquery-1.12.4.js:3232)
    at Object.fireWith [as resolveWith] (jquery-1.12.4.js:3362)
    at done (jquery-1.12.4.js:9840)
    at XMLHttpRequest.callback (jquery-1.12.4.js:10311)

Hmmm… this is the main timer polling loop that does a simple:

 $('div.panel div.thing').each(function()  { ... }

each loop. Something in your thing list is causing problems. Not sure what it is but I’m guessing that this is making your polling not work. Your clocks are probably not keeping time… is that right?

[EDIT] I think it is the tileid in presult within this block… let me get back to you.

@cwwilson08 Try the patch I just uploaded - it is just an updated housepanel.js file. I added some error checking for the index into the main arrays. I think it was trying an integer when the object was index by a string so now I try both inside try/catch blocks, which is better coding practice anyway. I hope it fixes the problem. My install didn’t show this error so I couldn’t test it.

Hey Ken,
Thanks for looking into it so quick.
I did a little testing. If I remove the clock, it would start throwing the error on the weather tile. Seems whichever is first in line…

I am also wondering if I could have messed something up somewhere, Clean install though - so I did not do a lot. Am going to try the new file now.

@kewashi

That did not take long…

Polling error Cannot use ‘in’ operator to search for ‘length’ in "
(anonymous) @ housepanel.js:1448
fire @ jquery-1.12.4.js:3232
fireWith @ jquery-1.12.4.js:3362
done @ jquery-1.12.4.js:9840
callback @ jquery-1.12.4.js:10311
XMLHttpRequest.send (async)
send @ jquery-1.12.4.js:10254
ajax @ jquery-1.12.4.js:9738
jQuery.(anonymous function) @ jquery-1.12.4.js:9890
updarray.myMethod @ housepanel.js:1414
(anonymous) @ housepanel.js:1461
setTimeout (async)
allTimerSetup @ housepanel.js:1461
(anonymous) @ housepanel.js:110
load (async)
(anonymous) @ housepanel.js:43

And you are correct - now that I take the time to look, the clock is not moving…

EDIT: So when I setup the hubitat only install I was still seeing devices from smartthings. I had only deleted a weeks worth of cookies and not them all.

Could these be trying to point at smartthings and throwing errors because I have no authorization to them?

So I feel like a bit of a tool now. I just did a fresh install. So far no errors, and hey what do you know the clock is keeping time…

My apologies for wasting your time Ken.

Whoops right as I posted it through it again…

Ok completely started from scratch. Removed housepanel from the hub. Deleted all the files on the server. Setup the clientinfo file again. Fingers crossed it seems to be playing nicely. I have to go to bed for work now. Will leave the console log open for the night and see what it says in the morning…

Just wanted to post that another happy Hubitat user install here. Was waiting until you cut the cord with ST. :slight_smile:

@kewashi, wondering why your having problems with adding devices to HE… I have over 70 z-wave and 12 zigbee devices that have been moved from ST to HE. Everything running smoooothly and locally :wink:. Only thing I can think of is to make sure they are properly excluded from ST (or any other hub) using the ‘General Device Exclusion’ in ST. Sometimes I have to do this twice for it to stick. Just a thought. Oh and be sure to post over on the HE forum. Always people to help you out over there!

Thanks for all your hard work!

I am obviously doing something wrong. I got my Apache server up (local/option 2), PHP and cURL are working fine and tested. I have HousePanel in a directory and when I go to the webpage I can see it but I never got any sort of authentication (even when I first logged on). No verifying images or no SmartThings.

When I go to “Options” I see a big, orange button to “Authorize SmartT” and when I click it I can select my home and see all available devices but when I select one or two or all of them they and Authorize they do not show in the device list in House Panel. However, if I go to the ST smartapp, they do show in there.

Additionally, next to the big, orange button it simply says “USER_SITENAME”, which doesn’t seem right. When I try to run the showid command mentioned above I get a page that says “This page isn’t working”. What did I miss? Is there something more that I need to do with permissions when I’m on option 2?

Did you provide your access token in the clientinfo file?

Yes, both the client ID and the client secret. I don’t think it would allow me to even get to my home location or devices using the “Authorize SmartT” button without that but that is a huge assumption on my part. Or is there another token I am forgetting?

Did you do the chmod 777 on the directory your house panel install is in? Houselanel need s to be able to create a file there

Ooooo…I did not. I think I tripped over the wiki with that and it looked like it was just for option 1 and option 3 so I didn’t do it because I am using option 2. Let me give that a whirl and see if that fixes it up for me. Thanks!