hi all,
I have a sensor for my lounge giving me temp and humidity readings though I am only getting whole number readings… is this something I can change?
here is my yaml file for the sensor.
esphome:
name: lounge_sensor
platform: ESP8266
board: d1_mini
wifi:
ssid: !secret ssid
password: !secret password
manual_ip:
static_ip: 192.168.0.45
gateway: 192.168.0.1
subnet: 255.255.255.0
dns1: 192.168.0.1
dns2: 192.168.0.1
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Lounge Sensor Fallback Hotspot"
password: "Cerberus"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# 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: 120s
- platform: uptime
name: "Lounge Sensor uptime do not use"
id: lounge_sensor_uptime_do_not_use
internal: true
update_interval: 15s
- 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"
humidity:
name: "Lounge Humidity"
update_interval: 3s
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: 15s
switch:
- platform: restart
name: Lounge Sensor Restart
can I do anything in the yaml to sort this? or do I need a new board or sensor?
thank you for your help and time