esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

PCF8574 don't working if INPUT connect to ground on the start #460

Closed IvanHorban closed 5 years ago

IvanHorban commented 5 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.):

*ESP (ESP32/ESP8266, Board/Sonoff):ESP8266-07*

*Affected component:PCF8574*

*Description of problem:If the input is connected to the ground when ESP8266 loading , it does not react to the state change.*

Problem-relevant YAML-configuration entries:

esphome:
  name: esp8266_work_01
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: ""
  password: ""

# Enable logging
logger:
   level: VERY_VERBOSE

# Enable Home Assistant API
api:
  password: '1234'

ota:
  password: '1234'

status_led:
  pin:
    number: GPIO2
    inverted: True
i2c:
  sda: 4
  scl: 5
  scan: True
dallas:
  - pin: 13
    update_interval: 30000 ms
#sensor:
#  - platform: dallas
#    address: 0x610316643E3FFF28
#    resolution: 12
#    name: "Office Temperature"
#-------------------------------------
#  - platform: uptime
#    name: Uptime Sensor

pcf8574:
  - id: 'pcf8574_hub'
    address: 0x20
    pcf8575: False

# Individual outputs
binary_sensor:
  - platform: gpio
    name: "Input_01"
    device_class: window
    pin:
      pcf8574: pcf8574_hub
      number: 0
      mode: INPUT
      inverted: False
  - platform: status
    name: "Office Temperature"

Traceback (if applicable):

log when INPUT is working.

INFO Reading configuration...
INFO Starting log output from esp8266_work_01.local using esphome API
INFO Connecting to esp8266_work_01.local:6053 (10.31.31.250)
INFO Successfully connected to esp8266_work_01.local
[17:32:01][I][app:101]: esphome version dev compiled on Jun 18 2019, 16:36:47
[17:32:01][C][status_led:019]: Status LED:
[17:32:01][C][status_led:020]:   Pin: GPIO2 (Mode: OUTPUT, INVERTED)
[17:32:01][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:01][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:01][C][wifi:392]: WiFi:
[17:32:01][C][wifi:274]:   SSID: [redacted]
[17:32:01][C][wifi:275]:   IP Address: 10.31.31.250
[17:32:01][C][wifi:277]:   BSSID: [redacted]
[17:32:01][C][wifi:278]:   Hostname: 'esp8266_work_01'
[17:32:01][C][wifi:282]:   Signal strength: -56 dB ▂▄▆█
[17:32:01][C][wifi:283]:   Channel: 7
[17:32:01][C][wifi:284]:   Subnet: 255.255.255.0
[17:32:01][C][wifi:285]:   Gateway: 10.31.31.1
[17:32:01][C][wifi:286]:   DNS1: 10.66.68.70
[17:32:01][C][wifi:287]:   DNS2: 10.61.131.62
[17:32:01][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:01][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:01][C][i2c:028]: I2C Bus:
[17:32:01][C][i2c:029]:   SDA Pin: GPIO4
[17:32:01][C][i2c:030]:   SCL Pin: GPIO5
[17:32:01][C][i2c:031]:   Frequency: 50000 Hz
[17:32:01][I][i2c:033]: Scanning i2c bus for active devices...
[17:32:01][I][i2c:040]: Found i2c device at address 0x20
[17:32:01][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:01][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:01][C][pcf8574:021]: PCF8574:
[17:32:01][C][pcf8574:022]:   Address: 0x20
[17:32:01][C][pcf8574:023]:   Is PCF8575: NO
[17:32:01][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:01][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:01][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Input_01'
[17:32:01][C][gpio.binary_sensor:015]:   Device Class: 'window'
[17:32:01][C][gpio.binary_sensor:016]:   Pin: GPIO0 (Mode: INPUT)
[17:32:01][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:01][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:01][C][logger:137]: Logger:
[17:32:01][C][logger:138]:   Level: VERY_VERBOSE
[17:32:01][C][logger:139]:   Log Baud Rate: 115200
[17:32:01][C][logger:140]:   Hardware UART: UART0
[17:32:01][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:01][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:01][C][status:034]: Status Binary Sensor 'Office Temperature'
[17:32:01][C][status:034]:   Device Class: 'connectivity'
[17:32:01][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:01][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:01][C][dallas.sensor:070]: DallasComponent:
[17:32:01][C][dallas.sensor:071]:   Pin: GPIO13 (Mode: INPUT)
[17:32:01][C][dallas.sensor:072]:   Update Interval: 30.0s
[17:32:01][D][dallas.sensor:077]:   Found sensors:
[17:32:01][D][dallas.sensor:080]:     0x610316643E3FFF28
[17:32:01][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:01][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:01][C][ota:029]: Over-The-Air Updates:
[17:32:01][C][ota:030]:   Address: esp8266_work_01.local:8266
[17:32:01][C][ota:032]:   Using Password.
[17:32:01][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:01][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][C][api:103]: API Server:
[17:32:02][C][api:104]:   Address: esp8266_work_01.local:6053
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][D][binary_sensor:033]: 'Input_01': Sending state OFF
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111110 (0xFE)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][D][binary_sensor:033]: 'Input_01': Sending state ON
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)
[17:32:02][VV][i2c:083]: Requesting 1 bytes from 0x20:
[17:32:02][VV][i2c:113]:     Received 0b11111111 (0xFF)

log when input does not work.

INFO Reading configuration...
INFO Starting log output from esp8266_work_01.local using esphome API
INFO Connecting to esp8266_work_01.local:6053 (10.31.31.250)
INFO Successfully connected to esp8266_work_01.local
[16:45:56][I][app:101]: esphome version dev compiled on Jun 18 2019, 16:36:47
[16:45:56][C][status_led:019]: Status LED:
[16:45:56][C][status_led:020]:   Pin: GPIO2 (Mode: OUTPUT, INVERTED)
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][C][wifi:392]: WiFi:
[16:45:56][C][wifi:274]:   SSID: [redacted]
[16:45:56][C][wifi:275]:   IP Address: 10.31.31.250
[16:45:56][C][wifi:277]:   BSSID: [redacted]
[16:45:56][C][wifi:278]:   Hostname: 'esp8266_work_01'
[16:45:56][C][wifi:282]:   Signal strength: -56 dB ▂▄▆█
[16:45:56][C][wifi:283]:   Channel: 7
[16:45:56][C][wifi:284]:   Subnet: 255.255.255.0
[16:45:56][C][wifi:285]:   Gateway: 10.31.31.1
[16:45:56][C][wifi:286]:   DNS1: 10.66.68.70
[16:45:56][C][wifi:287]:   DNS2: 10.61.131.62
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][C][i2c:028]: I2C Bus:
[16:45:56][C][i2c:029]:   SDA Pin: GPIO4
[16:45:56][C][i2c:030]:   SCL Pin: GPIO5
[16:45:56][C][i2c:031]:   Frequency: 50000 Hz
[16:45:56][I][i2c:033]: Scanning i2c bus for active devices...
[16:45:56][I][i2c:040]: Found i2c device at address 0x20
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][C][pcf8574:021]: PCF8574:
[16:45:56][C][pcf8574:022]:   Address: 0x20
[16:45:56][C][pcf8574:023]:   Is PCF8575: NO
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Input_01'
[16:45:56][C][gpio.binary_sensor:015]:   Device Class: 'window'
[16:45:56][C][gpio.binary_sensor:016]:   Pin: GPIO0 (Mode: INPUT)
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][C][logger:137]: Logger:
[16:45:56][C][logger:138]:   Level: VERY_VERBOSE
[16:45:56][C][logger:139]:   Log Baud Rate: 115200
[16:45:56][C][logger:140]:   Hardware UART: UART0
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][C][status:034]: Status Binary Sensor 'Office Temperature'
[16:45:56][C][status:034]:   Device Class: 'connectivity'
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][C][dallas.sensor:070]: DallasComponent:
[16:45:56][C][dallas.sensor:071]:   Pin: GPIO13 (Mode: INPUT)
[16:45:56][C][dallas.sensor:072]:   Update Interval: 30.0s
[16:45:56][D][dallas.sensor:077]:   Found sensors:
[16:45:56][D][dallas.sensor:080]:     0x610316643E3FFF28
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][C][ota:029]: Over-The-Air Updates:
[16:45:56][C][ota:030]:   Address: esp8266_work_01.local:8266
[16:45:56][C][ota:032]:   Using Password.
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][C][api:103]: API Server:
[16:45:56][C][api:104]:   Address: esp8266_work_01.local:6053
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:56][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:56][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:57][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:57][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)
[16:45:58][VV][i2c:083]: Requesting 1 bytes from 0x20:
[16:45:58][VV][i2c:113]:     Received 0b11111110 (0xFE)

Additional information and things you've tried:

OttoWinter commented 5 years ago

If the input is connected to the ground when ESP8266 loading , it does not react to the state change.

Could you be more specific? What input is connected to ground? What point in time do you mean by ESP8266 loading?

From the logs I only see that the PCF8574 is sending 0xFE and 0xFF data - for me it sounds like the issue is with the PCF8574 unit and not the sw.

IvanHorban commented 5 years ago

The PCF8574 module has 8 pins. If at the moment of the start of the ESP8266 any pin is connected to the ground, it does not react to a change of state. To fix this you need to unplug it from the ground, restart the ESP8266. Then, when connected or disconnected this pin from the ground, this message will appear in the logs. ('Input_01': Sending state OFF or 'Input_01': Sending state ON)

OttoWinter commented 5 years ago

Sounds like a problem with the chip again.

The PCF has a really simple protocol - to read the chip state ESPHome only reads 8bits from the chip over i2c which represents the binary state of each pin. There's notable no setup routine or so involved, so there can't be an issue with wrong sw setup.

onkelbeh commented 5 years ago

Had a similar issue some days ago. I replaced the PCF8574 board and everything worked as expected. I believe there are some bad fake chips on the market. Here's a pic of the bad module:

IMG_3111

The original jumpers are black, i replaced them. To be complete, here's a pic of the good modules: IMG_3113

OttoWinter commented 5 years ago

I guess that concludes the issue, I'm pretty certain there's nothing wrong with the code (it's mainly only 1 line, and I checked that pretty thoroughly). The bad chip explanation would also explain why it only happens to some people.