homebridge-melcloud icon indicating copy to clipboard operation
homebridge-melcloud copied to clipboard

'ContextKey' of null

Open yayabing opened this issue 7 years ago • 18 comments

Hello I am very new to this but I have had home bridge up and running for a while now. I have just tried to add in the melcloud plugin and I get the following when I try and run homebridge.

TypeError: Cannot read property 'ContextKey' of null at Request._callback (/usr/local/lib/node_modules/homebridge-melcloud/index.js:77:32) at Request.self.callback (/usr/local/lib/node_modules/homebridge-melcloud/node_modules/request/request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (/usr/local/lib/node_modules/homebridge-melcloud/node_modules/request/request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage. (/usr/local/lib/node_modules/homebridge-melcloud/node_modules/request/request.js:1091:12) at IncomingMessage.g (events.js:292:16) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9)

Can someone help me out here?

yayabing avatar Jun 18 '17 13:06 yayabing

Can you show me your config.json ?

ilcato avatar Jun 18 '17 13:06 ilcato

Thanks for your time.

I am in New Zealand.

This is my config.json { "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 49860, "pin": "031-45-154" },

"platforms": [
    {
        "platform" : "BelkinWeMo",
        "name" : "WeMo Platform"
    },
    {
        "platform": "Melcloud",
        "name": "Melcloud",
        "language": "0",
        "username": "user_name_which_is_an_e-mail",
        "password": "Password"
    }
],
"accessories": [
	{
		"accessory": "SamsungTV2016",
		"name": "Lounge TV",
		"ip_address": "192.168.2.5",
		"mac_address": "xx:xx:xx:xx:xx:xx"
	}
]

}

yayabing avatar Jun 19 '17 08:06 yayabing

  1. on which platform are you running homebridge ?
  2. which version of node.js do you have ?

ilcato avatar Jun 19 '17 08:06 ilcato

I am running homebridge on a mac book pro for testing I normally run homebridge on a raspberry pi.

I have v6.10.3 node.js running on the mac

yayabing avatar Jun 19 '17 10:06 yayabing

When I try to debug using node-debug I get the following

Detached from the Target Remote debugging has been terminated with reason: web socket_closed Please reattach to the new target.

yayabing avatar Jun 19 '17 10:06 yayabing

It seems that you are not able to login. Are you sure you are using valid credentials for Melcloud service?

ilcato avatar Jun 19 '17 11:06 ilcato

I can login using the APP ok with the credentials I have. Is the user name always an e-mail address? Is it an issue with the @ symbol?

yayabing avatar Jun 19 '17 22:06 yayabing

I think I have found the problem in New Zealand and Australia it looks like we have to access the service here. http://www.mitsubishi-electric.co.nz/wifi/#online

not

yayabing avatar Jun 19 '17 23:06 yayabing

Not "https://app.melcloud.com/Mitsubishi.Wifi.Client/Login/ClientLogin";

yayabing avatar Jun 19 '17 23:06 yayabing

or this http://app.melview.net/login.html

yayabing avatar Jun 19 '17 23:06 yayabing

Version: 3.0.539

yayabing avatar Jun 19 '17 23:06 yayabing

https://github.com/lennyby93/node-mmcontrol for Australia and New Zealand Is there a way to make the homebridge work for New Zealand?

yayabing avatar Jun 20 '17 00:06 yayabing

It require a complete refactoring. I will put this request in my to do list.

ilcato avatar Jun 20 '17 10:06 ilcato

Thanks for your time I just tried to register one of my units with Melcloud but it was unable to find my unit. Once again thanks for your time and I look forward to you getting to you getting down your to do list.

yayabing avatar Jun 20 '17 11:06 yayabing

Do you think it would be possible to get my adapter to register with the Melcloud servers?

yayabing avatar Jun 22 '17 22:06 yayabing

I have found out the following

URL : https://api.melview.net/api/Login.aspx Method : POST Retour : JSON

Para : {"user":"login_mame_as_email","pass":"password","appversion":"3.0.558a"}

Unitcapabilities

https://api.melview.net/api/unitcapabilities.aspx

POST {"unitid":0} { "id": "000000", "unitname": "00:00:00:00:00:00", "userunits": 1, "modeltype": 1, "adaptortype": "me", "localip": "xxx.xxx.xxx.xxx", "fanstage": 3, "hasairdir": 0, "hasswing": 0, "hasautomode": 0, "hasautofan": 1, "hasdrymode": 1, "hasairauto": 1, "hasairdirh": 0, "max": { "3": { "min": 16, "max": 30 }, "1": { "min": 17, "max": 28 }, "8": { "min": 19, "max": 28 } }, "time": "01:16 Sat", "error": "ok" }

Unit command https://api.melview.net/api/unitcommand.aspx

POST {"unitid":0,"v":2} { "id": "000000", "power": 1, "standby": 0, "setmode": 1, "automode": 0, "setfan": 0, "settemp": "23", "roomtemp": "19", "airdir": 3, "airdirh": 1, "sendcount": 0, "fault": "", "error": "ok" }

Unit command2 https://api.melview.net/api/unitcommand.aspx

POST {"unitid":000000,"v":2} { "id": "000000", "power": 1, "standby": 0, "setmode": 1, "automode": 0, "setfan": 0, "settemp": "23", "roomtemp": "19", "airdir": 3, "airdirh": 1, "sendcount": 0, "fault": "", "error": "ok" } Unit command Fan Speed https://api.melview.net/api/unitcommand.aspx

POST {"unitid":000000,"v":2,"commands":"FS5"} { "id": "000000", "power": 1, "standby": 0, "setmode": 1, "automode": 0, "setfan": 5, "settemp": "23", "roomtemp": "19", "airdir": 3, "airdirh": 1, "sendcount": 0, "fault": "", "error": "ok" } Unit command Temp Set to 28 https://api.melview.net/api/unitcommand.aspx

POST {"unitid":000000,"v":2,"commands":"TS28"}

Unit command Mode Change https://api.melview.net/api/unitcommand.aspx

POST {"unitid":000000,"v":2,"commands":"MD2"}

Unit command Power off https://api.melview.net/api/unitcommand.aspx

POST {"unitid":000000,"v":2,"commands":"PW0"}

Will this help

yayabing avatar Jul 01 '17 13:07 yayabing

+1 would also like the ability to use the Australia+New Zealand API!

philhar88 avatar Feb 05 '19 22:02 philhar88

+1 me too

bcyng avatar Feb 15 '19 06:02 bcyng