forty2 / hap-client-tool Goto Github PK
View Code? Open in Web Editor NEWCLI tool for controlling HomeKit devices
License: MIT License
CLI tool for controlling HomeKit devices
License: MIT License
Hi,
is it possible to connect also to BLE devices?
Thanks
tuabu∮core →sudo npm i -g hap-client-tool
npm ERR! code 1
npm ERR! path /usr/lib/node_modules/hap-client-tool/node_modules/keytar
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! make: Entering directory '/usr/lib/node_modules/hap-client-tool/node_modules/keytar/build'
npm ERR! CXX(target) Release/obj.target/keytar/src/async.o
npm ERR! make: Leaving directory '/usr/lib/node_modules/hap-client-tool/node_modules/keytar/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.10.1 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/hap-client-tool/node_modules/keytar/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/17.3.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/17.3.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/17.3.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/lib/node_modules/hap-client-tool/node_modules/keytar',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/async.cc:4:
npm ERR! ../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
npm ERR! ../node_modules/nan/nan.h:2298:7: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
npm ERR! 2298 | , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from ../node_modules/nan/nan.h:2884,
npm ERR! from ../src/async.cc:4:
npm ERR! ../node_modules/nan/nan_typedarray_contents.h: In constructor ‘Nan::TypedArrayContents::TypedArrayContents(v8::Localv8::Value)’:
npm ERR! ../node_modules/nan/nan_typedarray_contents.h:34:43: error: ‘class v8::ArrayBuffer’ has no member named ‘GetContents’
npm ERR! 34 | data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
npm ERR! | ^~~~~~~~~~~
npm ERR! make: *** [keytar.target.mk:117: Release/obj.target/keytar/src/async.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make
failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.15.11-arch2-1
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /usr/lib/node_modules/hap-client-tool/node_modules/keytar
npm ERR! gyp ERR! node -v v17.3.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-12-24T22_24_28_402Z-debug-0.log
When trying to dump a HomeKit device with the command:
hap-client-tool -d LUTRON-xxxxxxxx.local -p 4548 dump
I get this message:
Could not get LTPK for accessory xx:xx:xx:xx:xx
where the Xs are the HomeKit ID of the device I'm trying to dump.
Hi Zach,
awesome work! Just wanted to point you on another usecase for the hap-client(-tool):
I just started to implement test-automation for https://github.com/hobbyquaker/homekit2mqtt and with your hap-client I have to possibility to do real system tests and get the test coverage nearer to 100% ;-)
Thanks and keep up the good work,
Sebastian
Hi,
I‘d like to integrate my HomeKit based door sensors into my mqtt based OpenHAB controlled home automation.
HapClient seems to be helpful, but I don‘t understand how to configure it. Which IP and port are requiered? Could you assist?
/Ulrich
Ubuntu 16.04
Any ideas how to solve sodium install ?
Makefile:80: recipe for target 'nodesodium' failed
make: *** [nodesodium] Error 1
/usr/local/lib/node_modules/hap-client-tool/node_modules/sodium/install.js:287
throw new Error(cmdLine + ' exited with code ' + code);
^
Error: make nodesodium exited with code 2
at ChildProcess. (/usr/local/lib/node_modules/hap-client-tool/node_modules/sodium/install.js:287:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
/usr/local/lib
└── (empty)
npm ERR! Linux 4.4.0-87-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "hap-client-tool"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
hap-client-tool -c mqtt2homekit -d 1.... -p 80 pair
Error: Cannot autolaunch D-Bus without X11 $DISPLAY
at Error (native)
Do I need UI to run this ?
I got this when first running:
module.js:549
throw err;
^
Error: Cannot find module 'debug'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/technicalpickles/.nodenv/versions/8.11.3/lib/node_modules/hap-client-tool/node_modules/message-socket/dist/index.js:26:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
I was able to fix with npm install -g debug
.
Hello,
Could you tell me how to install hap-client-tool with npm because it doesn't work with the last release:
I can't install it
pi@raspberrypi:~ $ sudo su -
root@raspberrypi:~# npm install -g hap-client-tool
> [email protected] preinstall /usr/lib/node_modules/hap-client-tool/node_modules/sodium
> node install.js --preinstall
Static libsodium was not found at /usr/lib/node_modules/hap-client-tool/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source.
libtoolize: error: Failed to create 'build-aux'
make: *** [libsodium] Erreur 1
Makefile:61 : la recette pour la cible « libsodium » a échouée
/usr/lib/node_modules/hap-client-tool/node_modules/sodium/install.js:287
throw new Error(cmdLine + ' exited with code ' + code);
^
Error: make libsodium exited with code 2
at ChildProcess.<anonymous> (/usr/lib/node_modules/hap-client-tool/node_modules/sodium/install.js:287:19)
at ChildProcess.emit (events.js:182:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
[ ......] - preinstall: info lifecycle [email protected]~preinstall: Failed to exec preinstall script
[ ......] - preinstall: info lifecycle [email protected]~preinstall: Failed to exec preinstall script
[ ......] - preinstall: info lifecycle [email protected]~preinstall: Failed to exec preinstall script
[ ......] - preinstall: info lifecycle [email protected]~preinstall: Failed to exec preinstall script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: `node install.js --preinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-09-30T21_12_49_170Z-debug.log
Regards,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.