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

Error POWERMAX_DSX on Line 57 - clage_homeserver.py #56

Closed
flyingdutchmen1 opened this issue Dec 31, 2022 · 10 comments
Closed

Error POWERMAX_DSX on Line 57 - clage_homeserver.py #56

flyingdutchmen1 opened this issue Dec 31, 2022 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@flyingdutchmen1
Copy link

Description

Hello,
i want to report an issue
using version 0.1.11 clage_homeserver pip module (used by Home Assistant Integration)
Clage DSX-Touch (set to 18KW)

HASS gives error on
File "/usr/local/lib/python3.10/site-packages/clage_homeserver/clage_homeserver.py", line 57, in mapApiStatusResponse
device_power = float(ClageHomeServer.POWERMAX_DSX.get(heater_status_powerMax)) # Geräteleistung in Watt, 140 => 21 kW, siehe Kapitel 4.9 in der API-Dokumentation

I have writed a smal python script to debug the issue
clage.py
from clage_homeserver import ClageHomeServer
clageHomeServer = ClageHomeServer('...','F8F00******','204******')
status = clageHomeServer.requestStatus() # Request the status
print(status)

getting error on clageHomeServer.requestStatus()
device_power = float(ClageHomeServer.POWERMAX_DSX.get(heater_status_powerMax)) # Geräteleistung in Watt, 140 => 21 kW, siehe Kapitel 4.9 in der API-Dokumentation
TypeError: float() argument must be a string or a number, not 'NoneType'
see relevant log output below

to debug this i have added
#57 print(heater_status_powerMax)
this shows: 120.0

thereafter i have added one line after POWERMAX_DSX =
#192:
POWERMAX_DSX = {
120: 18000,

then the issue was solved, and clageHomeServer.requestStatus() gives me the info:
{'homeserver_version': '1.4', 'homeserver_error': 'OK', 'homeserver_time': '2022-12-31 13:42:37', 'homeserver_success': True, 'homeserver_cached': True, 'heater_id': '204900C***', 'heater_busId': 1, 'heater_name': '', 'heater_connected': True, 'heater_signal': -48, 'heater_rssi': -68, 'heater_lqi': 0, 'heater_status_setpoint': 48.0, 'heater_status_tIn': 22.2, 'heater_status_tOut': 27.5, 'heater_status_tP1': 0.0, 'heater_status_tP2': 0.0, 'heater_status_tP3': 0.0, 'heater_status_tP4': 0.0, 'heater_status_flow': 0.0, 'heater_status_flowMax': 'ECO', 'heater_status_valvePos': 75, 'heater_status_valveFlags': 0, 'heater_status_power': 0.0, 'heater_status_powerMax': 120.0, 'heater_status_power100': 0.0, 'heater_status_fillingLeft': 0, 'heater_status_flags': 1, 'heater_status_sysFlags': 8, 'heater_status_error': 'OK'}

and clageHomeServer.requestSetup()
{'heater_setup_swVersion': '1.0.6', 'heater_setup_serialDevice': '521215-0*****', 'heater_setup_serialPowerUnit': '', 'heater_setup_flowMax': 25.3, 'heater_setup_loadShedding': (2.0,), 'heater_setup_scaldProtection': 0.0, 'heater_setup_sound': 1, 'heater_setup_fcpAddr': 0, 'heater_setup_powerCosts': 0.0, 'heater_setup_powerMax': 120.0, 'heater_setup_calValue': 2663.0, 'heater_setup_timerPowerOn': 3472.0, 'heater_setup_timerLifetime': 9193.0, 'heater_setup_timerStandby': 1301460.0}

regards,
Peter

Relevant log output

Traceback (most recent call last):
  File "D:\Workspace\myclage\clage.py", line 6, in <module>
    status  = clageHomeServer.requestStatus() # Request the status
  File "D:\Programs\Python\Python39\lib\site-packages\clage_homeserver\clage_homeserver.py", line 399, in requestStatus
    response = ClageHomeServerMapper().mapApiStatusResponse(status)
  File "D:\Programs\Python\Python39\lib\site-packages\clage_homeserver\clage_homeserver.py", line 57, in mapApiStatusResponse
    device_power = float(ClageHomeServer.POWERMAX_DSX.get(heater_status_powerMax))    # Geräteleistung in Watt, 140 => 21 kW, siehe Kapitel 4.9 in der API-Dokumentation
TypeError: float() argument must be a string or a number, not 'NoneType'
@flyingdutchmen1 flyingdutchmen1 added the bug Something isn't working label Dec 31, 2022
@klacol
Copy link
Owner

klacol commented Dec 31, 2022

Thanks, I will look into this the next days. Happy New Year.

@klacol
Copy link
Owner

klacol commented Jan 1, 2023

Hi Peter @flyingdutchmen1 ,

based on you test, it would be like so:

    POWERMAX_DSX = {
        120: 18000,
        140: 18000,
        160: 21000,
        180: 24000,
        200: 27000
    }

I do not understand, why the value 18000 (18 kW) is present two times. It seems to be more logical, to have the value 15000 (15 kW) for the code 120; like so:

    POWERMAX_DSX = {
        120: 15000,
        140: 18000,
        160: 21000,
        180: 24000,
        200: 27000
    }

Which device do you have? Can you please reconfirm, that 120 ist really 18 kW?

@flyingdutchmen1
Copy link
Author

Hi ,
below is the information from the device
Clage DSX Touch
Type: 5V-270P-3H
device is set at 18W
see pictures
DSC_1317
DSC_1318

from the API manual on page 26 they say:
Ermittlung der eingestellten Leistung bei DSX:
18kW: powerMax=(18/27)*180=120
21kW: powerMax=(21/27)*180=140
24kW: powerMax=(24/27)*180=160

@klacol
Copy link
Owner

klacol commented Jan 2, 2023

Ah, then this should be correct:

    POWERMAX_DSX = {
        120: 18000,
        140: 21000,
        160: 24000,
        180: 27000
    }

Will fix it accordingly.

klacol added a commit that referenced this issue Jan 4, 2023
@klacol
Copy link
Owner

klacol commented Jan 4, 2023

The fix is now published as clage-homeserver 0.1.12 package.

klacol added a commit to klacol/homeassistant-clage_homeserver that referenced this issue Jan 4, 2023
@klacol klacol closed this as completed Jan 4, 2023
@klacol
Copy link
Owner

klacol commented Jan 4, 2023

@flyingdutchmen1 : I have udated the python package to 0.1.12 and accordingly the reference in the manifest of the home assistant component. Please check, if it works for you. Thank you!!

klacol added a commit that referenced this issue Jan 4, 2023
klacol added a commit to klacol/homeassistant-clage_homeserver that referenced this issue Jan 4, 2023
@flyingdutchmen1
Copy link
Author

Hi
i have just upgrade the pip package to 0.1.12
and getting this error when running my test program
File "D:\Programs\Python\Python39\lib\site-packages\clage_homeserver\clage_homeserver.py", line 199
FLOWMAX = {
IndentationError: unexpected indent

@flyingdutchmen1
Copy link
Author

Hi i just see there was an update to 0.1.13

pip3 install clage-homeserver --upgrade
installing collected packages: clage-homeserver
Attempting uninstall: clage-homeserver
Found existing installation: clage-homeserver 0.1.12
Uninstalling clage-homeserver-0.1.12:
Successfully uninstalled clage-homeserver-0.1.12
Successfully installed clage-homeserver-0.1.13

it's working ok now with my testscript
D:\Workspace\myclage>python clage.py
{'homeserver_version': '1.4', 'homeserver_error': 'OK', 'homeserver_time': '2023-01-04 19:13:23', 'homeserver_success': True,

thx, il will test it in HASS later

@klacol klacol changed the title error on Line 57 - clage_homeserver.py Error POWERMAX_DSX on Line 57 - clage_homeserver.py Jan 4, 2023
@flyingdutchmen1
Copy link
Author

Hi,
i just tested it in HASS and it working great !

4-1-2023 20-19-49

@flyingdutchmen1
Copy link
Author

this also solves the issue from OsiMood on Aug 22
on
https://community.home-assistant.io/t/does-anymone-know-an-instantaneous-water-heater-that-can-be-controlled-via-home-assistant/335941

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