Jump to content

House Panel Frames


tazman

Recommended Posts

I didn't know where to place this since the Home Automation Dashboar area and the

thread is locked so I thought I would put my topic here. I don't know if @kewashi is still around but I'm looking to see if someone would be willing to help me creat a Frame in House Panel that could display a locally hosted Powerwall dashboard web page that I would like to be able to display on my House Panel dashboard.  I know @leffertd did some interesting work with Frames to get some cameras to show so maybe there is a chance to make my idea to work.

Link to comment

Hi @tazman - yes, I'm still around and periodically checking on things here. Sorry for any delay.

HousePanel has Frame support and within any given frame you can define any webpage content you like. The key is you need to write a Framex.html file where "x" is the integer of the frame number you want to display. Frame1 and Frame2 are reserved for weather tiles so use anything 3 or larger. To add a frame, go into "edit mode" and then pick the "None" hub and then select Frame in the panel on right and drag it into the main area.

Let me know if you need further help.

 

Link to comment

Hello @kewashi thanks for the reply! I know how to display the Frames and edit them but unfortunately I can not figure out how to format the file for it to display the web page. If it is not too much trouble if you could show me what it would look like to display a local web page like 10.0.0.205:900/.... in a Frame that would be great.

Link to comment

@kewashi no rush when you have some time if there is anything you can help me with. I finally found something online that at least displays it

<iframe src="http://10.0.0.205:9000/d/RSabAvRRzZ/powerwall-power-flow?orgId=1&refresh=5m&kiosk" title="Powerwall" width=”400px” height=”400px”></iframe>

the width and height don't change anything and I need to somehow zoom in or increase the size of the animation to make it readable from further away.

Link to comment
3 hours ago, kewashi said:

Take the px out of the width and height and they should work. I can’t think of any setting that affects reload - that is a browser thing I think 

It does not change removing the px and the window is actually smaller than the tile size in housepanel. I tried displaying directly from the Powerwall and it still refreshes even though in the same browser on the same computer the window can stay scrolled down without reloading. Is there any chance there is a timer for reloading the weather Frame every couple of minutes?

Link to comment

Okay - try these two things. First, go to the Options page: "O" key or pick "Options" from the menu. Then set the timers shown here to zero.

image.thumb.png.089e95c677fc8adf972c7e4dab76a152.png

Second, for the Frame size, go to the customizer page (Blue Circle in edit mode) and edit the custom variables named width and height to the values you want. That should do it.

The screen looks like this:

image.thumb.png.cc3d3822122c1c7cf1baceeaeb82264a.png

Edited by kewashi
Link to comment

Thanks @kewashi it looks like the refresh was taken care of with the Slow Timer I'm still on V2.418 I tried updating to your newest but I could not get the install to finish because I'm on an older version of NPM and I was unable to get that to update. All the size changes in housepanel seem to affect the whole tile and not the image. When I view the frame source there seems to be some icon sizes coded in but when streaming directly from the Powerwall the image is bigger but the window is still small.

   
   
   
<!DOCTYPE html>
  <html lang="en"><head><title>Tesla Energy - Setup</title><link href="favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"/><link href="favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"/><meta charset="utf-8"/><meta content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" name="viewport"/><script>window.__INITIAL_STATE__={"configuration":{"isNew":false,"version":"23.28.2","hash":"EDITED","deviceType":"teg","isSolarPowerwall":true,"bootstrapped":true},"sitemaster":{"running":true,"connectedToTesla":true},"system":{"isFirmwareUpdating":false,"Version":""},"authentication":{"loginType":"customer","selectedLoginType":"customer","username":"EDITED","lastLoginAt":1697306954000,"toggle_auth_supported":true}}
  </script><link href="/app.17c71172308436a079d1.css" rel="stylesheet"/></head><body><div id="root" style="height:100%"></div><script src="/vendor.17c71172308436a079d1.js" type="text/javascript"></script><script src="/app.17c71172308436a079d1.js" type="text/javascript"></script><script src="clear.js" type="text/javascript"></script></body></html>
Edited by tazman
Link to comment
22 hours ago, tazman said:

I'm still on V2.418

Okay - wow... I made so many updates and bugfixes, and overall logic improvements since moving to the local database version that comes with versions 3.x.x that I lost track. It is a big step to migrate from the hmoptions.cfg file to the database setup, but once you do the benefits are significant. The speed change is dramatic and the security of getting your data out of a flat file is significant. Hope you can find a way to upgrade your NPM. However, I don't think upgrading will solve your problem since it looks like the Tesla powerwall will still output the frame information with hardcoded size information. There isn't anything one can do about that if you want real time info. Perhaps there is a setting on the Tesla side of things? With that said, as I look at the info above, the only hard wired sizes I see are for icons which shouldn't matter. Keep fiddling with it to see if you can get it to work.

 

Link to comment

@kewashi I think I got NPM figured out and it looked like the install worked. I assume the new is started the same as the old and below is what I get in the log file when I try to start it.

node:internal/modules/cjs/loader:1327
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: libnode.so.72: cannot open shared object file: No such file or directory
    at Module._extensions..node (node:internal/modules/cjs/loader:1327:18)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/home/pi/HousePanel/node_modules/sqlite3/lib/sqlite3-binding.js:4:17)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v20.8.1
 

Link to comment
3 hours ago, kewashi said:

did you run "npm install" in the folder where the install is?

the error message looks like a path issue too. Not sure how to help

 

Yes and it finished with some minor warnings so I think the install was complete. I will follow the directories it list to see if I can figure anything out. Thanks for all of your help!

Link to comment
2 hours ago, kewashi said:

looking again at your trace dump, I think this error is caused by the fact that you don't have SQlite3 installed.  EISY comes with it but Polisy doesn't.

I'm running on a Pi4. When I saw the error I went to your web site and saw it required SQL so I installed MySQL. I just installed SQlite3 but I get the same error even after running the install aqain. I don't know where the node:internal/modules/cjs/loader stuff is located but I will attach the sqlite3-binding file I found to see if it helps.

sqlite3-binding.js

Link to comment

first - sorry for the mySQL confusion.  I switched to SQLite3 as the default and forgot to update the docs. Will do that soon.  The mySQL code is still there and it should work but i havent tested it in awhile so safer to use SQLite3. 

I havent seen the error you are showing before so I am struggling with finding a way to help you. Lets try some debugging. First, can you run node -v and get a version number?

if so, next try making any .js file that does something simple like

#!/usr/bin/env node

"use strict";
process.title = 'nodetest';

console.log("This is a test");

and see if it prints out the test line.

Next, check if the code created a housepanel.db file. This is the first thing that the server does when you run it for the first time, so if that isn't there then something more fundamental is wrong. 

Next, launch the server and pipe output to a log file as follows,

node hpserver.js >& hperver.log &

and then tell me what is in the hpserver.log file.

hope this reveals something that will help

Link to comment

@kewashi thank you results below

pi@raspberrypi:~ $ node -v
v20.8.1

Created node.js file and ran 

i@raspberrypi:~/HousePanel $ node node.js >& node.log &
[5] 2259
[4]   Exit 1                  node hpserver.js &> hperver.log

node.log had

This is a test

i@raspberrypi:~/HousePanel $ node hpserver.js >& hperver.log &
[10] 6720
[9]   Done                    node node.js &> node.log
pi@raspberrypi:~/HousePanel $ node hpserver.js >& hperver.log &
[11] 6762
[10]   Exit 1                  node hpserver.js &> hperver.log
I'm not quite sure why I see a different response when ran a second time.

hperver.log didn't notice your typo until after running this doing copy paste to try and not make mistakes

node:internal/modules/cjs/loader:1327
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: libnode.so.72: cannot open shared object file: No such file or directory
    at Module._extensions..node (node:internal/modules/cjs/loader:1327:18)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/home/pi/HousePanel/node_modules/sqlite3/lib/sqlite3-binding.js:4:17)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v20.8.1

 

Link to comment

It might be related to how you installed sqlite3.  I think it has to be done globally using sudo, but let me do some more poking around online to see if others have seen this error.

EDIT: others seem to have had the same and fixed it by installing libnode72 package as described here:

https://stackoverflow.com/questions/69378783/node-error-while-loading-shared-libraries-libnode-so-72

i think the command:  "sudo apt install libnode72" will resolve it.

Another fix described at: https://itsfoss.com/solve-open-shared-object-file-quick-tip/ 
is to use the command: "sudo /sbin/ldconfig -v"

the referenced webpage explains why this works. It also suggests you may need to do the first install line and then the second cache update line; that is, do both in order.

Edited by kewashi
Link to comment

@kewashi I think the first command removes node and after running the two commands neither housepanel new or old would work saying it could not find node command so I reinstalled node and ran the first command again to capture what it would say but not complete it.

pi@raspberrypi:~ $ sudo apt install libnode72
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gyp libjs-highlight.js libjs-inherits libjs-is-typedarray libjs-psl
  libjs-typedarray-to-buffer libssl-dev libuv1-dev node-chownr node-color-name
  node-err-code node-extsprintf node-fast-deep-equal node-indent-string
  node-ini node-is-typedarray node-json-parse-better-errors node-json-schema
  node-json-schema-traverse node-qs node-resolve-from node-through
  node-typedarray-to-buffer node-universalify node-uuid
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  nodejs
The following NEW packages will be installed:
  libnode72
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 7,261 kB of archives.
After this operation, 153 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
I then tried running just the second command to see if it would work and my older housepanel works again but the new version still does not and the log is the same as before.

Link to comment

Also

pi@raspberrypi:~/hpserver $ sqlite3
SQLite version 3.34.1 2021-01-20 14:10:07
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> 
 

Link to comment
39 minutes ago, kewashi said:

well i am stumped - just hard to troubleshoot when I dont see the same. 

No problem I'm thrilled with my setup, the way it looks and performs! I appreciate the time and effort you have given me.

Link to comment
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      36.6k
    • Total Posts
      368.3k
×
×
  • Create New...