PJCzx / homebridge-thermostat

Supports thermostat devices on HomeBridge Platform
Apache License 2.0
34 stars 71 forks source link

Fake.js not working #41

Closed JamesKnevitt closed 5 years ago

JamesKnevitt commented 5 years ago

Hi,

I am trying to use this project with the Fake.js setup with x2 Raspberry pi's; one with Homebridge (192.168.0.150) and the other pi running the fake.js (192.168.0.160), but am not getting any communication between the two.

Is this an issue with my setup somewhere or an issue with the code? Homebridge is configured with the following and has a Thermostat appearing in Homekit

        "accessories": [{
                "accessory": "Thermostat",
                "name": "Thermostat",
                "apiroute": "http://192.168.0.160:12000"
        }]

The other pi has the fake.js running with the only change being the port number, as follows:

var server = app.listen(12000, function () {
  var host = server.address().address;
  var port = server.address().port;
  console.log('Global : app listening at', host, port);
});

The fake.js prints the following when executing: Global : app listening at :: 12000 - which doesn't seem to specify a host prior to the port, but not sure if this is normal.

I can't see any other configuration/setup I am missing, could this be a code issue?

Thanks James

JamesKnevitt commented 5 years ago

I just found an issue with the API line. I don't understand it, but when editing it again via ssh the cursor position seemed to be offset from the actual column that was edited. Deleting the entire line and rewriting it seemed to fix my issue.

PJCzx commented 5 years ago

Hello,

Quite a long time I haven’t work on this project ^^ It’s now a bit far in my head ^^ I feel it’s a port issue. What do you get when visiting http://192.168.0.160:12000 with your browser ?

If you have a result, set the port 80 and try http://192.168.0.160 If again you have a result change the other rpi config. If everything works, I guess the port parameters should be added in another method. Pierre-Julien Cazaux, Sent from my mobile device.

Le 22 juil. 2019 à 23:43, JamesKnevitt notifications@github.com a écrit :

http://192.168.0.160:12000