rench / homebridge-smarthome

this is a homebridge plugin for mijia eco-chain but also a management webapp provide web and restapi to manage your mijia eco-chain,you can control and monitor your accessory via apple's homekit or the webapp
MIT License
39 stars 6 forks source link

[SOLVED] Aquara Temperatur / Humidity / Pressure sensor issue #18

Open MrTomAsh opened 6 years ago

MrTomAsh commented 6 years ago

Hi,

there's an error in the code when you adding one of these bad boys.

Please change /kit/mijia/index.js from line 76 from this:

let humidityV1 = new HumidityV1(mijia);
  let temperatureV1 = new TemperatureV1(mijia);
  devices['weather.v1'] = {
    parseMsg: (json, rinfo) => {
      humidityV1.parseMsg(json, rinfo);
      temperatureV1.parseMsg(json, rinfo);
      PressureV1.parseMsg(json, rinfo);
    }
  }

to this:

let humidityV1 = new HumidityV1(mijia);
  let temperatureV1 = new TemperatureV1(mijia);
  let presureV1 = new PressureV1(mijia);
  devices['weather.v1'] = {
    parseMsg: (json, rinfo) => {
      humidityV1.parseMsg(json, rinfo);
      temperatureV1.parseMsg(json, rinfo);
      presureV1.parseMsg(json, rinfo);
    }
  }

Also, the line 58 in pressure.v1.js has to be commented as there's no AtmosphericPressureLevel characteristic in the HomeBridge (not supported by HomeKit at all atm).

Thanks!

MrTomAsh commented 6 years ago

You can find my updated version of this repository in here: https://github.com/MrTomAsh/homebridge-smarthome

pax0707 commented 6 years ago

@MrTomAsh Could you take a look at #13 ? I have last_time error with your fork too.