Open heiko1988 opened 4 years ago
Hi, i added a small installation guide and updated the pimatic-home-connect.coffee.
Thanks.
i have try. pimatic say error error
[pimatic]: Cannot find module './lib/utils'
ok, i have clone direct in /home/pi/pimatic-app/node_modules/ and then change the main.js, the lib error dosent come again
now say the console log
[pimatic-home-connect] Home-connect offline
Ok, i forgot in the instruction that you need to install home-connect-js and lodash first. In the pimatic-home-connect directory run command -> npm install This will install home-connect-js and lodash and then replace main.js
ok, i have new reinstall
now say the console log
[pimatic-home-connect] Home-connect offline
no popup come in pimatic
what for date use you in the dev application in home connect?
Access Private Private access is limited to a single Home Connect user account as defined. Home Connect user account for testing: here i have my Private acc OAuth Flow: Device Flow Client ID: the application id Client Secret (optional): the applcation secret Success Redirect ? One Time Token Mode: Disabled
Its not the device flow but the Authorisation Code Grant Flow you need to use for the application. It will probably change but for the POC its the ACGF
The redirect uri is http://localhost:3000/o2c
This is all part of the extended instruction 😄
ok :)
say the same:
[pimatic-home-connect] Home-connect offline
is the port 3000? or my pimatic port? and must the port be accessible externally?
its 3000 not your pimatic port
no i use intern 81 and externally 23003
yes, but you must use 3000. It's not related to the pimatic ports
ok, then I don't have to change anything? must the port be accessible externally and do I have to change the local host to my ip or my dns?
ok, i reinstalled everything. i think: the error will be that authorization popup does not appear
before the question comes i have no popup blocker or other active things
The plugin runs for authentication a webserver on port 3000 and opens a browser window on it self
A checklist
ok, then I don't have to change anything? must the port be accessible externally and do I have to change the local host to my ip or my dns?
No you don't need to change anything
Ok, I try again
You need to have the browser on the same computer as pimatic is running on!
so i have try agian: this is my way
`root@raspberrypi:~ # cd /home/pi/pimatic-app root@raspberrypi:/home/pi/pimatic-app # cd ./node_modules root@raspberrypi:/home/pi/pimatic-app/node_modules # git clone https://github.com/bertreb/pimatic-home-connect Klone nach 'pimatic-home-connect' ... remote: Enumerating objects: 119, done. remote: Counting objects: 100% (119/119), done. remote: Compressing objects: 100% (83/83), done. remote: Total 119 (delta 69), reused 81 (delta 33), pack-reused 0 Empfange Objekte: 100% (119/119), 22.52 KiB | 0 bytes/s, Fertig. Löse Unterschiede auf: 100% (69/69), Fertig. root@raspberrypi:/home/pi/pimatic-app/node_modules # cd ./pimatic-h pimatic-harmonyhub/ pimatic-home-connect/ root@raspberrypi:/home/pi/pimatic-app/node_modules # cd ./pimatic-h pimatic-harmonyhub/ pimatic-home-connect/ root@raspberrypi:/home/pi/pimatic-app/node_modules # cd ./pimatic-home-connect/ root@raspberrypi:/home/pi/pimatic-app/node_modules/pimatic-home-connect # npm install npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
core-js@2.6.11 postinstall /home/pi/pimatic-app/node_modules/pimatic-home-connect/node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
https://opencollective.com/core-js https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN pimatic-home-connect@0.0.2 requires a peer of pimatic@0.9.* but none is installed. You must install peer dependencies yourself. npm WARN pimatic-home-connect@0.0.2 No license field.
added 153 packages from 137 contributors and audited 280 packages in 42.704s
13 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
root@raspberrypi:/home/pi/pimatic-app/node_modules/pimatic-home-connect #`
then i have the main.js frome here /home/pi/pimatic-app/node_modules/pimatic-home-connect to here /home/pi/pimatic-app/node_modules/pimatic-home-connect/node_modules/home-connect-js
then i type in the config:
{
"plugin": "home-connect",
}
then start pimatic, and in the plugin i have type the cliendid and secret
"plugin": "home-connect",
"clientId": "xxxxx",
"clientSecret": "xxxxx",
"simulation": true,
"debug": true,
"active": true
and then i have restart, and now come nothin prompt.
what make i wrong ;)
can make a buttom in plugin conf to start the auth?
In the current setup the browser must run on the same computer Pimatic is running on. So you can't use a head-less configuration!
For the headless setup (what most a the user use) i need to change the authentication flow to the Device Flow. The home-connect-js lib doesn't support that and there some work to do.
can make a buttom in plugin conf to start the auth?
no, thats not a solution (see my 2 posts above)
ok, that's the problem ;)
I have my pimatic on the pi and try it from my laptop.
then it is clear that it does not work.
is there a way that i can do it via the pc or directly with curl or so on the pi in the console?
No curl will not work. You need to have to login with something like vnc.
But if you have a laptop. Its not very complex to install basic pimatic(+nodejs) and do the install steps for pimatic-home-connect. You start/stop pimatic via commandline.
Ok, and can this transfer to my pimatic on the pi? After all work?
It could work, i will test that and let you know. This is still a POC way-of-working!
Please remove your ClientId and ClientSecret from the thread :)
It could work, i will test that and let you know. This is still a POC way-of-working!
Ok thanks
Please remove your ClientId and ClientSecret from the thread :)
I have removed and delete the application on home connect dev page.
Thats not what I ment, but its also a solution 😅 You need a new application to test
I am aware of that :)
But safe is safe
ok, i have check again.
so,
now i have a vnc server on the pi and am connected.
I use the chromium browser and did the whole thing again, including new id and secret.
Unfortunately I can't get it done;)
You are logged in via vnc to the pi? can you open a chrome window in vnc screen?
You need a vnc app on your laptop, you can't use a browser!
yes i connect per vnc to the pi and in the pi session i open a chromium browser
see is localhost:81 my pimatic
Ok, looks good. What is the log saying?
the pimatic log say nothing
but there should be information in the deamon.log file on what happened at the startup of Pimatic.
startup pimatic:
12:26:38.265 [pimatic] info: Loading plugin: "pimatic-home-connect" (0.0.2)
when search device:
12:28:42.556 [pimatic] info: pimatic-home-connect: Searching for new devices 12:28:42.557 [pimatic-home-connect] info: Home-connect offline
tis is the only from home-connect, and no errors from other in the log
the login promp not comming
can you check in the home-connect-js directory and then the node_modules if fs is installed?
if not then install fs. Go to home-connect-js and execute command npm install fs
These are normally all automatic installs, but in this manual installation and lot of manual patches need to be done. The fs module is probably missing.
yes that was missing, I installed it with npm i fs and rebooted the vnc session. unfortunately no popup to log in
Please restart pimatic
unfortunately does not work. I also installed the EventSource.
unfortunately it still doesn't work.
how do you do the restart via console or in plugin and then restart?
You can use ssh in a terminal on your laptop or in the vnc window open a terminal. The commands are the same sudo service pimatic restart. You can also restart pimatic via the gui (plugin page)
Hi,
I have installed the plugin in pimatic directly over github. I have type my client ID and secret key.
No device found from home connect and no debug message in pimatic.
Can you write a little guide on how to set it up. I know it's a concept for now