esphome / issues

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

Some messages appear twice in the web log #5712

Open franzs opened 4 months ago

franzs commented 4 months ago

The problem

Compared to the console log, some messages appear twice in the web log. Please find details of the corresponding log outputs for the console and the web ui attached. I tried Firefox and Chrome. The extra log messages from the web log can be found in the HTML source. So it's not a display issue.

Which version of ESPHome has the issue?

2024.4.0

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

nodemcu-32s

Component causing the issue

template number

Example YAML snippet

number:
  - platform: template
    id: xeipuzo
    name: "Byte"
    min_value: 0
    max_value: 255
    step: 1
    set_action:
      - lambda: |-
          int value = int(x);

          ESP_LOGD("main", "value = %d ", value);

          auto switches = App.get_switches();

          for (int i = 0; i < 8; i++) {
            if ((value >> i) & 0x01) {
              switches[i]->turn_on();
            } else {
              switches[i]->turn_off();
            }
          }

          id(xeipuzo).publish_state(value);

switch:
  - platform: gpio
    name: "Relay 0"
    pin: GPIO13
    id: relay_0
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF
    internal: true
  - platform: gpio
    name: "Relay 1"
    pin: GPIO12
    id: relay_1
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF
    internal: true
  - platform: gpio
    name: "Relay 2"
    pin: GPIO14
    id: relay_2
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF
    internal: true
  - platform: gpio
    name: "Relay 3"
    pin: GPIO27
    id: relay_3
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF
    internal: true
  - platform: gpio
    name: "Relay 4"
    pin: GPIO26
    id: relay_4
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF
    internal: true
  - platform: gpio
    name: "Relay 5"
    pin: GPIO25
    id: relay_5
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF
    internal: true
  - platform: gpio
    name: "Relay 6"
    pin: GPIO33
    id: relay_6
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF
    internal: true
  - platform: gpio
    name: "Relay 7"
    pin: GPIO32
    id: relay_7
    inverted: true
    restore_mode: RESTORE_DEFAULT_OFF
    internal: true

Anything in the logs that might be useful for us?

Console log:

[17:27:20][D][number:054]: 'Byte' - Setting number value
[17:27:20][D][number:113]:   New number value: 120.000000
[17:27:20][D][main:108]: byte_value = 120 
[17:27:20][D][switch:016]: 'Relay 0' Turning OFF.
[17:27:20][D][switch:055]: 'Relay 0': Sending state OFF
[17:27:20][D][switch:016]: 'Relay 1' Turning OFF.
[17:27:20][D][switch:055]: 'Relay 1': Sending state OFF
[17:27:20][D][switch:016]: 'Relay 2' Turning OFF.
[17:27:20][D][switch:055]: 'Relay 2': Sending state OFF
[17:27:20][D][switch:012]: 'Relay 3' Turning ON.
[17:27:20][D][switch:012]: 'Relay 4' Turning ON.
[17:27:20][D][switch:012]: 'Relay 5' Turning ON.
[17:27:20][D][switch:012]: 'Relay 6' Turning ON.
[17:27:20][D][switch:055]: 'Relay 6': Sending state ON
[17:27:20][D][switch:016]: 'Relay 7' Turning OFF.
[17:27:20][D][number:012]: 'Byte': Sending state 120.000000

Web log:

17:27:20    [D] [number:054]    'Byte' - Setting number value
17:27:20    [D] [number:113]    New number value: 120.000000
17:27:20    [D] [main:108]  byte_value = 120 
17:27:20    [D] [main:108]  byte_value = 120 
17:27:20    [D] [switch:016]    'Relay 0' Turning OFF.
17:27:20    [D] [switch:016]    'Relay 0' Turning OFF.
17:27:20    [D] [switch:055]    'Relay 0': Sending state OFF
17:27:20    [D] [switch:055]    'Relay 0': Sending state OFF
17:27:20    [D] [switch:016]    'Relay 1' Turning OFF.
17:27:20    [D] [switch:016]    'Relay 1' Turning OFF.
17:27:20    [D] [switch:055]    'Relay 1': Sending state OFF
17:27:20    [D] [switch:055]    'Relay 1': Sending state OFF
17:27:20    [D] [switch:016]    'Relay 2' Turning OFF.
17:27:20    [D] [switch:055]    'Relay 2': Sending state OFF
17:27:20    [D] [switch:055]    'Relay 2': Sending state OFF
17:27:20    [D] [switch:012]    'Relay 3' Turning ON.
17:27:20    [D] [switch:012]    'Relay 4' Turning ON.
17:27:20    [D] [switch:012]    'Relay 5' Turning ON.
17:27:20    [D] [switch:012]    'Relay 6' Turning ON.
17:27:20    [D] [switch:055]    'Relay 6': Sending state ON
17:27:20    [D] [switch:055]    'Relay 6': Sending state ON
17:27:20    [D] [switch:016]    'Relay 7' Turning OFF.
17:27:20    [D] [switch:016]    'Relay 7' Turning OFF.
17:27:20    [D] [number:012]    'Byte': Sending state 120.000000

Additional information

Screenshot of console log:

console_log

Screenshot of web log:

web_log

github-actions[bot] commented 3 weeks 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.