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

[Errno 107] Socket not connected #202

Open
Crashman1983 opened this issue Nov 20, 2023 · 3 comments
Open

[Errno 107] Socket not connected #202

Crashman1983 opened this issue Nov 20, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Crashman1983
Copy link
Contributor

This happened a few times since I started to use the new version of Luxtronik. Have not seen this before. It results on complete loss of all entities (unavailable) until I restart HA.

Logger: custom_components.luxtronik2
Source: custom_components/luxtronik2/lux_helper.py:157
Integration: Luxtronik
First occurred: 14:58:47 (841 occurrences)
Last logged: 17:18:47

Unexpected exception when checking if a socket is closed
Traceback (most recent call last):
File "/config/custom_components/luxtronik2/lux_helper.py", line 157, in _is_socket_closed
data = sock.recv(16, socket.MSG_DONTWAIT | socket.MSG_PEEK)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 107] Socket not connected

@BenPru BenPru self-assigned this Nov 20, 2023
@BenPru BenPru added the bug Something isn't working label Nov 20, 2023
BenPru added a commit that referenced this issue Nov 20, 2023
@BenPru
Copy link
Owner

BenPru commented Nov 20, 2023

@Crashman1983 I have added a handling in the main branch.
Please try the main branch.

@Crashman1983
Copy link
Contributor Author

Hi!

i installed the main branch yesterday. I got another Error today, but your fix seems to be successful in terms of keeping the integration running.

But is it possible, that the integration sends incorrect values for heat amount when this error occurs? I am using a template sensor to add dhw_heat_amound and heat_amount_heating to heat_amount_total.

  - unique_id: luxtronik_heat_amount_total
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing
    availability: >
      {{ states('sensor.luxtronik_310312_0495_heat_amount_heating') not in [ unknown, unavailable, none ] and
           states('sensor.luxtronik_310312_0495_dhw_heat_amount') not in [ unknown, unavailable, none ] }}
    state: >
      {% set t = states('sensor.luxtronik_310312_0495_heat_amount_heating') | float %}
      {% set u = states('sensor.luxtronik_310312_0495_dhw_heat_amount') | float %}
      {{ (t+u) | round(1) }}

Whenever this happens, the template sensor jumps to zero, and after restart of the integration, the new template_sensor value is slightly lower, than before. I cannot explain that behavior.

image

What I can see is a kind of peak in heat_amount_heating, that I can't explain as well.

image

@BenPru
Copy link
Owner

BenPru commented Nov 26, 2023

If the values could not updated, e.g. network error, the sensor values should become the "unavailable" state.
But I think this is a bigger change. E.g. in a future release.

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