esphome / issues

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

thermostat climate status in the debug log not reporting correctly #1869

Closed darsys closed 3 years ago

darsys commented 3 years ago

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

Host is Hass.io running in a debian xen vm

ESP (ESP32/ESP8266, Board/Sonoff):

Esp8266 WemosD1 mini clone mounted on a breadboard (yes i know...) powered with a wall usb brick

ESPHome version (latest production, beta, dev branch)

ESPHome version 1.17.0-dev

Affected component:

https://esphome.io/components/climate/thermostat.html?highlight=thermostat

Description of problem: The component functionality works as expected. In the log I changed the setpoint to above current temperature via home assistant ui and the esphome thermostat component turns on the heat. I then change the setpoint back to below the current temperature and the esphome thermostat component turns off the heat, Watching the component via the home assistant developer tools shows visible component properties properly changing including the temps and heat status. The debug log for the climate component does not, however, output the correct values to match the status of the component.

I would also mention that a log event for when the setpoint is updated seems appropriate? This could probably be considered a separate issue.

Problem-relevant YAML-configuration entries:

esphome:
  name: shop_east_thermostat
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: !secret wifi
  password: !secret wifi_password
  power_save_mode: none
  domain: .tayoby.com
  ap:
    ssid: "ShopEastThermostat"
    password: !secret wifi_password
  manual_ip:
    static_ip: !secret shop_east_thermostat_ip
    gateway: !secret router_ip
    subnet: 255.255.255.0
    dns1: !secret router_ip

captive_portal:

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  password: !secret esp_api

ota:
  password: !secret esp_api

sensor:
  - platform: dht
    pin: D7
    model: AM2302
    temperature:
      name: "Shop East Temperature"
      id: shop_east_temperature
    humidity:
      name: "Shop East Humidity"
      id: shop_east_humidity
    update_interval: 30s
  - platform: wifi_signal
    name: "Shop East Thermo Wifi Signal"
    update_interval: 5s

switch:
  - platform: gpio
    name: shop east heat low
    id: shop_east_heat_low
    pin: D5
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF
  - platform: gpio
    name: shop east heat high
    id: shop_east_heat_high
    pin: D6
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF

climate:
  - platform: thermostat
    id: shop_east_thermostat
    sensor: shop_east_temperature
    default_target_temperature_low: 50 °F
    heat_action:
      - switch.turn_on: shop_east_heat_low
    idle_action:
      - switch.turn_off: shop_east_heat_low
    away_config:
      default_target_temperature_low: 50

Logs (if applicable):

INFO Reading configuration /config/esphome/shop_east_thermostat.yaml...
INFO Starting log output from 192.168.88.55 using esphome API
INFO Connecting to 192.168.88.55:6053 (192.168.88.55)
INFO Successfully connected to 192.168.88.55
[14:35:41][I][app:105]: ESPHome version 1.17.0-dev compiled on Feb 21 2021, 17:47:12
[14:35:41][C][wifi:443]: WiFi:
[14:35:41][C][wifi:303]:   SSID: [redacted]
[14:35:41][C][wifi:304]:   IP Address: 192.168.88.55
[14:35:41][C][wifi:306]:   BSSID: [redacted]
[14:35:41][C][wifi:307]:   Hostname: 'shop_east_thermostat'
[14:35:41][C][wifi:311]:   Signal strength: -56 dB ▂▄▆█
[14:35:41][C][wifi:315]:   Channel: 10
[14:35:41][C][wifi:316]:   Subnet: 255.255.255.0
[14:35:41][C][wifi:317]:   Gateway: 192.168.88.1
[14:35:41][C][wifi:318]:   DNS1: 192.168.88.1
[14:35:41][C][wifi:319]:   DNS2: (IP unset)
[14:35:41][C][switch.gpio:042]: GPIO Switch 'shop east heat low'
[14:35:41][C][switch.gpio:042]:   Inverted: YES
[14:35:41][C][switch.gpio:043]:   Pin: GPIO14 (Mode: OUTPUT)
[14:35:41][C][switch.gpio:059]:   Restore Mode: Restore (Defaults to OFF)
[14:35:41][C][switch.gpio:042]: GPIO Switch 'shop east heat high'
[14:35:41][C][switch.gpio:042]:   Inverted: YES
[14:35:41][C][switch.gpio:043]:   Pin: GPIO12 (Mode: OUTPUT)
[14:35:41][C][switch.gpio:059]:   Restore Mode: Restore (Defaults to OFF)
[14:35:41][C][logger:185]: Logger:
[14:35:41][C][logger:186]:   Level: DEBUG
[14:35:41][C][logger:187]:   Log Baud Rate: 115200
[14:35:41][C][logger:188]:   Hardware UART: UART0
[14:35:41][C][dht:017]: DHT:
[14:35:41][C][dht:018]:   Pin: GPIO13 (Mode: INPUT)
[14:35:41][C][dht:024]:   Model: DHT22 (or equivalent)
[14:35:41][C][dht:027]:   Update Interval: 30.0s
[14:35:41][C][dht:029]:   Temperature 'Shop East Temperature'
[14:35:41][C][dht:029]:     Unit of Measurement: '°C'
[14:35:41][C][dht:029]:     Accuracy Decimals: 1
[14:35:41][C][dht:029]:     Icon: 'mdi:thermometer'
[14:35:41][C][dht:030]:   Humidity 'Shop East Humidity'
[14:35:41][C][dht:030]:     Unit of Measurement: '%'
[14:35:41][C][dht:030]:     Accuracy Decimals: 0
[14:35:41][C][dht:030]:     Icon: 'mdi:water-percent'
[14:35:41][C][thermostat.climate:509]: Thermostat 'shop_east_thermostat'
[14:35:41][C][thermostat.climate:514]:   Default Target Temperature Low: 10.0°C
[14:35:41][C][thermostat.climate:522]:   Hysteresis: 0.5°C
[14:35:41][C][thermostat.climate:523]:   Supports AUTO: NO
[14:35:41][C][thermostat.climate:524]:   Supports COOL: NO
[14:35:41][C][thermostat.climate:525]:   Supports DRY: NO
[14:35:41][C][thermostat.climate:526]:   Supports FAN_ONLY: NO
[14:35:41][C][thermostat.climate:527]:   Supports HEAT: YES
[14:35:41][C][thermostat.climate:528]:   Supports FAN MODE ON: NO
[14:35:41][C][thermostat.climate:529]:   Supports FAN MODE OFF: NO
[14:35:41][C][thermostat.climate:530]:   Supports FAN MODE AUTO: NO
[14:35:41][C][thermostat.climate:531]:   Supports FAN MODE LOW: NO
[14:35:41][C][thermostat.climate:532]:   Supports FAN MODE MEDIUM: NO
[14:35:41][C][thermostat.climate:533]:   Supports FAN MODE HIGH: NO
[14:35:41][C][thermostat.climate:534]:   Supports FAN MODE MIDDLE: NO
[14:35:41][C][thermostat.climate:535]:   Supports FAN MODE FOCUS: NO
[14:35:41][C][thermostat.climate:536]:   Supports FAN MODE DIFFUSE: NO
[14:35:41][C][thermostat.climate:537]:   Supports SWING MODE BOTH: NO
[14:35:41][C][thermostat.climate:538]:   Supports SWING MODE OFF: NO
[14:35:41][C][thermostat.climate:539]:   Supports SWING MODE HORIZONTAL: NO
[14:35:41][C][thermostat.climate:540]:   Supports SWING MODE VERTICAL: NO
[14:35:41][C][thermostat.climate:541]:   Supports TWO SET POINTS: NO
[14:35:41][C][thermostat.climate:542]:   Supports AWAY mode: YES
[14:35:41][C][thermostat.climate:549]:     Away Default Target Temperature Low: 50.0°C
[14:35:41][C][captive_portal:169]: Captive Portal:
[14:35:41][C][ota:029]: Over-The-Air Updates:
[14:35:41][C][ota:030]:   Address: 192.168.88.55:8266
[14:35:41][C][ota:032]:   Using Password.
[14:35:41][C][api:095]: API Server:
[14:35:41][C][api:096]:   Address: 192.168.88.55:6053
[14:35:41][C][wifi_signal.sensor:009]: WiFi Signal 'Shop East Thermo Wifi Signal'
[14:35:41][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dB'
[14:35:41][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[14:35:41][C][wifi_signal.sensor:009]:   Icon: 'mdi:wifi'
[14:35:42][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -55.00000 dB with 0 decimals of accuracy
[14:35:47][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -55.00000 dB with 0 decimals of accuracy
[14:35:52][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -53.00000 dB with 0 decimals of accuracy
[14:35:52][D][dht:048]: Got Temperature=14.2°C Humidity=28.5%
[14:35:52][D][sensor:099]: 'Shop East Temperature': Sending state 14.20000 °C with 1 decimals of accuracy
[14:35:52][D][climate:262]: 'shop_east_thermostat' - Sending state:
[14:35:52][D][climate:265]:   Mode: OFF
[14:35:52][D][climate:267]:   Action: OFF
[14:35:52][D][climate:276]:   Current Temperature: 14.20°C
[14:35:52][D][climate:282]:   Target Temperature: 12.78°C
[14:35:52][D][climate:285]:   Away: OFF
[14:35:52][D][sensor:099]: 'Shop East Humidity': Sending state 28.50000 % with 0 decimals of accuracy
[14:35:57][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -54.00000 dB with 0 decimals of accuracy
[14:36:02][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -54.00000 dB with 0 decimals of accuracy
[14:36:07][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -53.00000 dB with 0 decimals of accuracy
[14:36:12][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -55.00000 dB with 0 decimals of accuracy
[14:36:14][D][switch:021]: 'shop east heat low' Turning ON.
[14:36:14][D][switch:045]: 'shop east heat low': Sending state OFF
[14:36:17][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -54.00000 dB with 0 decimals of accuracy
[14:36:22][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -53.00000 dB with 0 decimals of accuracy
[14:36:22][D][dht:048]: Got Temperature=14.3°C Humidity=28.6%
[14:36:22][D][sensor:099]: 'Shop East Temperature': Sending state 14.30000 °C with 1 decimals of accuracy
[14:36:22][D][climate:262]: 'shop_east_thermostat' - Sending state:
[14:36:22][D][climate:265]:   Mode: OFF
[14:36:22][D][climate:267]:   Action: OFF
[14:36:22][D][climate:276]:   Current Temperature: 14.30°C
[14:36:22][D][climate:282]:   Target Temperature: 12.78°C
[14:36:22][D][climate:285]:   Away: OFF
[14:36:22][D][sensor:099]: 'Shop East Humidity': Sending state 28.60000 % with 0 decimals of accuracy
[14:36:27][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -53.00000 dB with 0 decimals of accuracy
[14:36:32][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -55.00000 dB with 0 decimals of accuracy
[14:36:37][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -53.00000 dB with 0 decimals of accuracy
[14:36:39][D][switch:025]: 'shop east heat low' Turning OFF.
[14:36:39][D][switch:045]: 'shop east heat low': Sending state ON
[14:36:42][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -55.00000 dB with 0 decimals of accuracy
[14:36:47][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -53.00000 dB with 0 decimals of accuracy
[14:36:52][D][sensor:099]: 'Shop East Thermo Wifi Signal': Sending state -55.00000 dB with 0 decimals of accuracy
[14:36:52][D][dht:048]: Got Temperature=14.2°C Humidity=28.5%
[14:36:52][D][sensor:099]: 'Shop East Temperature': Sending state 14.20000 °C with 1 decimals of accuracy
[14:36:52][D][climate:262]: 'shop_east_thermostat' - Sending state:
[14:36:52][D][climate:265]:   Mode: OFF
[14:36:52][D][climate:267]:   Action: OFF
[14:36:52][D][climate:276]:   Current Temperature: 14.20°C
[14:36:52][D][climate:282]:   Target Temperature: 12.78°C
[14:36:52][D][climate:285]:   Away: OFF
[14:36:52][D][sensor:099]: 'Shop East Humidity': Sending state 28.50000 % with 0 decimals of accuracy

Additional information and things you've tried: I have tried simplifying the config by removing devices and using different output devices for the heat action.

darsys commented 3 years ago

I modified my thermostat config as show below and the log does not report in the heat action event. I have setup a development environment to see if I can contribute a fix.


    heat_action:
      - logger.log:
          format: "Shop east thermostat turning ON Current Temp: value %.1f and Setpoint %.1f"
          args: [ 'id(shop_east_thermostat).target_temperature', 'id(shop_east_temperature).state' ]
      - switch.turn_on: shop_east_heat_low
    idle_action:
      - logger.log:
          format: "Shop east thermostat turning OFF Current Temp: value %.1f and Setpoint %.1f"
          args: [ 'id(shop_east_thermostat).target_temperature', 'id(shop_east_temperature).state' ]
      - switch.turn_off: shop_east_heat_low
`
darsys commented 3 years ago

This issue was because I had a generic climate device defined in my home assistant configuration (using the esphome temp and switched) and there was not a name defined in my esphome thermostat configuration. HA/esphome did not configure the esphome thermostat and obviously all the commands were going to the generic climate device defined in ha. I am closing the issue and hope I haven't wasted anyone else's time.