Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slimmelezer ESP device keeps crashing periodically #35

Closed
RoadXY opened this issue Sep 7, 2023 · 19 comments
Closed

Slimmelezer ESP device keeps crashing periodically #35

RoadXY opened this issue Sep 7, 2023 · 19 comments
Labels
bug Something isn't working

Comments

@RoadXY
Copy link
Collaborator

RoadXY commented Sep 7, 2023

Describe the bug
Slimmelezer ESP device keeps crashing periodically

Device type
Custom device by Marcel Zuidwijk.
Bought here: https://www.zuidwijk.com/product/slimmelezer-plus/

image

YAML file

substitutions:
  device_name: slimmelezer
    
esphome:
  name: ${device_name}
  platform: ESP8266
  esp8266_restore_from_flash: true
  board: d1_mini
  name_add_mac_suffix: false

wifi:
  ap:
    ssid: ${device_name}
  
  ssid: !secret wifi_ssid
  password: !secret wifi_password

captive_portal:

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:

ota:

web_server:
  port: 80

uart:
  baud_rate: 115200
  rx_pin: D7
  rx_buffer_size: 1700

dsmr:
  id: dsmr_instance
  max_telegram_length: 1700
  gas_mbus_id: 1
  request_interval: 30s

sensor:
  - platform: dsmr
    energy_delivered_tariff1:
      name: "Energy Consumed Tariff 1"
    energy_delivered_tariff2:
      name: "Energy Consumed Tariff 2"
    energy_returned_tariff1:
      name: "Energy Produced Tariff 1"
    energy_returned_tariff2:
      name: "Energy Produced Tariff 2"
    power_delivered:
      name: "Power Consumed"
      accuracy_decimals: 3
    power_returned:
      name: "Power Produced"
      accuracy_decimals: 3
    electricity_failures:
      name: "Electricity Failures"
      icon: mdi:alert
    electricity_long_failures:
      name: "Long Electricity Failures"
      icon: mdi:alert
    voltage_l1:
      name: "Voltage Phase 1"
    voltage_l2:
      name: "Voltage Phase 2"
    voltage_l3:
      name: "Voltage Phase 3"
    current_l1:
      name: "Current Phase 1"
    current_l2:
      name: "Current Phase 2"
    current_l3:
      name: "Current Phase 3"
    power_delivered_l1:
      name: "Power Consumed Phase 1"
      accuracy_decimals: 3
    power_delivered_l2:
      name: "Power Consumed Phase 2"
      accuracy_decimals: 3
    power_delivered_l3:
      name: "Power Consumed Phase 3"
      accuracy_decimals: 3
    power_returned_l1:
      name: "Power Produced Phase 1"
      accuracy_decimals: 3
    power_returned_l2:
      name: "Power Produced Phase 2"
      accuracy_decimals: 3
    power_returned_l3:
      name: "Power Produced Phase 3"
      accuracy_decimals: 3
    gas_delivered:
      name: "Gas Consumed"

  - platform: wifi_signal
    name: "WiFi Signaal"
    id: wifi_signalstrength
    update_interval: 900s
    icon: 'mdi:signal'
    
  - platform: uptime
    name: "Uptime"
    id: uptime_sensor
    internal: true
    update_interval: 600s
    icon: 'mdi:clock-outline'
    filters:
      - lambda: return x / 60;
    unit_of_measurement: "min"

text_sensor:
  - platform: dsmr
    identification:
      name: "DSMR Identification"
    p1_version:
      name: "DSMR Version"
  - platform: version
    name: "ESPHome Version"
    hide_timestamp: true
@Baldhor
Copy link
Owner

Baldhor commented Sep 7, 2023

@RoadXY Fo rme the problem come from your device, so it's very difficult to help you.
The best I could do is add logging of the raw data received when the problem occur, but as far as I can tell you can find it using the web server interface (action 1 below).

Dutch, BE and LUX are using DSMR seems, but with a few difference in the implementation. Based on your configuration I think you are dutch (or at least living there), if not your conf is wrong :)

I would advice to check:
1/ The log of the device itself after it "crashed"

2/ Test if using encryptionKey the problem disappear (I don't beieve it will ...)

3/ Increase buffer and telegram size to 3000
It seems that the data length is a reccurrent issue

@RoadXY RoadXY added the bug Something isn't working label Sep 8, 2023
@Baldhor
Copy link
Owner

Baldhor commented Sep 8, 2023

@RoadXY As far as I can remember, everytime you have an error with your slimmmezer, whithin the same 30 seconds, you also lose connection to another device:

2023-09-06T18:12:43.611Z [log] [ManagerDrivers] [Driver:esphome-wizard] [PhysicalDevice:[192.168.0.25:6053](http://192.168.0.25:6053/)] Disconnected: unavailable!
2023-09-06T18:12:48.599Z [log] [ManagerDrivers] [Driver:esphome-wizard] [PhysicalDevice:[192.168.0.25:6053](http://192.168.0.25:6053/)] Disconnected: unavailable!
2023-09-06T18:12:58.932Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:199f541e-b5b7-4aa1-9511-ff64ede5e3cb]  [0;36m[D][sensor:094]: 'WiFi Signaal': Sending state -87.00000 dBm with 0 decimals of accuracy [0m
2023-09-06T18:13:00.836Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:c701d0d0-7864-49e9-9960-2cba15d9cd4a] Error on device lage-staande-lamp: Error: connect EHOSTUNREACH [192.168.0.22:6053](http://192.168.0.22:6053/)
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -113,
  code: 'EHOSTUNREACH',
  syscall: 'connect',
  address: '192.168.0.22',
  port: 6053
}

What's the relationship between both ?

@Baldhor
Copy link
Owner

Baldhor commented Sep 8, 2023

@RoadXY And can you confirm, when your connection to the slimmezer is broken, if you jsut restart the ESPhome app, it works again ?

@RoadXY
Copy link
Collaborator Author

RoadXY commented Sep 8, 2023

@RoadXY As far as I can remember, everytime you have an error with your slimmmezer, whithin the same 30 seconds, you also lose connection to another device:

2023-09-06T18:12:43.611Z [log] [ManagerDrivers] [Driver:esphome-wizard] [PhysicalDevice:[192.168.0.25:6053](http://192.168.0.25:6053/)] Disconnected: unavailable!
2023-09-06T18:12:48.599Z [log] [ManagerDrivers] [Driver:esphome-wizard] [PhysicalDevice:[192.168.0.25:6053](http://192.168.0.25:6053/)] Disconnected: unavailable!
2023-09-06T18:12:58.932Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:199f541e-b5b7-4aa1-9511-ff64ede5e3cb]  [0;36m[D][sensor:094]: 'WiFi Signaal': Sending state -87.00000 dBm with 0 decimals of accuracy [0m
2023-09-06T18:13:00.836Z [log] [ManagerDrivers] [Driver:esphome-device] [Device:c701d0d0-7864-49e9-9960-2cba15d9cd4a] Error on device lage-staande-lamp: Error: connect EHOSTUNREACH [192.168.0.22:6053](http://192.168.0.22:6053/)
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -113,
  code: 'EHOSTUNREACH',
  syscall: 'connect',
  address: '192.168.0.22',
  port: 6053
}

What's the relationship between both ?

None. The "lage-staande-lamp" is a device which is unplugged from the wall a lot for various reasons.
Maybe that's it?
I've never had this device failing after time (only when unplugged, offcourse)

@Baldhor
Copy link
Owner

Baldhor commented Sep 8, 2023

@RoadXY Finaly, if your device is correctly connected to homey, and then you restart your device itself (do not touch the app), does it reconnect autoamtically (and correctly) ?

@RoadXY
Copy link
Collaborator Author

RoadXY commented Sep 8, 2023

@RoadXY And can you confirm, when your connection to the slimmezer is broken, if you jsut restart the ESPhome app, it works again ?

Yes, it always is back online if I restart the ESPhome app on Homey

@RoadXY
Copy link
Collaborator Author

RoadXY commented Sep 8, 2023

@RoadXY Finaly, if your device is correctly connected to homey, and then you restart your device itself (do not touch the app), does it reconnect autoamtically (and correctly) ?

I will try that, never tried that.
P.s. HomeAssistant is always connected to 'slimmelezer' and never fails.
This is the only device of the 5 devices I have, which keeps failing.

@Baldhor
Copy link
Owner

Baldhor commented Sep 8, 2023

@RoadXY Finaly, if your device is correctly connected to homey, and then you restart your device itself (do not touch the app), does it reconnect autoamtically (and correctly) ?

I will try that, never tried that. P.s. HomeAssistant is always connected to 'slimmelezer' and never fails. This is the only device of the 5 devices I have, which keeps failing.

I think we can consider that the low level client I use has a problem, when losing connection to Slimmezer (DSMR component), it become "unclean", and so further reconnection fail.
Recconnection is working smoothly on my own devices. So it seems very particular with DSMR component.

Please test reconnection when restarting the device, from there, I will see how I can work around the issue (for sure I cannot fix the low level client or ESPhome itself :) )

edit: I think the best is to deactivate the auto-reconnect behaviour of the low level client, and handle it on my side. So for sure the low level client is systematicaly renewed from ground up. And we will never have any "unclean" issue anymore.

@RoadXY
Copy link
Collaborator Author

RoadXY commented Sep 8, 2023

@RoadXY Finaly, if your device is correctly connected to homey, and then you restart your device itself (do not touch the app), does it reconnect autoamtically (and correctly) ?

I will try that, never tried that. P.s. HomeAssistant is always connected to 'slimmelezer' and never fails. This is the only device of the 5 devices I have, which keeps failing.

I think we can consider that the low level client I use has a problem, when losing connection to Slimmezer (DSMR component), it become "unclean", and so further reconnection fail. Recconnection is working smoothly on my own devices. So it seems very particular with DSMR component.

Please test reconnection when restarting the device, from there, I will see how I can work around the issue (for sure I cannot fix the low level client or ESPhome itself :) )

edit: I think the best is to deactivate the auto-reconnect behaviour of the low level client, and handle it on my side. So for sure the low level client is systematically renewed from ground up. And we will never have any "unclean" issue anymore.

My 'lagestaandelamp' always reconnects if I plug it back in the wall!
Also when I upgrade the firmware of all of my devices, it all just works and Homey reconnects without any issue.
It's only this 'slimmelezer' which is freaking out after a set period of time...

Baldhor added a commit that referenced this issue Sep 8, 2023
Baldhor added a commit that referenced this issue Sep 8, 2023
Changelog: Testing fix for #35: reconnection is now handled at high level client, not low level
@Baldhor
Copy link
Owner

Baldhor commented Sep 8, 2023

@RoadXY Reconnection has been recoded at high level client
I tested restarting several times my devices, and it seems to work out as usual for me.
I published a test version: https://homey.app/fr-fr/app/nl.inversion.esphome/ESPhome/test/

Please let us know if it works, so I can ask certification!

image

@RoadXY
Copy link
Collaborator Author

RoadXY commented Sep 8, 2023

I've just installed this test version as well as I'm keeping an eye on the log on the ESPHome device to see if I can catch something.

@Baldhor
Copy link
Owner

Baldhor commented Sep 10, 2023

@RoadXY Fixed a null pointer exception, can you update to newest test version?
https://homey.app/fr-fr/app/nl.inversion.esphome/ESPhome/test/

This bug apply only when a device is deleted, so it's not directly related to slimmezer issue.
Any news about slimmezer ?

@RoadXY
Copy link
Collaborator Author

RoadXY commented Sep 11, 2023

I've re-added the device, just to make sure.
Let's wait and see...

@Baldhor
Copy link
Owner

Baldhor commented Sep 11, 2023

I still published the version, seems stable enough and I don't think we will go backward :)

@RoadXY
Copy link
Collaborator Author

RoadXY commented Sep 12, 2023

Haven't been going offline though!
So there is some progress 👌

@Baldhor
Copy link
Owner

Baldhor commented Sep 12, 2023

@RoadXY Can you check what happen if you configure different names?
Both are named "Voltage fase 3" in your screenshot!

And please open separate issue :)

edit: I was sure I implemented "unique names", but maybe I forgot :)

@Baldhor
Copy link
Owner

Baldhor commented Sep 12, 2023

In the devices' settings, all titles of the same capability are the same however I'm 100% positive I had different descriptions for each fase

Just seen this, you mean you made different title, but the app "forgot" and just used the same title everywhere ... ?

@Baldhor
Copy link
Owner

Baldhor commented Sep 16, 2023

@RoadXY We consider it as solved?

@RoadXY
Copy link
Collaborator Author

RoadXY commented Sep 17, 2023

Yes, hasn't crashed anymore 👍

@RoadXY RoadXY closed this as completed Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants