gcormier / esphome-pressure

esphome board with a differential pressure sensor, supporting a variety of power sources
15 stars 1 forks source link

I2C not reporting on Esphome? #4

Closed benhoff closed 4 months ago

benhoff commented 4 months ago

Hey I have the following for the yaml with esphome:

i2c:
  sda: 6
  scl: 7
  scan: true
  id: bus_a

sensor:
  - platform: xgzp68xx
    temperature:
      name: "Pressure Temperature"
    pressure:
      name: "Pressure Diff pressure"
    update_interval: 5s

However, I'm not seeing the DP sensor in esphome/home assistant. Are the pinout assignments on here correct or anything else I should look into?

gcormier commented 4 months ago

That should work - what do the logs look like?

benhoff commented 4 months ago

They look fine with the exception of not having an I2C sensor in them:

[I][app:029]: Running through setup()...
[C][wifi:038]: Setting up WiFi...
[C][wifi:051]: Starting WiFi...
[C][wifi:052]:   Local MAC: []
[D][wifi:462]: Starting scan...
[W][component:157]: Component wifi set Warning flag: unspecified
[D][wifi:477]: Found networks:
[I][wifi:521]: - '' [redacted]▂▄▆█
[D][wifi:522]:     Channel: 1
[D][wifi:523]:     RSSI: -40 dB
[I][wifi:521]: - '' [redacted]▂▄▆█
[D][wifi:522]:     Channel: 11
[D][wifi:523]:     RSSI: -78 dB
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄[D][wifi:526]: - [redacted] [redacted][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█[D][wifi:526]: - [redacted] [redacted][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]0;36m[D][wifi:526]: - [redacted] [redacted]][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄0;36m[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted]▂▄�
[D][wifi:526]: - [redacted] [redacted]▂▄▆█
[D][wifi:526]: - [redacted] [redacted][D][wifi:526]: - [redacted] [redacted][D][wifi:526]: - [redacted] [redacted][I][wifi:303]: WiFi Connecting to 'ShenHousehold'...
[W][wifi_esp32:482]: Event: Disconnected ssid='' bssid=[redacted] reason='Auth Expired'
[W][wifi:633]: Error while connecting to network.
[D][wifi:677]: Retrying with hidden networks...
[I][wifi:303]: WiFi Connecting to ''...
[I][wifi:597]: WiFi Connected!
[C][wifi:408]:   Local MAC: 
[C][wifi:413]:   SSID: [redacted]
[C][wifi:416]:   IP Address: 
[C][wifi:420]:   BSSID: [redacted]
[C][wifi:421]:   Hostname: 'hvac'
[C][wifi:423]:   Signal strength: -42 dB ▂▄▆█
[C][wifi:427]:   Channel: 1
[C][wifi:428]:   Subnet: 
[C][wifi:429]:   Gateway: 
[C][wifi:430]:   DNS1: 
[C][wifi:431]:   DNS2: 
[D][wifi:606]: Disabling AP...
[C][ota:096]: Over-The-Air Updates:
[C][ota:097]:   Address: hvac.local:3232
[C][ota:100]:   Using Password.
[C][ota:103]:   OTA version: 2.
[C][api:025]: Setting up Home Assistant API server...
[I][app:062]: setup() finished successfully!
[W][component:170]: Component wifi cleared Warning flag
[W][component:157]: Component api set Warning flag: unspecified
[I][app:100]: ESPHome version 2024.4.2 compiled on May  4 2024, 20:00:15
[C][wifi:580]: WiFi:
[C][wifi:408]:   Local MAC: 
[C][wifi:413]:   SSID: [redacted]
[C][wifi:416]:   IP Address: 
[C][wifi:420]:   BSSID: [redacted]
[C][wifi:421]:   Hostname: 'hvac'
[C][wifi:423]:   Signal strength: -40 dB ▂▄▆█
[C][wifi:427]:   Channel: 1
[C][wifi:428]:   Subnet: 255.255.255.0
[C][wifi:429]:   Gateway: 
[C][wifi:430]:   DNS1: 
[C][wifi:431]:   DNS2: 
[C][logger:166]: Logger:
[C][logger:167]:   Level: DEBUG
[C][logger:169]:   Log Baud Rate: 115200
[C][logger:170]:   Hardware UART: USB_CDC
[C][captive_portal:088]: Captive Portal:
[C][mdns:115]: mDNS:
[C][mdns:116]:   Hostname: hvac
[C][ota:096]: Over-The-Air Updates:
[C][ota:097]:   Address: hvac.local:3232
[C][ota:100]:   Using Password.
[C][ota:103]:   OTA version: 2.
[C][api:139]: API Server:
[C][api:140]:   Address: hvac.local:6053
[C][api:142]:   Using noise encryption: YES
[D][api:102]: Accepted 192.168.1.101
[W][component:170]: Component api cleared Warning flag
[D][api.connection:1210]: Home Assistant 2024.5.2 (192.168.1.101): Connected successfully
gcormier commented 4 months ago

Can you set the esphome logger to debug so we can see if it's scanning the i2c bus and what's happening?

benhoff commented 4 months ago

Weird, setting the logger triggered the sensor to update. I must have had some cached build files with invalid settings and rebuilding with debug must have cleared the cache.

Thanks for the sweet device!

gcormier commented 4 months ago

Awesome glad it is working :) Let me know how you end up using it - would be great to add more examples and use-cases to the repo.