lucavb / homebridge-esphome-ts

This plugin integrates your esphome devices into HomeKit!
GNU General Public License v3.0
45 stars 16 forks source link

Mh-z19 and CO2 value #75

Closed earlywaff closed 3 years ago

earlywaff commented 3 years ago

Hi, is it possible to add an mh-z19 and a CO2 sensor?

[2021-3-20 20:39:00] [esphome] MH-Z19 CO2 Value could not be mapped to HomeKit. Please file an issue on Github. [2021-3-20 20:39:00] [esphome] MH-Z19 Temperature discovered and setup.

lucavb commented 3 years ago

That is a good question. In theory HomeKit seems to support CO2 Sensor, however this requires at least having some value after which the quality is considered "bad". Not impossible, just need to decide how I this should be done. In the meantime, you could download this file on the machine where you have homebridge running, unpack it, change into the new directory and edit the index.js file. There is a line that reads

const device = new EspDevice('your ip goes here');

Replace the your ip goes here with the IP address for your esp device with the sensor. Afterwards you can run npm run start and please post the output here.

co2.zip