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

Cannot set property #13

Open
chips69 opened this issue Dec 1, 2017 · 10 comments
Open

Cannot set property #13

chips69 opened this issue Dec 1, 2017 · 10 comments

Comments

@chips69
Copy link

chips69 commented Dec 1, 2017

hi

i'm trying to get working homebridge-smart home

but whatever i do i get the same error after running homebridge -D

my config.json is correct i think

{
"bridge": {
"name": "HOME-BRIDGE-DEV",
"username": "9E:08:D9:DF:E9:31",
"port": 51826,
"pin": "031-45-154"
},
"platforms":
{
"platform": "smarthome-mijia",
"web": {
"port": 8888
},
"mijia": {
"sids": ["286c0785ef6a"
],
"passwords": [
"mypassword"
]}
}
}

my error code

[12/1/2017, 1:28:01 AM] [homebridge-smarthome.smarthome-mijia] send msg->{ cmd: 'read', sid: '286c0785ef6a' }
/node_modules/homebridge-smarthome/kit/mijia.js:274
gateway.devices[did] = this.devices[did];
^

TypeError: Cannot set property '158d0001531ab7' of undefined
at data.map (/node_modules/homebridge-smarthome/kit/mijia.js:274:32)
at Array.map (native)
at Mijia.parseMsg (/node_modules/homebridge-smarthome/kit/mijia.js:268:14)
at Socket.udpScoket.on (/node_modules/homebridge-smarthome/kit/mijia.js:111:14)
at emitTwo (events.js:106:13)
at Socket.emit (events.js:194:7)
at UDP.onMessage [as onmessage] (dgram.js:544:8)

the device '158d0001531ab7' is a temperature and humidy sensor V1

could you please help me

thanks for your work ^^

@rench
Copy link
Owner

rench commented Dec 5, 2017

What is the version number of your node.js?

@phenomeus
Copy link

phenomeus commented Dec 14, 2017

hi rench, I get the same error.

`/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:274
gateway.devices[did] = this.devices[did];
^

TypeError: Cannot set property '158d00010f05bb' of undefined
at data.map (/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:274:32)
at Array.map (native)
at Mijia.parseMsg (/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:268:14)
at Socket.udpScoket.on (/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:111:14)
at emitTwo (events.js:106:13)
at Socket.emit (events.js:191:7)
at UDP.onMessage (dgram.js:548:8)`

and here the version of nodejs:
nodejs -v
v6.12.2

@phenomeus
Copy link

phenomeus commented Dec 14, 2017

the ^ is below the "= equal" sign

@rench
Copy link
Owner

rench commented Dec 15, 2017

try update to 1.1.3

@chips69
Copy link
Author

chips69 commented Dec 15, 2017

Hello,

I solved my problem by changing the password.

previously I had put the password in lowercase, numbers and capital letters as in the gateway.

my problem disappeared by putting the password in uppercase.

Regards

@phenomeus
Copy link

phenomeus commented Dec 15, 2017

@rench i was up to date with everything. sorry, saw its pretty fresh. will do and come back. thnks

@phenomeus
Copy link

@chips69 @rench unbelievable but the UPPERCASE Password was the trick… and maybe the update to 1.1.3! please provide this info in the readme!

but I still have a problem. please see log. what can I do?

[2017-12-15 21:48:27] [smarthome-mijia] mijia udp socket receive -> {"cmd":"read_ack","model":"gateway","sid":"286c07889900","short_id":0,"data":"{"rgb":0,"illumination":341,"proto_version":"1.0.6"}"}
/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:328
this.gateways[sid].last_time = new Date();
^

TypeError: Cannot set property 'last_time' of undefined
at Mijia.parseDevice (/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:328:36)
at Mijia.parseMsg (/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:304:14)
at Socket.udpScoket.on (/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:111:14)
at emitTwo (events.js:126:13)
at Socket.emit (events.js:214:7)
at UDP.onMessage [as onmessage] (dgram.js:658:8)

@phenomeus
Copy link

until the last error last_time is fixed I can use this fork: https://github.com/chilinh/homebridge-smarthome

is a merger not the best solution?

@pax0707
Copy link

pax0707 commented Apr 20, 2018

That worked for last_time.
But crashes on enabling bridge light.

@eshchar
Copy link

eshchar commented Jul 26, 2019

i have the same problem.

{
"bridge": {
"name": "Homebridge2",
"username": "myusername",
"port": 5353,
"pin": "031-45-153"
},
"description": "This is an example configuration file with gui. You can use this as a template for creating your own configuration file containing devices you actually own.",
"accessories": [ ],
"platforms": [{
"platform": "config",
"name": "Config",
"port": 8124,
"sudo": true
},
{
"platform": "smarthome-mijia",
"web": {
"port": 8888
},
"mijia": {
"sids": ["04cf8c97847b"],
"passwords": ["mypassword"],
"devices": [
{
"sid": "Captain vacuum",
"name": "Vacuum Cleaner",
"ip": "192.168.50.52",
"token": "mytoken",
"type": "wifi",
"model": "vacuum"
}
]
}
},
{
"platform": "smarthome-broadlink",
"broadlink": {
"devices": [ ]
}
}
]
}

my error code

Got SIGTERM, shutting down Homebridge...
TypeError: Cannot set property 'last_time' of undefined
at Mijia.parseDevice (/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:328:36)
at Mijia.parseMsg (/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:304:14)
at Socket. (/usr/lib/node_modules/homebridge-smarthome/kit/mijia.js:111:14)
at Socket.emit (events.js:196:13)

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

No branches or pull requests

5 participants