Inconsistent values in log statements

I’m not even sure what title to give this thread - help !

I my testing of deep_sleep, I am wanting to save the reason for the current wakeup in sensor wakeup_cause … as per the code in Deep Sleep Component — ESPHome. I am also wanting to record the number of times the ESP32 has woken up in a global variable num_wake_cycles - but I want to ensure this is only updated once per wake period … so on_boot: seems the best place to do the increment.

Being old school, and not proficient with C++, I like to add print statements (or logger.log or ESP_LOGD()) to check that the variables have the values I intend before I try to use them in other logic … but log statements in the on_boot: and on_shutdown: don’t go to the HA ESPHome log.

… and that is where I have come unstuck. Sometimes a variable appears to have one value, and in the next line it appears to have a different value. I have tried logger.log and ESP_LOGD()

I assume there is some core principle I have forgotten or don’t properly understand. Hoping that some kind soul will look past my incorrect (old fashioned) terminology and point me in the right direction.

I have cut down this yaml code to minimum - but have added debug statements to the two sensors …

#####################################################################
#                                                                   #
# The ESP32-S3-DevKitC-1 (v1) board with ESP32-S3-WROOM-1-N16R8     #
#                                                                   #
#   CURRENT usage for debugging parts of the greenhouse code        #
#   in particular rain_gauge, water module and on_boot/shutdown     #
#
#####################################################################

substitutions:
  devicename:     "esp32s3-test"
  deviceIP:       "97"                     # last octet of the IP Address
  wifi_ssid:      !secret upstairs_ssid     ### which wi-fi to connect to
  wifi_password:  !secret upstairs_password 
  update_interval_network: "30 min"       # How often to measure and report network values
  update_interval_sensor:  "3 min"        # How often to measure and report sensor values

  # deep_sleep 
  sleep_awake_duration:      '600000'   # =10 min  # how long to run (be awake)
  sleep_asleep_duration:     '300000'   # =5 min   # how long to sleep for
  sleep_low_batt_duration: '10800000'   # =3 hours


esp32:
  board: esp32-s3-devkitc-1         # devkit from AliExpress
  variant: esp32s3
  flash_size: 16MB
  framework:
    type: esp-idf
    version: recommended

psram:
  mode: octal
  speed: 80MHz

esphome:
  name: $devicename
  platformio_options:
    board_build.flash_mode: dio 
  on_boot: 
    then:
    - sensor.template.publish:
        id: wakeup_cause
        state: !lambda 'return esp_sleep_get_wakeup_cause();'
    - lambda: |-
        ESP_LOGD("on_boot", "");
        ESP_LOGD("on-boot", "#################### ON_BOOT ####################");
        ESP_LOGD("on_boot", ">>>>>> on_boot: initial values   wakeup_cause=%d, wakeup_cause.state=%d, num_wake_cycles=%d", id(wakeup_cause), id(wakeup_cause).state, id(num_wake_cycles) );
        // id(wakeup_cause) = esp_sleep_get_wakeup_cause();
        id(num_wake_cycles) += 1;
    - logger.log: "##### on_boot finished" 


deep_sleep: 
  id: deep_sleep_1
  run_duration:   ${sleep_awake_duration} ms   # how long to run (be awake)
  sleep_duration: ${sleep_asleep_duration}ms  # how long to sleep for

packages:
  wi-fi: !include _common_wifi.yaml

logger:
  level: DEBUG

i2c:
  - id: bus_a
    sda: GPIO5
    scl: GPIO4
    scan: true
    frequency: 400kHz

globals:
  - id: num_wake_cycles
    type: int
    restore_value: yes
    initial_value: '0'

sensor:
  - platform: template
    id: wakeup_cause
    name: $devicename Wakeup cause
    update_interval: $update_interval_sensor
    accuracy_decimals: 0
    lambda:  return esp_sleep_get_wakeup_cause();
    on_value:
      then:
        - if: 
            condition:
              lambda: 'return id(wakeup_cause).state > 0;'
            then:
              lambda: |-
                ESP_LOGD("testing", "   >>>>>> WOKEN UP  wakeup_cause=%d, esp_sleep_get_wakeup_cause()=%d, num_wake_cycles=%d", id(wakeup_cause), esp_sleep_get_wakeup_cause(), id(num_wake_cycles) );
        - logger.log: 
            format: ">>>>>> WOKEN UP logger   esp_sleep_get_wakeup_cause()=%d, wakeup_cause=%d, num_wake_cycles=%d, x=%d "
            args: [ 'esp_sleep_get_wakeup_cause()', 'id(wakeup_cause).state', 'id(num_wake_cycles)', 'x' ]
        - lambda: |-
            ESP_LOGD("testing", ">>>>>> WOKEN UP LOGD   esp_sleep_get_wakeup_cause()=%d, wakeup_cause=%d, num_wake_cycles=%d, x=%d", 
            esp_sleep_get_wakeup_cause(), id(wakeup_cause).state, id(num_wake_cycles), x );

  - platform: bh1750
    name: $devicename BH1750 Illuminance
    address: 0x23
    update_interval: $update_interval_sensor
    on_value:
      then:
        - logger.log: 
            format: ">>>>>> logger   esp_sleep_get_wakeup_cause()=%d, wakeup_cause=%d, num_wake_cycles=%d "
            args: [ 'esp_sleep_get_wakeup_cause()', 'id(wakeup_cause).state', 'id(num_wake_cycles)' ]
        - lambda: |-
            ESP_LOGD("test", ">>>>>>  LOGD   esp_sleep_get_wakeup_cause()=%d, wakeup_cause=%d, num_wake_cycles=%d", 
            esp_sleep_get_wakeup_cause(), id(wakeup_cause).state, id(num_wake_cycles) );

Results in:

[22:02:41][C][deep_sleep:026]: Setting up Deep Sleep...
[22:02:41][C][deep_sleep:029]:   Sleep Duration: 300000 ms
[22:02:41][C][deep_sleep:032]:   Run Duration: 600000 ms
[22:03:24][D][esp32.preferences:114]: Saving 2 preferences to flash...
[22:03:24][D][esp32.preferences:142]: Saving 2 preferences to flash: 0 cached, 2 written, 0 failed
[22:03:35][W][api.connection:135]: ESPHome Logs 2025.3.0 (192.168.1.98): Connection closed
[22:03:36][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[22:03:36][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:03:36][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[22:03:45][D][light:036]: 'esp32s3-test RGB LED' Setting:
[22:03:45][D][light:047]:   State: ON
[22:03:45][D][light:085]:   Transition length: 1.0s
[22:03:55][D][light:036]: 'esp32s3-test RGB LED' Setting:
[22:03:55][D][light:047]:   State: OFF
[22:03:55][D][light:085]:   Transition length: 1.0s
[22:04:08][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=23.1lx
[22:04:08][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 23.09055 lx with 1 decimals of accuracy
[22:04:08][D][main:120]: >>>>>> logger   esp_sleep_get_wakeup_cause()=0, wakeup_cause=3, num_wake_cycles=0 
[22:04:08][D][test:141]: >>>>>>  LOGD   esp_sleep_get_wakeup_cause()=0, wakeup_cause=0, num_wake_cycles=0
[22:04:48][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 0.00000  with 0 decimals of accuracy
[22:04:48][D][main:128]: >>>>>> WOKEN UP logger   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070229052, num_wake_cycles=0, x=0 
[22:04:48][D][testing:129]: >>>>>> WOKEN UP LOGD   esp_sleep_get_wakeup_cause()=0, wakeup_cause=0, num_wake_cycles=0, x=0
[22:07:08][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=23.1lx
[22:07:15][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 23.09055 lx with 1 decimals of accuracy
[22:07:15][D][main:120]: >>>>>> logger   esp_sleep_get_wakeup_cause()=0, wakeup_cause=-16777216, num_wake_cycles=0 
[22:07:15][D][test:141]: >>>>>>  LOGD   esp_sleep_get_wakeup_cause()=0, wakeup_cause=0, num_wake_cycles=0
[22:07:48][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 0.00000  with 0 decimals of accuracy
[22:07:48][D][main:128]: >>>>>> WOKEN UP logger   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070229052, num_wake_cycles=0, x=0 
[22:07:48][D][testing:129]: >>>>>> WOKEN UP LOGD   esp_sleep_get_wakeup_cause()=0, wakeup_cause=0, num_wake_cycles=0, x=0
[22:10:08][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=23.1lx
[22:10:08][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 23.09055 lx with 1 decimals of accuracy
[22:10:08][D][main:120]: >>>>>> logger   esp_sleep_get_wakeup_cause()=0, wakeup_cause=-16777216, num_wake_cycles=0 
[22:10:08][D][test:141]: >>>>>>  LOGD   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070181668, num_wake_cycles=0
[22:10:48][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 0.00000  with 0 decimals of accuracy
[22:10:48][D][main:128]: >>>>>> WOKEN UP logger   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070229052, num_wake_cycles=0, x=0 
[22:10:48][D][testing:129]: >>>>>> WOKEN UP LOGD   esp_sleep_get_wakeup_cause()=0, wakeup_cause=0, num_wake_cycles=0, x=0
[22:12:39][I][deep_sleep:060]: Beginning Deep Sleep
[22:12:39][I][deep_sleep:062]: Sleeping for 300000000us
[22:12:39][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:12:39][D][esp32.preferences:142]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[22:12:39][D][main:061]: ##### on_shutdown -100 start
[22:12:39][D][main:064]: ##### on_shutdown -100 finished
INFO Processing expected disconnect from ESPHome API for esp32s3-test @ 192.168.1.97
WARNING Disconnected from API
WARNING Can't connect to ESPHome API for esp32s3-test @ 192.168.1.97: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.1.97', port=6053))]: [Errno 113] Connect call failed ('192.168.1.97', 6053) (SocketAPIError)
INFO Trying to connect to esp32s3-test @ 192.168.1.97 in the background
INFO Successfully connected to esp32s3-test @ 192.168.1.97 in 0.031s
INFO Successful handshake with esp32s3-test @ 192.168.1.97 in 0.186s
[22:18:32][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:18:32][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[22:18:36][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[22:18:36][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:18:36][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[22:19:34][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[22:19:34][D][testing:124]:    >>>>>> WOKEN UP  wakeup_cause=1070229548, esp_sleep_get_wakeup_cause()=4, num_wake_cycles=1744
[22:19:34][D][main:128]: >>>>>> WOKEN UP logger   esp_sleep_get_wakeup_cause()=4, wakeup_cause=-16777216, num_wake_cycles=0, x=1074790400 
[22:19:34][D][testing:129]: >>>>>> WOKEN UP LOGD   esp_sleep_get_wakeup_cause()=4, wakeup_cause=0, num_wake_cycles=0, x=1074790400
[22:19:40][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=21.7lx
[22:19:40][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 21.73228 lx with 1 decimals of accuracy
[22:19:40][D][main:120]: >>>>>> logger   esp_sleep_get_wakeup_cause()=4, wakeup_cause=-16777216, num_wake_cycles=0 
[22:19:40][D][test:141]: >>>>>>  LOGD   esp_sleep_get_wakeup_cause()=4, wakeup_cause=0, num_wake_cycles=0
[22:22:33][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[22:22:33][D][testing:124]:    >>>>>> WOKEN UP  wakeup_cause=1070229548, esp_sleep_get_wakeup_cause()=4, num_wake_cycles=1744
[22:22:33][D][main:128]: >>>>>> WOKEN UP logger   esp_sleep_get_wakeup_cause()=4, wakeup_cause=-16777216, num_wake_cycles=0, x=1074790400 
[22:22:33][D][testing:129]: >>>>>> WOKEN UP LOGD   esp_sleep_get_wakeup_cause()=4, wakeup_cause=0, num_wake_cycles=0, x=1074790400
[22:22:36][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=23.2lx
[22:22:36][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 23.20374 lx with 1 decimals of accuracy
[22:22:36][D][main:120]: >>>>>> logger   esp_sleep_get_wakeup_cause()=4, wakeup_cause=-16777216, num_wake_cycles=0 
[22:22:36][D][test:141]: >>>>>>  LOGD   esp_sleep_get_wakeup_cause()=4, wakeup_cause=0, num_wake_cycles=0
[22:25:33][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[22:25:33][D][testing:124]:    >>>>>> WOKEN UP  wakeup_cause=1070229548, esp_sleep_get_wakeup_cause()=4, num_wake_cycles=1744
[22:25:33][D][main:128]: >>>>>> WOKEN UP logger   esp_sleep_get_wakeup_cause()=4, wakeup_cause=-16777216, num_wake_cycles=0, x=1074790400 
[22:25:33][D][testing:129]: >>>>>> WOKEN UP LOGD   esp_sleep_get_wakeup_cause()=4, wakeup_cause=0, num_wake_cycles=0, x=1074790400
[22:25:36][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=23.2lx
[22:25:36][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 23.20374 lx with 1 decimals of accuracy
[22:25:36][D][main:120]: >>>>>> logger   esp_sleep_get_wakeup_cause()=4, wakeup_cause=-16777216, num_wake_cycles=0 
[22:25:36][D][test:141]: >>>>>>  LOGD   esp_sleep_get_wakeup_cause()=4, wakeup_cause=0, num_wake_cycles=0
[22:27:36][I][deep_sleep:060]: Beginning Deep Sleep
[22:27:36][I][deep_sleep:062]: Sleeping for 300000000us
[22:27:36][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:27:36][D][esp32.preferences:142]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[22:27:36][D][main:061]: ##### on_shutdown -100 start
[22:27:36][D][main:064]: ##### on_shutdown -100 finished
INFO Processing expected disconnect from ESPHome API for esp32s3-test @ 192.168.1.97
WARNING Disconnected from API

The value of esp_sleep_get_wakeup_cause() is consistent at 0 in the first awake period, and 4 in the second awake period - CORRECT !

But does wakeup_cause have a value of 3, 0, 1070229052, 1070229548, or -16777216 ? I wondered if those last 3 values might be the address of the esp_sleep_get_wakeup_cause() function, so added the .state in the statements - but they still show up.
All but one of the ESP_LOGD() lines (the test:141 at 22:10:08) give id(wakeup_cause).state a value of zero, suggesting that logger.log and ESP_LOGD() treat this variable differently.

And is num_wake_cycles actually 0 or 1744 ? It is actually 1744 from my previous testing, and is being correctly incremented in on:boot: … but why showed always as 0 in the first wake period ?

Your yaml “revision” doesn’t perfectly match your log.

Try to add priority: -100.0 on boot options.
On first boot esphome has to restore value from flash, on wake-up it gets it from RTC memory.

Good catch, thanks Karosm. I was incorrectly assuming that the default was at -100 priority.

I am trimming the yaml code down a little more, and formatting the log statements to try to make it easier to compare them.

With each iteration the results are becoming more consistent - wrong (per my understanding) but consistently wrong.

My understanding is…

In my template sensor I am using

    lambda:  |-
      return esp_sleep_get_wakeup_cause();

to set the value of wakeup_cause. Because this is a sensor rather than a straight variable we should use id(wakeup_cause).state to view its current value; whereas id(wakeup_cause) is probably returning a pointer to where the sensor’s definition is in memory (and this can change from one wake to the other due to each wakeup being a full reboot.

To ensure wakeup_cause is updated at the beginning of each awake period I have added a sensor.template.publish into on_boot:, which also executes the same assignment. I believe that either one of these should do the job.

So why is wakeup_cause stubbornly refusing to take the value 4 in subsequent awake periods ?

In on_boot: I am also incrementing num_wake_cycles, which is simply a variable, so .state is inapropriate … so where does the huge value come from that persists from the second wake period ?

It seems that the first wake period is different from all subsequent wake periods … which brings me to

Could it maybe have something to do with the Saving 1 preferences to flash: 1 cached, 0 written as it is shutting down for deep sleep ?
Or possibly that I have managed to fill all of flash memory so nothing is being changed ?

Oops, forgot to include latest yaml

#####################################################################
#                                                                   #
# The ESP32-S3-DevKitC-1 (v1) board with ESP32-S3-WROOM-1-N16R8     #
#   CURRENT usage for debugging parts of the greenhouse code        #
#                                                                   #
#####################################################################

substitutions:
  devicename:     "esp32s3-test"
  update_interval_sensor:  "3 min"        # How often to measure and report sensor values

esp32:
  board: esp32-s3-devkitc-1         # devkit from AliExpress
  variant: esp32s3
  flash_size: 16MB
  framework:
    type: esp-idf
    version: recommended

psram:
  mode: octal
  speed: 80MHz

esphome:
  name: $devicename
  platformio_options:
    board_build.flash_mode: dio 
  on_boot: 
    - priority: -100.0
      then:
        - sensor.template.publish:
            id: wakeup_cause
            state: !lambda 'return esp_sleep_get_wakeup_cause();'
        - lambda: |-
            ESP_LOGD("on_boot", "");
            ESP_LOGD("on-boot", "#################### ON_BOOT ####################");
            ESP_LOGD("on_boot", ">>>>>> on_boot: initial values   wakeup_cause=%d, wakeup_cause.state=%d, num_wake_cycles=%d", id(wakeup_cause), id(wakeup_cause).state, id(num_wake_cycles) );
            // id(wakeup_cause) = esp_sleep_get_wakeup_cause();
            id(num_wake_cycles) += 1;
        - logger.log: "##### on_boot finished" 
  on_shutdown:
    - priority: -100
      then:
        - lambda: |-
            ESP_LOGD("on_shutdown", "");
            ESP_LOGD("on_shutdown", ">>>>>>   wakeup_cause=%d, wakeup_cause.state=%d, num_wake_cycles=%d", id(wakeup_cause), id(wakeup_cause).state, id(num_wake_cycles) );
        - logger.log: 
            format: "    >>>>>>   esp_sleep_get_wakeup_cause()=%d, wakeup_cause=%d, wakeup_cause.state=%d, num_wake_cycles=%d "
            args: [ 'esp_sleep_get_wakeup_cause()', 'id(wakeup_cause)', 'id(wakeup_cause).state', 'id(num_wake_cycles)' ]

deep_sleep: 
  id: deep_sleep_1
  run_duration:   360000ms  # = 6 min - how long to run (be awake)
  sleep_duration: 600000ms  # =10 min - how long to sleep for

wifi:
  ssid:     !secret upstairs_ssid
  password: !secret upstairs_password 
  manual_ip:
    static_ip: 192.168.1.97
    gateway: 192.168.1.1
    subnet: 255.255.255.0
  fast_connect: True

ota:
  platform: esphome
  password: !secret esphome_ota_password

web_server:
  port: 80

api:
  encryption:
    key: !secret esphome_api_encryption

logger:
  level: DEBUG

i2c:
  - id: bus_a
    sda: GPIO5
    scl: GPIO4
    scan: true
    frequency: 400kHz

globals:
  - id: num_wake_cycles
    type: int
    restore_value: yes
    initial_value: '0'

sensor:
  - platform: template
    id: wakeup_cause
    name: $devicename Wakeup cause
    update_interval: $update_interval_sensor
    accuracy_decimals: 0
    lambda:  |-
      return esp_sleep_get_wakeup_cause();
    on_value:
      then:
        - logger.log: 
            format: "    >>>>>>   esp_sleep_get_wakeup_cause()=%d, wakeup_cause=%d, wakeup_cause.state=%d, num_wake_cycles=%d, x=%d "
            args: [ 'esp_sleep_get_wakeup_cause()', 'id(wakeup_cause)', 'id(wakeup_cause).state', 'id(num_wake_cycles)', 'x' ]
        - lambda: |-
            ESP_LOGD("ESP_LOGD", ">>>>>>   esp_sleep_get_wakeup_cause()=%d, wakeup_cause=%d, wakeup_cause.state=%d, num_wake_cycles=%d, x=%d", 
                    esp_sleep_get_wakeup_cause(), id(wakeup_cause), id(wakeup_cause).state, id(num_wake_cycles), x );

  - platform: bh1750
    name: $devicename BH1750 Illuminance
    address: 0x23
    update_interval: $update_interval_sensor
    on_value:
      then:
        - logger.log: 
            format: "    >>>>>>   esp_sleep_get_wakeup_cause()=%d, wakeup_cause=%d, wakeup_cause.state=%d, num_wake_cycles=%d "
            args: [ 'esp_sleep_get_wakeup_cause()', 'id(wakeup_cause)', 'id(wakeup_cause).state', 'id(num_wake_cycles)' ]
        - lambda: |-
            ESP_LOGD("ESP_LOGD", ">>>>>>   esp_sleep_get_wakeup_cause()=%d, wakeup_cause=%d, wakeup_cause.state=%d, num_wake_cycles=%d ", 
                    esp_sleep_get_wakeup_cause(), id(wakeup_cause), id(wakeup_cause).state, id(num_wake_cycles) );

  - platform: wifi_signal
    name: $devicename Wifi signal
    update_interval: $update_interval_sensor

and resulting log

Uploading: [============================================================] 100% Done...

INFO Upload took 5.13 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.1.97 using esphome API
INFO Successfully connected to esp32s3-test @ 192.168.1.97 in 4.126s
INFO Successful handshake with esp32s3-test @ 192.168.1.97 in 0.094s
[14:58:51][I][app:100]: ESPHome version 2025.3.0 compiled on Mar 29 2025, 14:57:47
[14:58:51][C][wifi:600]: WiFi:
[14:58:51][C][wifi:428]:   Local MAC: 98:3D:AE:EB:24:F4
[14:58:51][C][wifi:433]:   SSID: [redacted]
[14:58:51][C][wifi:436]:   IP Address: 192.168.1.97
[14:58:51][C][wifi:439]:   BSSID: [redacted]
[14:58:51][C][wifi:441]:   Hostname: 'esp32s3-test'
[14:58:51][C][wifi:443]:   Signal strength: -62 dB ▂▄▆█
[14:58:51][C][wifi:447]:   Channel: 13
[14:58:51][C][wifi:448]:   Subnet: 255.255.255.0
[14:58:51][C][wifi:449]:   Gateway: 192.168.1.1
[14:58:51][C][wifi:450]:   DNS1: 0.0.0.0
[14:58:51][C][wifi:451]:   DNS2: 0.0.0.0
[14:58:51][C][logger:177]: Logger:
[14:58:51][C][logger:178]:   Max Level: DEBUG
[14:58:51][C][logger:179]:   Initial Level: DEBUG
[14:58:51][C][logger:181]:   Log Baud Rate: 115200
[14:58:51][C][logger:182]:   Hardware UART: USB_SERIAL_JTAG
[14:58:51][C][i2c.idf:083]: I2C Bus:
[14:58:51][C][i2c.idf:084]:   SDA Pin: GPIO5
[14:58:51][C][i2c.idf:085]:   SCL Pin: GPIO4
[14:58:51][C][i2c.idf:086]:   Frequency: 400000 Hz
[14:58:51][C][i2c.idf:092]:   Recovery: bus successfully recovered
[14:58:51][I][i2c.idf:102]: Results from i2c bus scan:
[14:58:51][I][i2c.idf:108]: Found i2c device at address 0x23
[14:58:51][C][template.sensor:022]: Template Sensor 'esp32s3-test Wakeup cause'
[14:58:51][C][template.sensor:022]:   State Class: ''
[14:58:51][C][template.sensor:022]:   Unit of Measurement: ''
[14:58:51][C][template.sensor:022]:   Accuracy Decimals: 0
[14:58:51][C][template.sensor:023]:   Update Interval: 180.0s
[14:58:51][C][psram:020]: PSRAM:
[14:58:51][C][psram:021]:   Available: YES
[14:58:51][C][psram:028]:   Size: 8192 KB
[14:58:51][C][bh1750.sensor:118]: BH1750 'esp32s3-test BH1750 Illuminance'
[14:58:51][C][bh1750.sensor:118]:   Device Class: 'illuminance'
[14:58:51][C][bh1750.sensor:118]:   State Class: 'measurement'
[14:58:51][C][bh1750.sensor:118]:   Unit of Measurement: 'lx'
[14:58:51][C][bh1750.sensor:118]:   Accuracy Decimals: 1
[14:58:51][C][bh1750.sensor:119]:   Address: 0x23
[14:58:51][C][bh1750.sensor:124]:   Update Interval: 180.0s
[14:58:51][C][web_server:285]: Web Server:
[14:58:51][C][web_server:286]:   Address: 192.168.1.97:80
[14:58:51][C][mdns:116]: mDNS:
[14:58:51][C][mdns:117]:   Hostname: esp32s3-test
[14:58:51][C][esphome.ota:073]: Over-The-Air updates:
[14:58:51][C][esphome.ota:074]:   Address: 192.168.1.97:3232
[14:58:51][C][esphome.ota:075]:   Version: 2
[14:58:51][C][safe_mode:018]: Safe Mode:
[14:58:51][C][safe_mode:019]:   Boot considered successful after 60 seconds
[14:58:51][C][safe_mode:021]:   Invoke after 10 boot attempts
[14:58:51][C][safe_mode:022]:   Remain in safe mode for 300 seconds
[14:58:51][C][api:140]: API Server:
[14:58:51][C][api:141]:   Address: 192.168.1.97:6053
[14:58:51][C][api:143]:   Using noise encryption: YES
[14:58:51][C][wifi_signal.sensor:010]: WiFi Signal 'esp32s3-test Wifi signal'
[14:58:51][C][wifi_signal.sensor:010]:   Device Class: 'signal_strength'
[14:58:51][C][wifi_signal.sensor:010]:   State Class: 'measurement'
[14:58:51][C][wifi_signal.sensor:010]:   Unit of Measurement: 'dBm'
[14:58:51][C][wifi_signal.sensor:010]:   Accuracy Decimals: 0
[14:58:51][C][deep_sleep:026]: Setting up Deep Sleep...
[14:58:51][C][deep_sleep:029]:   Sleep Duration: 600000 ms
[14:58:51][C][deep_sleep:032]:   Run Duration: 360000 ms
[14:59:27][D][esp32.preferences:114]: Saving 2 preferences to flash...
[14:59:27][D][esp32.preferences:142]: Saving 2 preferences to flash: 0 cached, 2 written, 0 failed
[14:59:47][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[14:59:47][D][esp32.preferences:114]: Saving 1 preferences to flash...
[14:59:47][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:00:39][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 0.00000  with 0 decimals of accuracy
[15:00:39][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070226004, wakeup_cause.state=0, num_wake_cycles=0, x=1816 
[15:00:39][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070226004, wakeup_cause.state=0, num_wake_cycles=0, x=1816
[15:00:54][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -61.00000 dBm with 0 decimals of accuracy
[15:00:59][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=56.5lx
[15:00:59][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 56.48129 lx with 1 decimals of accuracy
[15:00:59][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070226004, wakeup_cause.state=0, num_wake_cycles=0 
[15:00:59][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070226004, wakeup_cause.state=0, num_wake_cycles=0 
[15:03:39][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 0.00000  with 0 decimals of accuracy
[15:03:39][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070226004, wakeup_cause.state=0, num_wake_cycles=0, x=1816 
[15:03:39][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070226004, wakeup_cause.state=0, num_wake_cycles=0, x=1816
[15:03:54][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -63.00000 dBm with 0 decimals of accuracy
[15:03:59][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=49.1lx
[15:03:59][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 49.12401 lx with 1 decimals of accuracy
[15:03:59][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070226004, wakeup_cause.state=0, num_wake_cycles=0 
[15:03:59][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070226004, wakeup_cause.state=0, num_wake_cycles=0 
[15:04:50][I][deep_sleep:060]: Beginning Deep Sleep
[15:04:50][I][deep_sleep:062]: Sleeping for 600000000us
[15:04:50][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:04:50][D][esp32.preferences:142]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[15:04:50][D][on_shutdown:045]: 
[15:04:50][D][on_shutdown:046]: >>>>>>   wakeup_cause=1070226004, wakeup_cause.state=1070248924, num_wake_cycles=0
[15:04:50][D][main:049]:     >>>>>>   esp_sleep_get_wakeup_cause()=0, wakeup_cause=1070226004, wakeup_cause.state=0, num_wake_cycles=0 
INFO Processing expected disconnect from ESPHome API for esp32s3-test @ 192.168.1.97
WARNING Disconnected from API
WARNING Can't connect to ESPHome API for esp32s3-test @ 192.168.1.97: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.1.97', port=6053))]: [Errno 113] Connect call failed ('192.168.1.97', 6053) (SocketAPIError)
INFO Trying to connect to esp32s3-test @ 192.168.1.97 in the background
INFO Successfully connected to esp32s3-test @ 192.168.1.97 in 0.013s
INFO Successful handshake with esp32s3-test @ 192.168.1.97 in 0.116s
[15:14:44][D][api.connection:1801]: Home Assistant 2025.3.3 (192.168.1.98): Connected successfully
[15:15:13][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:15:13][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:15:42][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[15:15:42][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:15:43][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:16:32][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=36.1lx
[15:16:32][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 36.10728 lx with 1 decimals of accuracy
[15:16:32][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:16:32][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:17:30][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[15:17:30][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1817 
[15:17:30][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1817
[15:17:31][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -63.00000 dBm with 0 decimals of accuracy
[15:19:32][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=34.1lx
[15:19:32][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 34.06988 lx with 1 decimals of accuracy
[15:19:32][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:19:32][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:20:30][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[15:20:30][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1817 
[15:20:30][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1817
[15:20:31][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -63.00000 dBm with 0 decimals of accuracy
[15:20:43][I][deep_sleep:060]: Beginning Deep Sleep
[15:20:43][I][deep_sleep:062]: Sleeping for 600000000us
[15:20:43][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:20:43][D][esp32.preferences:142]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[15:20:43][D][on_shutdown:045]: 
[15:20:43][D][on_shutdown:046]: >>>>>>   wakeup_cause=1070226136, wakeup_cause.state=1070248924, num_wake_cycles=0
[15:20:43][D][main:049]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
INFO Processing expected disconnect from ESPHome API for esp32s3-test @ 192.168.1.97
WARNING Disconnected from API
WARNING Can't connect to ESPHome API for esp32s3-test @ 192.168.1.97: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.1.97', port=6053))]: [Errno 113] Connect call failed ('192.168.1.97', 6053) (SocketAPIError)
INFO Trying to connect to esp32s3-test @ 192.168.1.97 in the background
INFO Successfully connected to esp32s3-test @ 192.168.1.97 in 0.016s
INFO Successful handshake with esp32s3-test @ 192.168.1.97 in 0.127s
[15:31:19][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:31:19][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:31:34][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[15:31:34][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:31:34][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:32:20][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -60.00000 dBm with 0 decimals of accuracy
[15:32:53][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=32.1lx
[15:32:53][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 32.14567 lx with 1 decimals of accuracy
[15:32:53][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:32:53][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:33:33][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[15:33:33][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1818 
[15:33:33][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1818
[15:35:20][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -63.00000 dBm with 0 decimals of accuracy
[15:35:53][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=34.6lx
[15:35:53][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 34.63582 lx with 1 decimals of accuracy
[15:35:53][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:35:53][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:36:33][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[15:36:33][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1818 
[15:36:33][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1818
[15:36:35][I][deep_sleep:060]: Beginning Deep Sleep
[15:36:35][I][deep_sleep:062]: Sleeping for 600000000us
[15:36:35][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:36:35][D][esp32.preferences:142]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[15:36:35][D][on_shutdown:045]: 
[15:36:35][D][on_shutdown:046]: >>>>>>   wakeup_cause=1070226136, wakeup_cause.state=1070248924, num_wake_cycles=0
[15:36:35][D][main:049]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
INFO Processing expected disconnect from ESPHome API for esp32s3-test @ 192.168.1.97
WARNING Disconnected from API
WARNING Can't connect to ESPHome API for esp32s3-test @ 192.168.1.97: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.1.97', port=6053))]: [Errno 113] Connect call failed ('192.168.1.97', 6053) (SocketAPIError)
INFO Trying to connect to esp32s3-test @ 192.168.1.97 in the background
INFO Successfully connected to esp32s3-test @ 192.168.1.97 in 0.046s
INFO Successful handshake with esp32s3-test @ 192.168.1.97 in 0.107s
[15:46:58][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:46:58][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:47:26][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[15:47:26][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:47:26][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:48:25][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[15:48:25][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1819 
[15:48:25][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1819
[15:48:34][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -61.00000 dBm with 0 decimals of accuracy
[15:49:18][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=26.3lx
[15:49:18][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 26.25984 lx with 1 decimals of accuracy
[15:49:18][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:49:18][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:51:25][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[15:51:25][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1819 
[15:51:25][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1819
[15:51:34][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -61.00000 dBm with 0 decimals of accuracy
[15:52:18][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=18.6lx
[15:52:18][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 18.56299 lx with 1 decimals of accuracy
[15:52:18][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:52:18][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[15:52:27][I][deep_sleep:060]: Beginning Deep Sleep
[15:52:27][I][deep_sleep:062]: Sleeping for 600000000us
[15:52:27][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:52:27][D][esp32.preferences:142]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[15:52:27][D][on_shutdown:045]: 
[15:52:27][D][on_shutdown:046]: >>>>>>   wakeup_cause=1070226136, wakeup_cause.state=1070248924, num_wake_cycles=0
[15:52:27][D][main:049]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
INFO Processing expected disconnect from ESPHome API for esp32s3-test @ 192.168.1.97
WARNING Disconnected from API
WARNING Can't connect to ESPHome API for esp32s3-test @ 192.168.1.97: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.1.97', port=6053))]: [Errno 113] Connect call failed ('192.168.1.97', 6053) (SocketAPIError)
INFO Trying to connect to esp32s3-test @ 192.168.1.97 in the background
INFO Successfully connected to esp32s3-test @ 192.168.1.97 in 0.017s
INFO Successful handshake with esp32s3-test @ 192.168.1.97 in 0.132s
[16:03:09][D][esp32.preferences:114]: Saving 1 preferences to flash...
[16:03:09][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[16:03:18][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[16:03:18][D][esp32.preferences:114]: Saving 1 preferences to flash...
[16:03:18][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[16:04:05][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=22.5lx
[16:04:05][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 22.52460 lx with 1 decimals of accuracy
[16:04:05][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[16:04:05][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[16:04:25][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -61.00000 dBm with 0 decimals of accuracy
[16:05:16][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[16:05:16][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1820 
[16:05:16][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1820
[16:07:05][D][bh1750.sensor:159]: 'esp32s3-test BH1750 Illuminance': Got illuminance=28.4lx
[16:07:05][D][sensor:093]: 'esp32s3-test BH1750 Illuminance': Sending state 28.41043 lx with 1 decimals of accuracy
[16:07:05][D][main:102]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[16:07:05][D][ESP_LOGD:119]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
[16:07:25][D][sensor:093]: 'esp32s3-test Wifi signal': Sending state -61.00000 dBm with 0 decimals of accuracy
[16:08:16][D][sensor:093]: 'esp32s3-test Wakeup cause': Sending state 4.00000  with 0 decimals of accuracy
[16:08:16][D][main:045]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1820 
[16:08:16][D][ESP_LOGD:106]: >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400, x=1820
[16:08:19][I][deep_sleep:060]: Beginning Deep Sleep
[16:08:19][I][deep_sleep:062]: Sleeping for 600000000us
[16:08:19][D][esp32.preferences:114]: Saving 1 preferences to flash...
[16:08:19][D][esp32.preferences:142]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[16:08:19][D][on_shutdown:045]: 
[16:08:19][D][on_shutdown:046]: >>>>>>   wakeup_cause=1070226136, wakeup_cause.state=1070248924, num_wake_cycles=0
[16:08:19][D][main:049]:     >>>>>>   esp_sleep_get_wakeup_cause()=4, wakeup_cause=1070226136, wakeup_cause.state=0, num_wake_cycles=1074790400 
INFO Processing expected disconnect from ESPHome API for esp32s3-test @ 192.168.1.97
WARNING Disconnected from API

As is often the case, it was a simple thing I had missed …

I ended up using the ‘%d’ formatter in all of my logger.log and ESP_LOGD() statements - should be ‘%d’ for integer variables and ‘%f’ for float variables. Consequently the loggers were unable to display some of the values in the format I specified.

Also I have got confused when to look at id(variable) or id(variable).state.