ESPHome emontx component - sensors missing

Mmm I seem to have lost the Sensor entries for the emonTx6 wifi, the sensor readings are no longer listed under the ESPHome device:

I can see the emonTx6 is still connected since the values are visible in the emonPi/Tx Config

Any idea why the sensor entities are not visible in HA? @FredM67 @borpin

Do you see the log output in the Serial Terminal?

[edit]
And then what is the output of the ESPHome Builder logs?

@FredM67 I saw this in the logs. Not completely up to date though

[13:07:03.961][E][esp32.crash:329]: *** CRASH DETECTED ON PREVIOUS BOOT ***
[13:07:03.974][E][esp32.crash:332]:   Reason: Fault - Unknown
[13:07:03.974][E][esp32.crash:336]:   Crashed core: 0
[13:07:03.974][E][esp32.crash:337]:   PC:  0x403832F2  (fault location)
WARNING Decoded 0x403832f2: esp_cpu_wait_for_intr at /data/cache/platformio/packages/framework-espidf/components/esp_hw_support/cpu.c:64
[13:07:04.624][E][esp32.crash:302]:   BT0: 0x403832F2  (backtrace)
WARNING Decoded 0x403832f2: esp_cpu_wait_for_intr at /data/cache/platformio/packages/framework-espidf/components/esp_hw_support/cpu.c:64
[13:07:05.147][E][esp32.crash:302]:   BT1: 0x403832E2  (backtrace)
WARNING Decoded 0x403832e2: esp_cpu_wait_for_intr at /data/cache/platformio/packages/framework-espidf/components/esp_hw_support/cpu.c:57 (discriminator 1)
[13:07:05.662][E][esp32.crash:302]:   BT2: 0x420CE32E  (stack scan)
WARNING Decoded 0x420ce32e: prvCheckTasksWaitingTermination at /data/cache/platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/tasks.c:4576
 (inlined by) prvIdleTask at /data/cache/platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/tasks.c:4301
[13:07:06.065][E][esp32.crash:358]: Use: addr2line -pfiaC -e firmware.elf 0x403832F2 0x403832F2 0x403832E2 0x420CE32E
[13:07:06.065][I][app:154]: ESPHome version 2026.4.3 compiled on 2026-05-03 15:18:09 +0100
[13:07:06.065][I][app:161]: ESP32 Chip: ESP32-C3 rev0.4, 1 core(s)

All the logs from ESPHome look fine:

INFO ESPHome 2026.5.2
INFO Loaded validated config cache for emontx6.yaml, skipping validation.
INFO Starting log output from emontx6.local using esphome API
INFO Successfully resolved emontx6.local in 0.066s
INFO Successfully connected to emontx6 @ 192.168.86.22 in 0.005s
INFO Successful handshake with emontx6 @ 192.168.86.22 in 0.055s
[15:58:05.030][I][app:154]: ESPHome version 2026.4.5 compiled on 2026-05-19 16:28:04 +0100
[15:58:05.034][I][app:161]: ESP32 Chip: ESP32-C3 rev0.4, 1 core(s)
[15:58:05.035][C][logger:219]: Logger:
[15:58:05.035][C][logger:219]:   Max Level: DEBUG
[15:58:05.035][C][logger:219]:   Initial Level: DEBUG
[15:58:05.035][C][logger:226]:   Log Baud Rate: 115200
[15:58:05.035][C][logger:226]:   Hardware UART: USB_SERIAL_JTAG
[15:58:05.038][C][logger:235]:   Task Log Buffer Size: 768 bytes
[15:58:05.045][C][uart.idf:254]: UART Bus 0:
[15:58:05.050][C][uart.idf:152]:   TX Pin: GPIO21
[15:58:05.050][C][uart.idf:152]:   RX Pin: GPIO20
[15:58:05.050][C][uart.idf:259]:   RX Buffer Size: 2048
[15:58:05.050][C][uart.idf:259]:   RX Full Threshold: 114
[15:58:05.050][C][uart.idf:259]:   RX Timeout: 2
[15:58:05.054][C][uart.idf:268]:   Baud Rate: 115200 baud
[15:58:05.054][C][uart.idf:268]:   Data Bits: 8
[15:58:05.054][C][uart.idf:268]:   Parity: NONE
[15:58:05.054][C][uart.idf:268]:   Stop bits: 1
[15:58:05.054][C][uart.idf:268]:   Wake on data RX: ENABLED
[15:58:05.060][C][emontx_ha_bridge:035]: EmonTx HA Bridge:
[15:58:05.061][C][emontx_ha_bridge:036]:   HA events : esphome.emontx_raw, esphome.emontx_json
[15:58:05.061][C][emontx_ha_bridge:037]:   HA service: send_command
[15:58:05.074][C][emontx:080]: EmonTx:
[15:58:05.094][C][emontx:088]:   Sensor support: DISABLED
[15:58:05.094][C][captive_portal:134]: Captive Portal:
[15:58:05.094][C][wifi:1505]: WiFi:
[15:58:05.094][C][wifi:1505]:   Local MAC: 88:56:A6:6C:C4:A4
[15:58:05.094][C][wifi:1505]:   Connected: YES
[15:58:05.098][C][wifi:1216]:   IP Address: 192.168.86.22
[15:58:05.103][C][wifi:1227]:   SSID: [redacted]
[15:58:05.103][C][wifi:1227]:   BSSID: [redacted]
[15:58:05.103][C][wifi:1227]:   Hostname: 'emontx6'
[15:58:05.103][C][wifi:1227]:   Signal strength: -47 dB ▂▄▆█
[15:58:05.103][C][wifi:1227]:   Channel: 1
[15:58:05.103][C][wifi:1227]:   Subnet: 255.255.255.0
[15:58:05.103][C][wifi:1227]:   Gateway: 192.168.86.1
[15:58:05.103][C][wifi:1227]:   DNS1: 192.168.86.1
[15:58:05.103][C][wifi:1227]:   DNS2: 0.0.0.0
[15:58:05.104][C][esphome.ota:071]: Over-The-Air updates:
[15:58:05.104][C][esphome.ota:071]:   Address: emontx6.local:3232
[15:58:05.104][C][esphome.ota:071]:   Version: 2
[15:58:05.104][C][esphome.ota:078]:   Password configured
[15:58:05.118][C][safe_mode:026]: Safe Mode:
[15:58:05.118][C][safe_mode:026]:   Successful after: 60s
[15:58:05.118][C][safe_mode:026]:   Invoke after: 10 attempts
[15:58:05.118][C][safe_mode:026]:   Duration: 300s
[15:58:05.137][C][safe_mode:043]:   Bootloader rollback: support unknown
[15:58:05.137][C][web_server.ota:256]: Web Server OTA
[15:58:05.137][C][api:235]: Server:
[15:58:05.137][C][api:235]:   Address: emontx6.local:6053
[15:58:05.137][C][api:235]:   Listen backlog: 4
[15:58:05.137][C][api:235]:   Max connections: 8
[15:58:05.140][C][api:242]:   Noise encryption: YES
[15:58:05.186][C][mdns:194]: mDNS:
[15:58:05.186][C][mdns:194]:   Hostname: emontx6
[15:58:14.683][D][emontx:034]: Received line: {"MSG":1618,"V1":240.53,"P1":94,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4316948,"E2":-6,"E3":-35,"E4":-87,"E5":-52,"E6":-98}
[15:58:24.503][D][emontx:034]: Received line: {"MSG":1619,"V1":240.61,"P1":92,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4316949,"E2":-6,"E3":-35,"E4":-87,"E5":-52,"E6":-98}
[15:58:34.325][D][emontx:034]: Received line: {"MSG":1620,"V1":240.70,"P1":93,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4316949,"E2":-6,"E3":-35,"E4":-87,"E5":-52,"E6":-98}
[15:58:44.143][D][emontx:034]: Received line: {"MSG":1621,"V1":240.69,"P1":94,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4316949,"E2":-6,"E3":-35,"E4":-87,"E5":-52,"E6":-98}

Looks like there a crash :thinking:

Yes (this is mine and unrelated to Glyn’s problem).

Apart from this line!

@FredM67 - that is an error generated by the emontx component.

I’ve moved it to a new conversation.

@Gwil I think we could do with an ESPHome topic somewhere, or perhaps and emonWiFi topic as they are closely linked (or both).

This line would tell, sensors have been disabled… Thats why there’s no sensor. If it crashes, there’s for sure a bug somewhere.
Have to take a look.

Have they returned? Have you tried a full reboot?

Do you have an input to emoncms running as well?

Still no sensor readings. I’ve tried restarting HA and the emonTx. I can’t see any relevant error logs in the HA log.

I didnt previously, but I’ve just updated the ESP config with the HTTP integration to post data directly to emoncms.org. This is working fine. It so cool, that ESPhome can do this :+1:

What debug level are you set at?

Does this still have the line I quoted above in the logs?

Cold boot of the Tx?

What version of espHome?

Not sure, how do I check or change this?

I’ve just checked the logs and it seems adding the HTTP posting is causing the emonWiFi to periodically crash, it’s taking 2406ms to do the HTTP post. I think this issue is unrelated to the HA sensor issue. Have you got HTTP posting working reliably?

[08:59:43.543][D][http_request.idf:044]: Received response header, name: content-length, value: 2
[08:59:43.548][D][http_request.idf:044]: Received response header, name: content-type, value: application/json
[08:59:51.498][D][emontx:034]: Received line: {"MSG":3115,"V1":242.49,"P1":0,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4329930,"E2":-6,"E3":-36,"E4":-87,"E5":-53,"E6":-101}
[08:59:53.477][D][http_request.idf:044]: Received response header, name: content-length, value: 2
[08:59:53.480][D][http_request.idf:044]: Received response header, name: content-type, value: application/json
[09:00:01.300][D][emontx:034]: Received line: {"MSG":3116,"V1":242.55,"P1":0,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4329930,"E2":-6,"E3":-36,"E4":-87,"E5":-53,"E6":-101}
[09:00:03.107][D][http_request.idf:044]: Received response header, name: content-length, value: 2
[09:00:03.111][D][http_request.idf:044]: Received response header, name: content-type, value: application/json
[09:00:03.134][I][safe_mode:142]: Boot seems successful; resetting boot loop counter
[09:00:05.572][D][preferences:148]: Writing 1 items: 0 cached, 1 written, 0 failed
[09:00:11.119][D][emontx:034]: Received line: {"MSG":3117,"V1":242.31,"P1":0,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4329930,"E2":-6,"E3":-36,"E4":-87,"E5":-53,"E6":-101}
INFO Processing unexpected disconnect from ESPHome API for emontx6 @ 192.168.86.22
WARNING Disconnected from API
INFO Successfully resolved emontx6 @ 192.168.86.22 in 0.000s
INFO Successfully connected to emontx6 @ 192.168.86.22 in 0.005s
INFO Successful handshake with emontx6 @ 192.168.86.22 in 0.118s
[09:00:47.671][E][esp32.crash:329]: *** CRASH DETECTED ON PREVIOUS BOOT ***
[09:00:47.675][E][esp32.crash:332]:   Reason: Fault - Unknown
[09:00:47.676][E][esp32.crash:336]:   Crashed core: 0
[09:00:47.676][E][esp32.crash:337]:   PC:  0x40383128  (fault location)
WARNING Decoded 0x40383128: esp_cpu_wait_for_intr at /COMPONENT_ESP_HW_SUPPORT_DIR/cpu.c:64
[09:00:47.925][E][esp32.crash:302]:   BT0: 0x40383128  (backtrace)
WARNING Decoded 0x40383128: esp_cpu_wait_for_intr at /COMPONENT_ESP_HW_SUPPORT_DIR/cpu.c:64
[09:00:48.163][E][esp32.crash:302]:   BT1: 0x40383118  (backtrace)
WARNING Decoded 0x40383118: esp_cpu_wait_for_intr at /COMPONENT_ESP_HW_SUPPORT_DIR/cpu.c:57 (discriminator 1)
[09:00:48.403][E][esp32.crash:302]:   BT2: 0x420C426A  (stack scan)
WARNING Decoded 0x420c426a: prvCheckTasksWaitingTermination at /COMPONENT_FREERTOS_DIR/FreeRTOS-Kernel/tasks.c:4576
 (inlined by) prvIdleTask at /COMPONENT_FREERTOS_DIR/FreeRTOS-Kernel/tasks.c:4301
[09:00:48.570][E][esp32.crash:358]: Use: addr2line -pfiaC -e firmware.elf 0x40383128 0x40383128 0x40383118 0x420C426A
[09:00:55.258][D][emontx:034]: Received line: {"MSG":3121,"V1":242.40,"P1":0,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4329930,"E2":-6,"E3":-36,"E4":-87,"E5":-53,"E6":-101}
[09:00:57.169][D][http_request.idf:044]: Received response header, name: content-length, value: 2
[09:00:57.175][D][http_request.idf:044]: Received response header, name: content-type, value: application/json
[09:00:57.183][W][component:522]: emontx took a long time for an operation (1925 ms), max is 30 ms
[09:01:05.064][D][emontx:034]: Received line: {"MSG":3122,"V1":242.34,"P1":0,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4329930,"E2":-6,"E3":-36,"E4":-87,"E5":-53,"E6":-101}
[09:01:06.999][D][http_request.idf:044]: Received response header, name: content-length, value: 2
[09:01:07.004][D][http_request.idf:044]: Received response header, name: content-type, value: application/json
[09:01:07.013][W][component:522]: emontx took a long time for an operation (1950 ms), max is 30 ms
[09:01:14.868][D][emontx:034]: Received line: {"MSG":3123,"V1":242.48,"P1":0,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4329930,"E2":-6,"E3":-36,"E4":-87,"E5":-53,"E6":-101}
[09:01:16.625][D][http_request.idf:044]: Received response header, name: content-length, value: 2
[09:01:16.631][D][http_request.idf:044]: Received response header, name: content-type, value: application/json
[09:01:16.638][I][safe_mode:142]: Boot seems successful; resetting boot loop counter
[09:01:18.148][D][preferences:148]: Writing 1 items: 0 cached, 1 written, 0 failed
[09:01:24.673][D][emontx:034]: Received line: {"MSG":3124,"V1":242.40,"P1":0,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4329930,"E2":-6,"E3":-36,"E4":-87,"E5":-53,"E6":-101}
[09:01:26.454][D][http_request.idf:044]: Received response header, name: content-length, value: 2
[09:01:26.458][D][http_request.idf:044]: Received response header, name: content-type, value: application/json
[09:01:34.480][D][emontx:034]: Received line: {"MSG":3125,"V1":242.42,"P1":0,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4329930,"E2":-6,"E3":-36,"E4":-87,"E5":-53,"E6":-101}
[09:01:36.491][D][http_request.idf:044]: Received response header, name: content-length, value: 2
[09:01:36.495][D][http_request.idf:044]: Received response header, name: content-type, value: application/json
[09:01:36.504][W][component:522]: emontx took a long time for an operation (2025 ms), max is 30 ms
[09:01:44.290][D][emontx:034]: Received line: {"MSG":3126,"V1":242.20,"P1":0,"P2":0,"P3":0,"P4":0,"P5":0,"P6":0,"E1":4329930,"E2":-6,"E3":-36,"E4":-87,"E5":-53,"E6":-101}
[09:01:46.117][D][http_request.idf:044]: Received response header, name: content-length, value: 2
[09:01:46.120][D][http_request.idf:044]: Received response header, name: content-type, value: application/json

this is the config I added for HTTP post:

substitutions:
  emoncms_server: "https://emoncms.org"
  emoncms_node: "emontx"
  emoncms_apikey: "xxxxxxxxxxxxxxxxxxxxxx"

http_request:
  useragent: esphome/emontx
  timeout: 10s

emontx:
  on_json:
    - then:
        - http_request.post:
            url: !lambda 'return "${emoncms_server}/input/post";'
            request_headers:
              Content-Type: "application/x-www-form-urlencoded"
            body: !lambda |-
              return "node=${emoncms_node}&apikey=${emoncms_apikey}&fulljson=" + raw_json;

Yes, I’ve tried this

ESPHome device builder: 2026.5.3

In the YAML you will see

logger:
  level: DEBUG

Logger Component - ESPHome - Smart Home Made Simple

Try changing that to VERY_VERBOSE then compile/install

Don’t leave it like that for too long as it does take a fair bit of processing time.

Hi all,
I’m flying back home today. It’ll be easier for me then to help track/find the issue.

Any updates or progress here at all? :crossed_fingers:

I’ll give a look this weekend…

No rush Fred, I was just curious :slight_smile:

Well, I’m afraid, there’s not that much we can do for this problem. Looks like it triggers the watchdog because from time to time, http takes too long.
It might be worth trying that:

It’s a parameter for http_request.

Is it possible to have this as a config option for marginal links? If it does reboot, do the sensors restart enabled?