esphome / issues

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

Web_server verison 2 not showing all sensors, Web_server version 1 not showing values for all sensors #3967

Open evlo opened 1 year ago

evlo commented 1 year ago

The problem

When i use config that I paste bellow, web ui is missing data for IP, MAC, etc.

Which version of ESPHome has the issue?

2022.12.3

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2022.12

What platform are you using?

ESP8266

Board

athom plug v2

Component causing the issue

web

Example YAML snippet

substitutions:
  device_name: EH Plug Servers 
  hostname: eh-athom-plug-servers
  device_id: eh_athom_plug_servers
  comment: Plug Servers
  relay_restore_mode: RESTORE_DEFAULT_ON

esphome:
  name: $hostname
  comment: $comment

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: ${hostname} Fallback
  #use_address: 192.168.50.44

api:
ota:
web_server:
  version: 1
#captive_portal:

preferences:
  flash_write_interval: 7min

time:
  - platform: sntp
    id: my_time

############################################################################
logger:
  level: VERBOSE
  baud_rate: 0
############################################################################

esp8266:
  board: esp8285
  restore_from_flash: true

uart:
  rx_pin: RX
  baud_rate: 4800

globals:
  - id: total_energy
    type: float
    restore_value: yes
    initial_value: '0.0' 

binary_sensor:
  - platform: status
    name: "${device_name} Status"
    icon: mdi:power-socket-de

  - platform: gpio
    pin:
      number: 5
      mode: INPUT_PULLUP
      inverted: true
    name: "${device_name} Power Button"
    disabled_by_default: False
    on_multi_click:
      - timing:
          - ON for at most 1s
          - OFF for at least 0.2s
        then:
          - switch.toggle: relay
      - timing:
          - ON for at least 4s
        then:
          - button.press: Reset
    icon: mdi:gesture-tap-button

sensor:
  - platform: cse7766
    update_interval: 10s
    current:
      name: "${device_name} Current"
      filters:
          - lambda: if (x < 0.060) return 0.0; else return x;   #For the chip will report less than 3w power when no load is connected
      icon: mdi:current-ac

    voltage:
      name: "${device_name} Voltage"
      icon: mdi:flash-triangle-outline
    power:
      name: "${device_name} Power"
      id: power_sensor
      filters:
          - lambda: if (x < 3.0) return 0.0; else return x;    #For the chip will report less than 3w power when no load is connected
      icon: mdi:power-plug-outline

    energy:
      name: "${device_name} Energy"
      id: energy
      unit_of_measurement: kWh
      filters:
        # Multiplication factor from W to kW is 0.001
        - multiply: 0.001
      on_value:
        then:
          - lambda: |-
              static float previous_energy_value = 0.0;
              float current_energy_value = id(energy).state;
              id(total_energy) += current_energy_value - previous_energy_value;
              previous_energy_value = current_energy_value;
  - platform: template
    name: "${device_name} Total Energy"
    unit_of_measurement: kWh
    device_class: "energy"
    state_class: "total_increasing"
    icon: "mdi:lightning-bolt"
    accuracy_decimals: 3
    lambda: |-
      return id(total_energy);
    update_interval: 10s

  - platform: total_daily_energy
    name: "${device_name} Total Daily Energy"
    restore: true
    power_id: power_sensor
    unit_of_measurement: kWh
    accuracy_decimals: 3
    filters:
      - multiply: 0.001
    icon: mdi:lightning-bolt-outline
############################################################################
  - platform: wifi_signal
    name: "${device_name} WiFi Signal"
    update_interval: 10s
    id: wifi_signal_db
    icon: "mdi:wifi"
  - platform: uptime
    name: "${device_name} Uptime"
    update_interval: "600s"
    entity_category: "diagnostic"
    icon: "mdi:clock-outline"

############################################################################
button:
  - platform: factory_reset
    name: Restart with Factory Default Settings
    id: Reset
    icon: mdi:restart-alert

  - platform: restart
    name: "${device_name} Restart"
    icon: "mdi:restart"
############################################################################

text_sensor:
  - platform: version
    name: "${device_name} ESPHome Version"
    hide_timestamp: true
    icon: "mdi:numeric"
  - platform: wifi_info
    ip_address:
      name: "${device_name} IP Address"
      disabled_by_default: False
      icon: "mdi:wifi-settings"
    mac_address:
      name: "${device_name} MAC"
      icon: "mdi:wifi-marker"
    scan_results:
      name: "${device_name} last wifi scan"
      icon: "mdi:wifi-sync"
############################################################################

switch:
  - platform: gpio
    name: ${device_name} Relay
    pin: GPIO12
    id: relay
    restore_mode: ${relay_restore_mode}
    icon: mdi:power-settings
    on_turn_on:
    - switch.turn_off: sw_led1 #red indicating off
    on_turn_off:
    - switch.turn_on: sw_led1 #red indicating off
  - platform: gpio
    id: sw_led1
    pin: GPIO13
    inverted: True
  # - platform: output
  #   output: ${device_id}_red_led
  #   name: "${device_name} red LED"
  #   icon: "mdi:led-on"
  #relay napevno rozsviti cervenou led vzdy

# output:
#   - platform: gpio
#     id: ${device_id}_red_led
#     pin: 13

light:
  - platform: status_led
    name: "${device_name} Blue Status LED"
    icon: mdi:Led-on
    id: blue_led
    disabled_by_default: true
    pin:
      inverted: true
      number: GPIO13

# status_led:
#   pin:
#     number: GPIO0
#     inverted: yes

Anything in the logs that might be useful for us?

Maybe issue is just something in my yaml config

Additional information

image image

https://github.com/esphome/issues/issues/806 maybe related? https://github.com/esphome/issues/issues/1384 maybe related? https://github.com/esphome/esphome/pull/1221

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.