so lets have a reinstall
hmm when the install ends with
pi@pimaticrpi:~/flexible-dashboard $ npm install
npm WARN optional dep failed, continuing fsevents@1.0.14
Getötet
it sounds not good
Pimatic Dashboard - Alpha (v0.0.2)
so lets have a reinstall
hmm when the install ends with
pi@pimaticrpi:~/flexible-dashboard $ npm install
npm WARN optional dep failed, continuing fsevents@1.0.14
Getötet
it sounds not good
when i’m now starting via
npm start
i’m getting this
> flexible-dashboard@0.0.1 start /home/pi/flexible-dashboard
> node server.js
module.js:327
throw err;
^
Error: Cannot find module './source-map/source-map-generator'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/pi/flexible-dashboard/node_modules/webpack/node_modules/webpack-core/node_modules/source-map/lib/source-map.js:6:30)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
npm ERR! Linux 4.4.21-v7+
npm ERR! argv "/home/pi/bin/node" "/home/pi/bin/npm" "start"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! flexible-dashboard@0.0.1 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the flexible-dashboard@0.0.1 start script 'node server.js'.
npm ERR! This is most likely a problem with the flexible-dashboard package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs flexible-dashboard
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls flexible-dashboard
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/flexible-dashboard/npm-debug.log
the log says
0 info it worked if it ends with ok
1 verbose cli [ '/home/pi/bin/node',
1 verbose cli '/home/pi/bin/npm',
1 verbose cli 'start',
1 verbose cli '/home/pi/flexible-dashboard/' ]
2 info using npm@2.15.5
3 info using node@v4.4.5
4 verbose config Skipping project config: /home/pi/.npmrc. (matches userconfig)
5 verbose stack Error: ENOENT: no such file or directory, open '/home/pi/package.json'
5 verbose stack at Error (native)
6 verbose cwd /home/pi
7 error Linux 4.4.21-v7+
8 error argv "/home/pi/bin/node" "/home/pi/bin/npm" "start" "/home/pi/flexible-dashboard/"
9 error node v4.4.5
10 error npm v2.15.5
11 error path /home/pi/package.json
12 error code ENOENT
13 error errno -2
14 error syscall open
15 error enoent ENOENT: no such file or directory, open '/home/pi/package.json'
15 error enoent This is most likely not a problem with npm itself
15 error enoent and is related to npm not being able to find a file.
16 verbose exit [ -2, true ]
Interesting… I just tried running it on my Mac with the following commands:
git clone https://github.com/Timvdv/flexible-dashboard
cd flexible-dashboard
npm install
npm start
and it works. Maybe it’s the node version? I’m using v4.6.0.
I’ll check into this when I have more time. Are you sure you did a npm install?
Yes I’ve done a npm install
But like I told in the posts before the installation isn’t running 100% correct.
He’s killing some process at the end
@chris Well… the build is only for development. So if you just want to try it out you can use the compiled version: https://cl.ly/2p3R0B1s1C3n
You have to run in in a webserver you can do this with node by:
npm install http-server -g
cd into/the/folder
http-server
or with Python by:
cd into/the/folder
python -m SimpleHTTPServer 8000
I’m planning to make it a lot simpler in the future
Hello,
thanks @Tim for the response.
so i have done your steps.
now i have the setup screen but he won’t connect to pimatic.
the errors are this one here.
[npm server]
[Sun Oct 09 2016 12:46:52 GMT+0200 (CEST)] "GET /127.0.0.1:8080/api" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50"
[Sun Oct 09 2016 12:46:52 GMT+0200 (CEST)] "GET /127.0.0.1:8080/api" Error (404): "Not found"
[python server]
10.0.0.48 - - [09/Oct/2016 12:52:35] code 404, message File not found
10.0.0.48 - - [09/Oct/2016 12:52:35] "GET /127.0.0.1:8080/api HTTP/1.1" 404 -
@chris Okay I’ve just tried this myself I think I know whats happening
The setup has to be really precise…
If you have this in pimatic:
"cors": {
"allowedOrigin": "http://localhost:3003"
},
Make sure the URL is localhost and not 127.0.0.1 because cors is only enabled for localhost.
The url and port in your pimatic config should be the same in your browser
So this for example would not work
Also make sure your username and password are correct.
If this does not solve the error, could you send me the error in the browser (when you open debugger tools)
The error look like the following:
[Error] TypeError: Not enough arguments
(anonyme Funktion) (start.js:1:1108)
Globaler Code (start.js:1:1108)
[Log] No settings found, use the setup
[Error] Failed to load resource: Verbindung zum Server konnte nicht hergestellt werden. (api, line 0, x3)
Or in Chromium on 127.0.0.1 like this:
Download the React DevTools for a better development experience: https://fb.me/react-devtools
(program):63 No settings found, use the setup
3http://127.0.0.1:8080/api Failed to load resource: the server responded with a status of 500 (Internal Server Error)
6(program):9175 XMLHttpRequest cannot load %3127.0.0.1:8080/api. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
So because localhost never worked i chooses to set the path in pimatic-config to 127.0.0.1
But no luck.
Mit freundlichen Grüßen
Chris
@chris I can’t test it on 127.0.0.1 because this does not work for me .
The second error (in Chromium) is what I fixed by making sure the URL’s are the same in both Pimatic and the dashboard.
Ok i will set everything to localhost…
lets have a look then… one moment
edit:
Ok now it works.
i had also a error in the whitelist…
just edited too much.
now when i enter the hole url… (http://localhost)
then it works.
But i only see 3 sensors…
But that why its already compiled i think?
i think i have to wait until you’ve done some more steps…
thanks @tim
@aap82 Exactly! Also if it’s working really smooth and people like it maybe it can support custom apps . You never know haha. Just tried to keep all options open for this project.
Quick update: Added support for pimatic variables! Definitely makes the dashboard more useful.
I think it’s pretty cool
Only thing to do before releasing a new version is saving the widget state. As of right you you can move them but it won’t save the position so you have to do it all over again when you refresh the browser.
Yea cool,
but why i also had no switches in my dash?
hmm…?
@chris Only switches powered by the shell switch plugin are supported at the moment
from this switch i just don’t have one…
Thanks again
@Tim That’s what I thought. It also appears you levered Handsome as well. I was an early adopter of the OpenHab version of this project, and contributed a little to it as well, but I moved on from it for various reasons, one of which you’ve adopted. I embarked on my own and ended making my own dashboard, which I wrote in React, and not having actually done any web development (or professional coding) before, it took me a while and required a ton of learning. I’m happy to share my experience and thoughts if you’d like.
Also, may I offer some suggestions?
The first one I’ll offer is moving from a polling method for data updates to SSE, which is pretty easy actually. It will make the Widget code cleaner, and allow data to be kept in sync when you have more than one dashboard running. Also, it will keep from pimatic having to respond to requests when nothing may have change, and lighten its processing burden. Pimatic makes the bridge between your dashboard server and pimatic process quite simple through websockets.
Instant changes from pimatic backend can be sent to a websocket client running server side, normalized, and sent to dashboards. User actions can be made via api call on webserver, then sent to pimatic via websockets, with no need for dashboard client to wait for response.
With this method, you can also send initial data with page loads.
I thought I’d offer this, because this was the biggest reason I went to build my own. Even though dashing did use SSE for data updates, initial data for individual widgets were made via web calls, increasing web traffic/processing on the pi and unnecessarly burdening pimatic with unneeded requests. And the problem will compound with more widgets, multiple pages, and increased physical locations.
Also, this makes it quite extensible, since anyone can write their own bridge from really any HA backend to a simple unified dashboard that handles its data in a self contained way.
Yay! It’s actually useful now.
git clone https://github.com/Timvdv/flexible-dashboard
cd flexible-dashboard
npm install --production
node server.js
open http://localhost:3003
Slowly… But it’s getting better and better
@aap82 Thanks for your feedback, will definitely check out SSE in the future. Sounds interesting. I don’t actually wait for the response because I use promises but using websockets is still better and the user data will only be available in the back-end this way which is also better .
Hello @Tim
so i already tested to install your new version.
I’m getting this error…
pi@raspberry:~/flexible-dashboard $ npm install --production
npm WARN optional dep failed, continuing fsevents@1.0.14
|
Getötet
so the following step is also an issue
pi@raspberry:~/flexible-dashboard $ node server.js
module.js:327
throw err;
^
Error: Cannot find module 'webpack'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/pi/flexible-dashboard/server.js:1:77)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
i really like you work so it would be nice if somebody could help
Mit freundlichen Grüßen
Chris
@chris Oops, stupid mistake. Because I installed the development dependencies I did not get this error.
It’s fixed now. If you do: git pull
and node server.js
it should work
By the way if you got it working but the layout looks really broken: move a few widgets and refresh a few times, it will fix itself not sure what it is yet
Hi Tim now i got to run.
But the dash look really bad…
Here i already deleted 30-40 devices and i can just place it in one line, one over the other…
edit: at factory reset it stays the same