[RELEASE] HousePanel Dashboard for SmartThings and Hubitat

Glad you got it working. I need to spend time making it easier on the Hubitat side. For now it’s a total hack

Yeah I was glad too. It really was not a hard setup actually - again me putting typos in bad places lol.

I am actually quite happy this works as well as it does. Makes me glad I went all in with HousePanel early. Seems hubitat and HP are made for each other. I now have a very pretty interface for controlling my hubitat devices. Makes the lack of an app not so bad.

I have successfully gained controlled of my hue lights and Kuku harmony integration through hubitat. Housepanel is working nicely. Webcore is setup and working well with the one test piston I fired. I am going to continue to migrate devices over and see how it goes.

I have said it before and Ill say again. Thank you very much for your dedication to this project, and all the support and help you provide to everyone along the way. You are a man with much more patience than I. lol.

1 Like

Hi Ken,
So I did a small controlled test to check the status of the session, cookies, and run a doquery type=all call.
I loaded up houspanel.php in a tab and closed it.
Loaded my test page in another tab.
All 3 cookies were set. sitename, endpoint, and token.
The session was there.
I was able to do the query.
Let it sit for about an hour, tried the query again and no result.
Checked the status of the session it was no longer available.
All 3 cookies were still available.

I’m cool with my fix, it works for me that way. Just wanted to give you a heads up.
Can’t wait to play with the arlo setup, I got a php solution that i’ve been getting stills with but no video yet.

Merged the newedit branch into the master branch tonight after some bug fixes and testing. This also cleans up some bugs. With this update you can add tiles directly from the main window in edit mode by dragging them from the catalog on the right. This is best done on a PC but it works on a tablet too. LIkewise, existing tiles can be deleted by dragging them onto the catalog. A confirmation window will be presented. The prior Options page is still there but won’t likely be used as often with this feature active. You will still need to use Options page to change your skin or to use Nick’s tile editor. I’m working on replacing this editor with an in-place editor for the main screen so stay tuned for that. Until that is done I recommend you avoid using the current tile editor as I have found it has some funky side effects and is not totally reliable.

1 Like

Hi Ken,
On the api side when you try and set the thermostat value directly without cool-up or cool-dn it does not work.
http://domain.com/housepanel.php?useajax=doaction&id=xxxxxx&value=cool&attr=74

In the groovy file the portion handling that kind of call is looking for the cmd parameter. But the function is passing it as curtemp.

Starting at line 1369, on my file I just changed cmd to curtemp and it works fine.

Thanks. I will add this fix to the master branch in my next update. There are likely other API bugs like this because it isn’t used heavily. I’m so happy you are stress testing it.

1 Like

You will be glad to hear that I found and fixed the sessions bug. Turns out API lightweight callers don’t use sessions. I only need it for browser users to update the cached things for faster loads.

EDIT: Updates posted. Includes the thermostat bugfix

Posting the EventGhost xml file that I use to keep my office lights on when I am sitting at the computer using a HousePanel api call. This also creates a button on my desktop that I can click to turn on my lights or fake movement. You can build on this to do all sorts of cool things. EventGhost has to be running in the background for this to work.

> <?xml version="1.0" encoding="UTF-8" ?>
> <EventGhost Version="1722" Guid="{194779F7-4C35-4AAB-BD4E-3C8B08572945}" Time="1524932194.09">
>     <Autostart Name="Autostart" Expanded="True">
>         <Plugin Identifier="DesktopRemote" Guid="{5DFFBD61-7582-4D6F-8EA9-9CB36284C9CF}" File="DesktopRemote">
>             gAIpLg==
>         </Plugin>
>         <Action>
>             DesktopRemote.CreateNew(40, 40, 3, 3, 4, (108, 108, 108), (255, 255, 255), (78, 78, 78), u'0;-13;0;0;0;700;0;0;0;0;3;2;1;34;Arial', u'Remote', 1, True, True, True)
>         </Action>
>     </Autostart>
>     <Macro Name="Desktop Remote: Create New Remote" Expanded="True">
>         <Action>
>             DesktopRemote.CreateNew(120, 40, 3, 3, 4, (108, 108, 108), (255, 255, 255), (78, 78, 78), u'0;-13;0;0;0;700;0;0;0;0;3;2;1;34;Arial', u'Remote', 0, True, True, True)
>         </Action>
>         <Action>
>             DesktopRemote.AddButton({'width': 120, 'event': u'lamp', 'label': u'Office Lamp'})
>         </Action>
>         <Action>
>             DesktopRemote.AddButton({'width': 120, 'event': u'officemove', 'label': u'Fake Motion'})
>         </Action>
>         <Action>
>             DesktopRemote.StartNewLine(0)
>         </Action>
>         <Action>
>             DesktopRemote.AddButton({'width': 240, 'event': u'officemain', 'label': u'Office Main LIght'})
>         </Action>
>         <Action>
>             DesktopRemote.Show(2000, 200, False)
>         </Action>
>     </Macro>
>     <Folder Name="HousePanel Macros" Expanded="True">
>         <Macro Name="Keep Light On" Expanded="True">
>             <Event Name="DesktopRemote.officemove" />
>             <Event Name="System.UnIdle" />
>             <Event Name="System.ClipboardChanged" />
>             <Event Name="Main.OnInit" />
>             <Action Name="Run HousePanel">
>                 EventGhost.PythonCommand(u'import urllib; myvar = urllib.urlopen("http://192.168.11.20/smartthings/housepanel.php?useajax=doaction&amp;id=h_1&amp;value=move"); print myvar.read();')
>             </Action>
>         </Macro>
>         <Macro Name="Toggle Lamp">
>             <Event Name="DesktopRemote.lamp" />
>             <Action Name="Run HousePanel">
>                 EventGhost.PythonCommand(u'import urllib; myvar = urllib.urlopen("http://192.168.11.20/smartthings/housepanel.php?useajax=doaction&amp;tile=83"); print myvar.read();')
>             </Action>
>         </Macro>
>         <Macro Name="Office Main">
>             <Event Name="DesktopRemote.officemain" />
>             <Action Name="Run HousePanel">
>                 EventGhost.PythonCommand(u'import urllib; myvar = urllib.urlopen("http://192.168.11.20/smartthings/housepanel.php?useajax=doaction&amp;id=h_34"); print myvar.read();')
>             </Action>
>         </Macro>
>         <Macro Name="Turn LIghts Off" Expanded="True">
>             <Event Name="System.Idle" />
>             <Action Name="Run HousePanel">
>                 EventGhost.PythonCommand(u'import urllib; myvar = urllib.urlopen("http://192.168.11.20/smartthings/housepanel.php?useajax=doaction&amp;id=h_1&amp;value=stop"); print myvar.read();')
>             </Action>
>             <Action Name="Run HousePanel">
>                 EventGhost.PythonCommand(u'import urllib; myvar = urllib.urlopen("http://192.168.11.20/smartthings/housepanel.php?useajax=doaction&amp;id=h_34&amp;value=off"); print myvar.read();')
>             </Action>
>         </Macro>
>     </Folder>
> </EventGhost>
1 Like

Turns out the bug was in the doAction function in the php file and it’s hubitat equivalent. I was checking for a session and if not found I was doing nothing. For api calls sessions are not really needed and from python sessions don’t work anyway, so if a session isn’t found I now just proceed with the api call. However this means if an api call changes the state of a light that light won’t show correctly when a browser loads it the next time. That is because the api call can’t update the session variables. It will resync in the next poll which takes roughly one minute so this isn’t a big deal. On the other hand, when a user pushes an icon on the screen it causes the browser to call doAction in an internal API call but in that case the session is found and it is updated so things stay nicely in sync. I know I’m rambling on about internal coding stuff but I wanted to share how HP works with the community to help anyone interesting in doing some community developed contributing.

This is great Ken!
Just to play around I ended up gutting HP to remove the session requirement to really see if it would still work. It worked perfectly, but I was dreading your next update and having to merge with my mess. So you finding a solution is awesome.

@kewashi

Hey Ken,
Sorry if this has been posted somewhere. Just a few questions.

Is there a local api call that can be used with hubitat code?

If so is the url format the same?

I think the hubitat endpoint should look like this
http://192.168.1.129/apps/api/98/doaction?access_token=accesstoken

I think I made some progress.
http://192.168.1.121/HousePanel-newedit/housepanel.php?useajax=doaction&id=00d98904-552d-4d3b-8849-7d9724d8bd7a&value=on

This url works and controls items connected to smartthings. For the life of me I cannot figure out how to get control of hubitat devices.

Posted somewhere else I saw you mentioned that hubitat device id should start with h_. My id’s only show the number. Trying to insert this number for id results in a false response. Also using h_5 does not work.

Also I notice it is sending this cookie - which leads me to believe it is calling the smartthings endpoint and using the smartthings token. Even if i specify token and endpoint in the call it still returns that cookie

I finally managed to make it work. yay!!!

seeing this error lots when loading my dashboard.

Looks like a bug… will investigate.

Glad you got Hubitat api call to work. It is easier to use Tile numbers. Inspect your item and look for p_ in the classes. Or run showid. These integers can be used as &tile=n instead of the long ST id’s. And yes the h_ id number should work.

I’m working on a fairly major update that cleans up the API calls to work more consistently and enable any supported command to be called - even those not shown on the HousePanel screen. Will be super cool. I am using it to enable KuKu Harmony to work inside HousePanel. It’s goung to be slick.

1 Like

Very cool. Looking forward to it.

The error was being thrown by one single tile. I removed and reauthorized it has cleared now.

I just wanted to say that this is one of the most interesting projects I have attempted. The work that @ kewashi and other contributors have done is amazing to say the least! I set everything up on a pi3 b+. My HP looks great, I have been able to create new rooms place tiles where I want them etc. The only problem I am having is editing the icons in the HP editing mode. Every time I change them they stay until a refresh happens then they go back to the original default icon. I have yet to change the size or the color even on a temporary basis. I wondering if I have missed something in the instructions or if all the editing has to be done in the housepanel.css? At first I thought it might be a permissions issue but I’m not sure. Any help will be appreciated! I am running out of ideas.

1 Like

Mark - thanks for the kind words. The editor is a known problem, and I am working on a complete rewrite. Still a little more testing to do so hang in there for a little while. Trust me it will be worth it. Here is a screen shot preview of what the new editor looks like. Every tile item will be editable from the main screen – no more editing from the options screen. And all the weird behavior will go away. I’m still fine tuning the tile resizing options and then a little more testing. For now just ignore the boxes on the bottom left - they are not yet styled. The rest of it is pretty much as it will look.

1 Like

Oh thanks so much for your quick reply! Wow that looks incredible! And very much worth the wait! There are just so many possibilities the options are unlimited! I am hoping to be able to put a pic of my floor plan on a tab and set it up for a visual on what going on in the whole house on one page. To be honest I am surprised I have gotten this far being in my 60s and the only computer class I have taken was in college using IBM mag cards lol. But your instructions were extremely helpful and feedback on the blog got me to where I am now. Looking at the css files and your instructions it seems a bit overwhelming, but I was able to make changes in the tabs and do some basic things. But again I’m not as brilliant as @nitwit or some of the other smart contributors. I hope you will give detailed instructions on how to upgrade when it available! Again thank you for taking the time and creating something this cool for everyone to enjoy!

@kewashi

Is having the smart things hub online a requirement for HousePanel? Will it work with only the hubitat hub?

Unfortunately, for now a smart things Hub is required. It is on my to do list to enable a habitat only installation.