Hi All,
I’m hoping someone out there can have a look over my Yaml and spot where I have gone wrong. here is what is happening… as far as I can tell from the logs output from this little sensor everything is working perfectly the LED’s flash to show they are booting, searching for WIFI and Connected to WIFI and HA… BUT I can’t see the states on Home assistant, it’s not that they are unavailable or sowing the wrong data… no… they are just not there at all …
here is my log output
INFO ESPHome 2024.10.3
INFO Reading configuration /config/esphome/sensor-lounge.yaml...
INFO Detected timezone 'Europe/London'
INFO Starting log output from 192.168.0.151 using esphome API
INFO Successfully connected to sensor-lounge @ 192.168.0.151 in 0.004s
INFO Successful handshake with sensor-lounge @ 192.168.0.151 in 0.028s
[19:15:47][I][app:100]: ESPHome version 2024.10.3 compiled on Nov 15 2024, 19:14:43
[19:15:47][C][wifi:600]: WiFi:
[19:15:47][C][wifi:428]: Local MAC: ************
[19:15:47][C][wifi:433]: SSID: [redacted]
[19:15:47][C][wifi:436]: IP Address: 192.168.0.151
[19:15:47][C][wifi:439]: BSSID: [redacted]
[19:15:47][C][wifi:441]: Hostname: 'sensor-lounge'
[19:15:47][C][wifi:443]: Signal strength: -68 dB ▂▄▆█
[19:15:47][C][wifi:447]: Channel: 1
[19:15:47][C][wifi:448]: Subnet: 255.255.255.0
[19:15:47][C][wifi:449]: Gateway: 192.168.0.254
[19:15:47][C][wifi:450]: DNS1: 192.168.0.254
[19:15:47][C][wifi:451]: DNS2: 0.0.0.0
[19:15:47][C][logger:185]: Logger:
[19:15:47][C][logger:186]: Level: DEBUG
[19:15:47][C][logger:188]: Log Baud Rate: 115200
[19:15:47][C][logger:189]: Hardware UART: UART0
[19:15:47][C][i2c.arduino:071]: I2C Bus:
[19:15:47][C][i2c.arduino:072]: SDA Pin: GPIO4
[19:15:47][C][i2c.arduino:073]: SCL Pin: GPIO5
[19:15:47][C][i2c.arduino:074]: Frequency: 50000 Hz
[19:15:47][C][i2c.arduino:086]: Recovery: bus successfully recovered
[19:15:47][I][i2c.arduino:096]: Results from i2c bus scan:
[19:15:47][I][i2c.arduino:102]: Found i2c device at address 0x39
[19:15:47][C][uptime.sensor:033]: Uptime Sensor 'lounge Sensor uptime do not use'
[19:15:47][C][uptime.sensor:033]: Device Class: 'duration'
[19:15:47][C][uptime.sensor:033]: State Class: 'total_increasing'
[19:15:47][C][uptime.sensor:033]: Unit of Measurement: 's'
[19:15:47][C][uptime.sensor:033]: Accuracy Decimals: 0
[19:15:47][C][uptime.sensor:033]: Icon: 'mdi:timer-outline'
[19:15:47][C][uptime.sensor:034]: Type: Seconds
[19:15:47][C][template.text_sensor:020]: Template Sensor 'lounge Sensor Uptime'
[19:15:47][C][template.text_sensor:020]: Icon: 'mdi:clock-start'
[19:15:47][C][esp8266_pwm:022]: ESP8266 PWM:
[19:15:47][C][esp8266_pwm:023]: Pin: GPIO14
[19:15:47][C][esp8266_pwm:024]: Frequency: 1000.0 Hz
[19:15:47][C][esp8266_pwm:025]: Inverted: YES
[19:15:47][C][esp8266_pwm:022]: ESP8266 PWM:
[19:15:47][C][esp8266_pwm:023]: Pin: GPIO12
[19:15:47][C][esp8266_pwm:024]: Frequency: 1000.0 Hz
[19:15:47][C][esp8266_pwm:025]: Inverted: YES
[19:15:47][C][esp8266_pwm:022]: ESP8266 PWM:
[19:15:47][C][esp8266_pwm:023]: Pin: GPIO13
[19:15:47][C][esp8266_pwm:024]: Frequency: 1000.0 Hz
[19:15:47][C][esp8266_pwm:025]: Inverted: YES
[19:15:47][C][light:103]: Light 'lounge Decorative Light'
[19:15:47][C][light:105]: Default Transition Length: 1.0s
[19:15:47][C][light:106]: Gamma Correct: 2.80
[19:15:47][C][homeassistant.time:010]: Home Assistant Time:
[19:15:47][C][homeassistant.time:011]: Timezone: 'GMT0BST,M3.5.0/1,M10.5.0'
[19:15:47][C][tsl2561:040]: TSL2561 'lounge Ambient Light'
[19:15:47][C][tsl2561:040]: Device Class: 'illuminance'
[19:15:47][C][tsl2561:040]: State Class: 'measurement'
[19:15:47][C][tsl2561:040]: Unit of Measurement: 'lx'
[19:15:47][C][tsl2561:040]: Accuracy Decimals: 1
[19:15:47][C][tsl2561:040]: Icon: 'mdi:lightbulb-on-outline'
[19:15:47][C][tsl2561:041]: Address: 0x39
[19:15:47][C][tsl2561:048]: Gain: 1x
[19:15:47][C][tsl2561:049]: Integration Time: 402.0 ms
[19:15:47][C][tsl2561:051]: Update Interval: 60.0s
[19:15:47][C][dht:017]: DHT:
[19:15:47][C][dht:018]: Pin: GPIO0
[19:15:47][C][dht:022]: Model: DHT11
[19:15:47][C][dht:027]: Update Interval: 60.0s
[19:15:47][C][dht:029]: Temperature 'lounge Temperature'
[19:15:47][C][dht:029]: Device Class: 'temperature'
[19:15:47][C][dht:029]: State Class: 'measurement'
[19:15:47][C][dht:029]: Unit of Measurement: '°C'
[19:15:47][C][dht:029]: Accuracy Decimals: 1
[19:15:47][C][dht:030]: Humidity 'lounge Humidity'
[19:15:47][C][dht:030]: Device Class: 'humidity'
[19:15:47][C][dht:030]: State Class: 'measurement'
[19:15:47][C][dht:030]: Unit of Measurement: '%'
[19:15:47][C][dht:030]: Accuracy Decimals: 1
[19:15:47][C][version.text_sensor:021]: Version Text Sensor 'lounge Sensor ESPHome version'
[19:15:47][C][version.text_sensor:021]: Icon: 'mdi:new-box'
[19:15:47][C][restart:068]: Restart Switch 'lounge Sensor Restart'
[19:15:47][C][restart:070]: Icon: 'mdi:restart'
[19:15:47][C][restart:090]: Restore Mode: always OFF
[19:15:47][C][captive_portal:089]: Captive Portal:
[19:15:47][C][web_server:153]: Web Server:
[19:15:47][C][web_server:154]: Address: sensor-lounge.local:80
[19:15:47][C][mdns:116]: mDNS:
[19:15:47][C][mdns:117]: Hostname: sensor-lounge
[19:15:47][C][esphome.ota:073]: Over-The-Air updates:
[19:15:47][C][esphome.ota:074]: Address: sensor-lounge.local:8266
[19:15:47][C][esphome.ota:075]: Version: 2
[19:15:47][C][safe_mode:018]: Safe Mode:
[19:15:47][C][safe_mode:019]: Boot considered successful after 60 seconds
[19:15:47][C][safe_mode:021]: Invoke after 10 boot attempts
[19:15:47][C][safe_mode:022]: Remain in safe mode for 300 seconds
[19:15:47][C][api:140]: API Server:
[19:15:47][C][api:141]: Address: sensor-lounge.local:6053
[19:15:47][C][api:145]: Using noise encryption: NO
[19:15:47][C][wifi_signal.sensor:010]: WiFi Signal 'lounge Sensor WiFi signal'
[19:15:47][C][wifi_signal.sensor:010]: Device Class: 'signal_strength'
[19:15:47][C][wifi_signal.sensor:010]: State Class: 'measurement'
[19:15:47][C][wifi_signal.sensor:010]: Unit of Measurement: 'dBm'
[19:15:47][C][wifi_signal.sensor:010]: Accuracy Decimals: 0
[19:15:56][D][tsl2561:126]: Got illuminance=12.8lx
[19:15:56][D][sensor:093]: 'lounge Ambient Light': Sending state 12.81966 lx with 1 decimals of accuracy
[19:16:01][D][dht:048]: Got Temperature=21.5°C Humidity=62.0%
[19:16:01][D][sensor:093]: 'lounge Temperature': Sending state 21.50000 °C with 1 decimals of accuracy
[19:16:01][D][sensor:093]: 'lounge Humidity': Sending state 62.00000 % with 1 decimals of accuracy
[19:16:19][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[19:16:56][D][tsl2561:126]: Got illuminance=12.8lx
[19:16:56][D][sensor:093]: 'lounge Ambient Light': Sending state 12.81966 lx with 1 decimals of accuracy
[19:17:01][D][dht:048]: Got Temperature=21.5°C Humidity=59.0%
[19:17:01][D][sensor:093]: 'lounge Temperature': Sending state 21.50000 °C with 1 decimals of accuracy
[19:17:01][D][sensor:093]: 'lounge Humidity': Sending state 59.00000 % with 1 decimals of accuracy
[19:17:56][D][tsl2561:126]: Got illuminance=12.8lx
[19:17:56][D][sensor:093]: 'lounge Ambient Light': Sending state 12.81966 lx with 1 decimals of accuracy
[19:17:58][W][api.connection:105]: ESPHome Logs 2024.10.3 (192.168.0.32): Connection closed
[19:18:01][D][dht:048]: Got Temperature=21.5°C Humidity=59.0%
[19:18:01][D][sensor:093]: 'lounge Temperature': Sending state 21.50000 °C with 1 decimals of accuracy
[19:18:01][D][sensor:093]: 'lounge Humidity': Sending state 59.00000 % with 1 decimals of accuracy
And here is my Full Yaml file.
esphome:
name: "sensor-lounge"
friendly_name: Sensor Lounge
platform: ESP8266
board: d1_mini
on_boot:
- priority: 400.0 # after sensor setup, before WIFI initialization
then:
- light.turn_on: # indication that the controller has power
id: lounge_decorative_light
brightness: 100%
red: 0%
green: 0%
blue: 100%
- priority: 250.0 # after WIFI initialization
then:
- light.turn_on: # indication that the controller is looking for a wifi connection
id: lounge_decorative_light
brightness: 100%
red: 100%
green: 0%
blue: 0%
- delay: '00:00:05'
- priority: -100.0 # everything is initialized, system is online - if condition waits for connection
then:
if:
condition:
wifi.connected:
then:
- light.turn_on: # indication of wifi connection confirmation
id: lounge_decorative_light
brightness: 100%
red: 0%
green: 100%
blue: 0%
- delay: '00:00:05'
- light.turn_on: # confirming that blue led's are working
id: lounge_decorative_light
brightness: 100%
red: 0%
green: 0%
blue: 100%
- delay: '00:00:02'
- light.turn_off: # turns off light waiting on automation to start
id: lounge_decorative_light
wifi:
ssid: !secret ssid
password: !secret password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "lounge Sensor Fallback Hotspot"
password: "*******"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
platform: esphome
# Enable Web server.
web_server:
port: 80
# Sync time with Home Assistant.
time:
- platform: homeassistant
id: homeassistant_time
i2c:
sda: 4 # (Optional, Pin): The pin for the data line of the I²C bus. Defaults to GPIO4 for ESP8266.
scl: 5 # (Optional, Pin): The pin for the clock line of the I²C bus. Defaults to GPIO5 for ESP8266.
scan: True # (Optional, boolean): If ESPHome should do a search of the I²C address space on startup. Defaults to True.
id: bus_a
sensor:
- platform: wifi_signal
name: "lounge Sensor WiFi signal"
update_interval: 600s
- platform: uptime
name: "lounge Sensor uptime do not use"
id: lounge_sensor_uptime_do_not_use
internal: true
update_interval: 600s
- platform: tsl2561
name: "lounge Ambient Light"
icon: mdi:lightbulb-on-outline
address: 0x39
update_interval: 60s
- platform: dht
pin: D3
model: DHT11
temperature:
name: "lounge Temperature"
accuracy_decimals: 1
humidity:
name: "lounge Humidity"
accuracy_decimals: 1
update_interval: 60s
text_sensor:
- platform: version
name: "lounge Sensor ESPHome version"
- platform: template
name: "lounge Sensor Uptime"
lambda: |-
uint32_t dur = id(lounge_sensor_uptime_do_not_use).state;
int dys = 0;
int hrs = 0;
int mnts = 0;
if (dur > 86399) {
dys = trunc(dur / 86400);
dur = dur - (dys * 86400);
}
if (dur > 3599) {
hrs = trunc(dur / 3600);
dur = dur - (hrs * 3600);
}
if (dur > 59) {
mnts = trunc(dur / 60);
dur = dur - (mnts * 60);
}
char buffer[17];
sprintf(buffer, "%ud %02uh %02um %02us", dys, hrs, mnts, dur);
return {buffer};
icon: mdi:clock-start
update_interval: 600s
switch:
- platform: restart
name: lounge Sensor Restart
light:
- platform: rgb
name: "lounge Decorative Light"
id: lounge_decorative_light
red: red
green: green
blue: blue
effects:
- random:
name: Fadeing Rainbow
transition_length: 2.5s
update_interval: 2s
# Example output entry
output:
- platform: esp8266_pwm
id: blue
pin: D5
inverted: True
- platform: esp8266_pwm
id: red
pin: D6
inverted: True
- platform: esp8266_pwm
id: green
pin: D7
inverted: True
I can understand if one or two of my states don’t show, but for absolutely none… has me stumped… I should mention that the Yaml is a collection of help and me trying to figure things out, the uptime sensors and stuff will be getting removed to just what’s needed.
thank you all for your help,
Robin