home-assistant / supervisor

:house_with_garden: Home Assistant Supervisor
https://home-assistant.io/hassio/
Apache License 2.0
1.67k stars 611 forks source link

Component sensor:MH-Z19 fails to initialize #370

Closed sharukins closed 5 years ago

sharukins commented 6 years ago

I attached an MH-Z19 sensor to the GPIO pins of my Raspberry Pi 3 according to this. Under Raspbian this sensor is accessed by the python library pmsensor via /dev/serial0. This is special to the Raspberry Pi 3 as /dev/ACAM0 is used for the bluetooth connection. The problem is that under Hass.io the serial port for the GPIO pins is visible via the debug access to the host system (/dev/serial1) but this is not exposed to the home assistant docker. I assume this means that any sensor using a serial connection to the GPIO pins is at the moment broken for the raspberry pi 3 platform.

pvizeli commented 6 years ago

You have only this device if you disable bluetooth with config.txt. I use GPIO with RPI3 and that work fine on my devices.

Use the hassio host hardware to see the real device name, serial0 is a fake alias.

sharukins commented 6 years ago

ah sorry, now I understand. /dev/serial is a symlink to /dev/AMA0 But the MH-Z19 component fails to set up though. The only error messages I get are: Setup of platform mhz19 is taking over 10 seconds. 6:45 PM bootstrap.py (WARNING) Setup of platform mhz19 is taking longer than 60 seconds. Startup will proceed without waiting any longer. 6:46 PM helpers/entity_platform.py (ERROR)

Joyphor commented 6 years ago

same here:

Setup of platform mhz19 is taking longer than 60 seconds. Startup will proceed without waiting any longer.

MH-Z19 is tested and working. Hassio - Home Assistant 0.69.1

config:

  - platform: mhz19
    serial_device: /dev/ttyAMA0
    name: MHZ19 CO2 Sensor
    monitored_conditions:
      - co2
      - temperature

Does this mean usage of the mhz19 is only possible when bluetooth is disabled?

frenck commented 5 years ago

@Joyphor Yes, that is correct.