Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hass discovery #20

Merged
merged 48 commits into from
Nov 30, 2020
Merged

feat: hass discovery #20

merged 48 commits into from
Nov 30, 2020

Conversation

robertsLando
Copy link
Member

No description provided.

@robertsLando
Copy link
Member Author

robertsLando commented Nov 20, 2020

Missing:

@varet80
Copy link
Collaborator

varet80 commented Nov 23, 2020

compiling the container causes the following

- zwavejs2mqtt-5c78f7b7fb-ssspw
+ zwavejs2mqtt-6dcf895c77-qnjpq › z2m
zwavejs2mqtt-6dcf895c77-qnjpq z2m 2020-11-23T18:43:01.366Z z2m:Store scenes.json not found
zwavejs2mqtt-6dcf895c77-qnjpq z2m Error: Cannot find module 'zwave-js/node_modules/@zwave-js/core'
zwavejs2mqtt-6dcf895c77-qnjpq z2m Require stack:
zwavejs2mqtt-6dcf895c77-qnjpq z2m - /usr/src/app/lib/Gateway.js
zwavejs2mqtt-6dcf895c77-qnjpq z2m - /usr/src/app/node_modules/app-root-path/lib/app-root-path.js
zwavejs2mqtt-6dcf895c77-qnjpq z2m - /usr/src/app/node_modules/app-root-path/index.js
zwavejs2mqtt-6dcf895c77-qnjpq z2m - /usr/src/app/bin/www
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Function.Module._load (internal/modules/cjs/loader.js:687:27)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Module.require (internal/modules/cjs/loader.js:903:19)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at require (internal/modules/cjs/helpers.js:74:18)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Object.<anonymous> (/usr/src/app/lib/Gateway.js:13:28)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Module._compile (internal/modules/cjs/loader.js:1015:30)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Module.load (internal/modules/cjs/loader.js:879:32)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Function.Module._load (internal/modules/cjs/loader.js:724:14)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Module.require (internal/modules/cjs/loader.js:903:19)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at require (internal/modules/cjs/helpers.js:74:18)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at require (/usr/src/app/node_modules/app-root-path/lib/app-root-path.js:14:11)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Object.<anonymous> (/usr/src/app/app.js:12:15)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Module._compile (internal/modules/cjs/loader.js:1015:30)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
zwavejs2mqtt-6dcf895c77-qnjpq z2m     at Module.load (internal/modules/cjs/loader.js:879:32) {
zwavejs2mqtt-6dcf895c77-qnjpq z2m   code: 'MODULE_NOT_FOUND',
zwavejs2mqtt-6dcf895c77-qnjpq z2m   requireStack: [
zwavejs2mqtt-6dcf895c77-qnjpq z2m     '/usr/src/app/lib/Gateway.js',
zwavejs2mqtt-6dcf895c77-qnjpq z2m     '/usr/src/app/node_modules/app-root-path/lib/app-root-path.js',
zwavejs2mqtt-6dcf895c77-qnjpq z2m     '/usr/src/app/node_modules/app-root-path/index.js',
zwavejs2mqtt-6dcf895c77-qnjpq z2m     '/usr/src/app/bin/www'
zwavejs2mqtt-6dcf895c77-qnjpq z2m   ]
zwavejs2mqtt-6dcf895c77-qnjpq z2m }

hass/devices.js Outdated Show resolved Hide resolved
@varet80
Copy link
Collaborator

varet80 commented Nov 24, 2020

I am posting separate comments, as it is three separate issues.
My Climate_thermostat is not working as expected here is the discovery and error on the template

zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:27.352Z z2m:App Zwave api call: refreshInfo [ 24 ]
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:27.395Z z2m:Zwave Success zwave api call refreshInfo
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:28.980Z z2m:Zwave Node 64: metadata updated: 49-0-Power
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:28.981Z z2m:Zwave Node 64: value updated: 49-0-Power 82.3 => 88.1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:33.095Z z2m:Zwave Node 64: metadata updated: 49-0-Power
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:33.096Z z2m:Zwave Node 64: value updated: 49-0-Power 88.1 => 79.8
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:33.292Z z2m:Zwave Node 64: metadata updated: 49-0-Power
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:33.293Z z2m:Zwave Node 64: value updated: 49-0-Power 79.8 => 84.1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:40.338Z z2m:Zwave Node 24: value added: 114-0-manufacturerId => 328
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:40.339Z z2m:Zwave Node 24: value added: 114-0-productType => 3
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:40.339Z z2m:Zwave Node 24: value added: 114-0-productId => 1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:41.014Z z2m:Zwave Node 24: value added: 134-0-libraryType => 3
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:41.015Z z2m:Zwave Node 24: value added: 134-0-protocolVersion => 4.61
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:41.015Z z2m:Zwave Node 24: value added: 134-0-firmwareVersions => [ '0.16' ]
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:41.979Z z2m:Zwave Node 64: metadata updated: 49-0-Power
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:41.980Z z2m:Zwave Node 64: value updated: 49-0-Power 84.1 => 79.8
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:42.978Z z2m:Zwave Node 64: metadata updated: 49-0-Power
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:42.979Z z2m:Zwave Node 64: value updated: 49-0-Power 79.8 => 85.8
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:44.478Z z2m:Zwave Node 24: value added: 94-0-zwavePlusVersion => 1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:44.479Z z2m:Zwave Node 24: value added: 94-0-nodeType => 0
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:44.479Z z2m:Zwave Node 24: value added: 94-0-roleType => 7
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:44.479Z z2m:Zwave Node 24: value added: 94-0-installerIcon => 4608
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:44.479Z z2m:Zwave Node 24: value added: 94-0-userIcon => 4608
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:44.686Z z2m:Zwave Node 24: value added: 128-0-level => 95
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:44.686Z z2m:Zwave Node 24: value added: 128-0-isLow => false
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:44.896Z z2m:Zwave Node 24: metadata updated: 64-0-mode
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:45.116Z z2m:Zwave Node 24: value added: 64-0-mode => 1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:45.541Z z2m:Zwave Node 24: metadata updated: 67-0-setpoint-1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:45.759Z z2m:Zwave Node 24: value added: 67-0-setpoint-1 => 19
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:45.968Z z2m:Zwave Node 24: metadata updated: 67-0-setpoint-11
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:46.177Z z2m:Zwave Node 24: value added: 67-0-setpoint-11 => 18
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:46.387Z z2m:Zwave Node 24: value added: 117-0-local => 0
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.017Z z2m:Zwave Node 24: metadata updated: 49-0-Air temperature
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.017Z z2m:Zwave Node 24: value added: 49-0-Air temperature => 18.4
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.034Z z2m:Zwave Node 24: metadata updated: 38-0-Up
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.035Z z2m:Zwave Node 24: metadata updated: 38-0-Down
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.226Z z2m:Zwave Node 24: value added: 38-0-targetValue => undefined
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.227Z z2m:Zwave Node 24: value added: 38-0-currentValue => 13
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.250Z z2m:Zwave Node 24: metadata updated: 112-0-1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.251Z z2m:Zwave Node 24: metadata updated: 112-0-2
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.251Z z2m:Zwave Node 24: metadata updated: 112-0-3
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.251Z z2m:Zwave Node 24: metadata updated: 112-0-4
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.252Z z2m:Zwave Node 24: metadata updated: 112-0-5
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.252Z z2m:Zwave Node 24: metadata updated: 112-0-6
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.252Z z2m:Zwave Node 24: metadata updated: 112-0-7
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.252Z z2m:Zwave Node 24: metadata updated: 112-0-8
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.443Z z2m:Zwave Node 24: value added: 112-0-1 => 0
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.660Z z2m:Zwave Node 24: value added: 112-0-2 => 0
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:47.882Z z2m:Zwave Node 24: value added: 112-0-3 => 1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:48.101Z z2m:Zwave Node 24: value added: 112-0-4 => 1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:48.323Z z2m:Zwave Node 24: value added: 112-0-5 => 2
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:48.542Z z2m:Zwave Node 24: value added: 112-0-6 => 1
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:48.762Z z2m:Zwave Node 24: value added: 112-0-7 => 2
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:48.979Z z2m:Zwave Node 24: value added: 112-0-8 => 0
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:50.541Z z2m:Zwave Node 24: metadata updated: 113-0-Power Management-Battery maintenance status
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:50.747Z z2m:Zwave Node 24: metadata updated: 113-0-System-Hardware status
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:50.784Z z2m:Zwave Node 24: interview completed, all values are updated
zwavejs2mqtt-bd558b8f-m7l2b z2m 2020-11-24T07:30:50.785Z z2m:Gateway Error while discovering device climate_thermostat of node 24: Cannot read property 'id' of undefined

this is a SPIRITz all of these do behave the same.

@robertsLando
Copy link
Member Author

compiling the container causes the following

Did you fixed this? I think it's a user error

@varet80
Copy link
Collaborator

varet80 commented Nov 24, 2020

I compiled on my WSL2 and my mac + an extra machine with your instructions I still get the same module error!

from my wsl2 using ubuntu 20.04


> [email protected] start /home/billias/ongit/zwavejs2mqtt
> node bin/www

  z2m:Store settings.json not found +0ms
  z2m:Store scenes.json not found +3ms
  z2m:Store nodes.json not found +0ms
{ Error: Cannot find module 'zwave-js/node_modules/@zwave-js/core'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/billias/ongit/zwavejs2mqtt/lib/Gateway.js:13:28)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at require (/home/billias/ongit/zwavejs2mqtt/node_modules/app-root-path/lib/app-root-path.js:14:11)
    at Object.<anonymous> (/home/billias/ongit/zwavejs2mqtt/app.js:12:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) code: 'MODULE_NOT_FOUND' }
❯ git pull
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Total 9 (delta 8), reused 9 (delta 8), pack-reused 0
Unpacking objects: 100% (9/9), 1.25 KiB | 75.00 KiB/s, done.
From github.com:zwave-js/zwavejs2mqtt
   17280f5..af55b9b  master     -> origin/master
Already up to date.

╭─░▒▓  ~/ongit/zwavejs2mqtt    feat#hassDiscovery !8 ───

the !8 is after compilation, new files

@robertsLando
Copy link
Member Author

robertsLando commented Nov 24, 2020

@AlCalzone where could cannot find module @zwave-js/core' error come from?

@robertsLando
Copy link
Member Author

@billiaz What device is this? I mean the thermostat you are using

@robertsLando
Copy link
Member Author

@billiaz Pull latest and retry :)

@coveralls
Copy link

coveralls commented Nov 24, 2020

Pull Request Test Coverage Report for Build 391618089

  • 188 of 486 (38.68%) changed or added relevant lines in 7 files are covered.
  • 29 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.5%) to 28.785%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app.js 0 7 0.0%
lib/ZwaveClient.js 0 31 0.0%
lib/Gateway.js 52 312 16.67%
Files with Coverage Reduction New Missed Lines %
lib/utils.js 1 85.19%
lib/Gateway.js 28 21.52%
Totals Coverage Status
Change from base Build 387238528: 0.5%
Covered Lines: 1827
Relevant Lines: 6474

💛 - Coveralls

@robertsLando
Copy link
Member Author

@chrisns Give this a look when you have time please :) expecially on README

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
lib/Gateway.js Outdated Show resolved Hide resolved
lib/Gateway.js Show resolved Hide resolved
lib/Gateway.js Show resolved Hide resolved
@robertsLando
Copy link
Member Author

@billiaz Is there something else that is failing?

@robertsLando robertsLando merged commit 3794e34 into master Nov 30, 2020
@robertsLando robertsLando deleted the feat#hassDiscovery branch November 30, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants