Closed asdt1803 closed 1 year ago
Hi, I've just a gas heating system to test :). But it should not be limited. Please try this:
from wemportal import WemPortalAPI
api = WemPortalAPI(username="user",password="password")
api.login()
api.get_devices()
print(api.devices)
api.get_values()
print(api.devices)
api.logout()
Best
Wow, that was a quick reply. :-)
[...]$ ./t2.py 2023-02-13 08:21:25,847 - DEBUG - Starting new HTTPS connection (1): www.wemportal.de:443 2023-02-13 08:21:26,085 - DEBUG - https://www.wemportal.de:443 "POST /app/Account/Login HTTP/1.1" 200 128 2023-02-13 08:21:26,086 - DEBUG - Fetching api device data 2023-02-13 08:21:26,317 - DEBUG - https://www.wemportal.de:443 "GET /app/device/Read HTTP/1.1" 200 62 [] 2023-02-13 08:21:26,317 - DEBUG - Refreshing and retrieving new values [] [...]$
Puh, it doesn't even get a list of devices from the API. Let's dig deeper:
import requests
session = requests.Session()
session.cookies.clear()
payload = {
"Name": "USERNAME",
"PasswordUTF8": "PASSWORD",
"AppID": "com.weishaupt.wemapp",
"AppVersion": "2.0.2",
"ClientOS": "Android",
}
response = session.post(
"https://www.wemportal.de/app/Account/Login",
data=payload,
)
response = session.get("https://www.wemportal.de/app/device/Read")
data = response.json()
print(data)
[...]$ ./t3.py {'Devices': [], 'Status': 0, 'Message': None, 'DetailMessages': None} [...]$
Mhm, could it be the API uses a different end point for Heat pumps? I use Hass-WEM-Portal in "web" mode and that works fine. Also the WEM Android App works fine for me.
Currently I'm only using the web for the statistics. But @erikkastelec was also interested in refactoring the code and using this separate library. Maybe we could work together and integrate all features from https://github.com/erikkastelec/hass-WEM-Portal here.
Thank you @erikkastelec and @floek, in principle it seems to work now. Unfortunately it does only provide data for one heating circuit ("Heizkreis 1" in my case). "Heizkreis 3" is not displayed. Is this something that could also be fixed?
Maybee you can try https://github.com/floek/wemportal/issues/1#issuecomment-1427459532 again and share the output?
This is the output from https://github.com/floek/wemportal/issues/1#issuecomment-1427459532:
2023-02-13 11:44:25,401 - DEBUG - Starting new HTTPS connection (1): www.wemportal.de:443 2023-02-13 11:44:25,578 - DEBUG - https://www.wemportal.de:443 "POST /app/Account/Login HTTP/1.1" 200 128 2023-02-13 11:44:25,580 - DEBUG - Fetching api device data 2023-02-13 11:44:25,755 - DEBUG - https://www.wemportal.de:443 "GET /app/device/Read HTTP/1.1" 200 812 2023-02-13 11:44:25,756 - DEBUG - Fetching api parameters data 2023-02-13 11:44:26,048 - DEBUG - https://www.wemportal.de:443 "POST /app/EventType/Read HTTP/1.1" 200 65 2023-02-13 11:44:26,048 - DEBUG - Fetching api parameters data 2023-02-13 11:44:26,343 - DEBUG - https://www.wemportal.de:443 "POST /app/EventType/Read HTTP/1.1" 200 65 2023-02-13 11:44:26,344 - DEBUG - Fetching api parameters data 2023-02-13 11:44:26,949 - DEBUG - https://www.wemportal.de:443 "POST /app/EventType/Read HTTP/1.1" 200 594 2023-02-13 11:44:26,950 - DEBUG - Fetching api parameters data 2023-02-13 11:44:27,218 - DEBUG - https://www.wemportal.de:443 "POST /app/EventType/Read HTTP/1.1" 200 2192 2023-02-13 11:44:27,220 - DEBUG - Fetching api parameters data 2023-02-13 11:44:27,511 - DEBUG - https://www.wemportal.de:443 "POST /app/EventType/Read HTTP/1.1" 200 3767 2023-02-13 11:44:27,512 - DEBUG - Fetching api parameters data 2023-02-13 11:44:27,748 - DEBUG - https://www.wemportal.de:443 "POST /app/EventType/Read HTTP/1.1" 200 3587 [WemDevice(id=5537, name='Heizung', device_type=<DeviceType.heating_pump: 2>, modules=[WemModule(index=1, custom_numbering=None, name='System ', type=<ModuleType.system: 1>, dynamisation=False, fwu_version='ecbiblock', parameters=[]), WemModule(index=1, custom_numbering=None, name='Test ', type=<ModuleType.test: 240>, dynamisation=False, fwu_version='ecbiblock', parameters=[]), WemModule(index=0, custom_numbering=None, name='Wärmeerzeuger ', type=<ModuleType.we: 7>, dynamisation=False, fwu_version='ecbiblock', parameters=[WemParameter(parameter_id='Außentemperatur', name='Außentemperatur', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None), WemParameter(parameter_id='Vorlauftemperatur', name='Vorlauftemperatur', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None), WemParameter(parameter_id='Leistung', name='Leistungsabgabe', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None)]), WemModule(index=1, custom_numbering=None, name='Warmwasser ', type=<ModuleType.hot_water_circuit: 3>, dynamisation=False, fwu_version='ecbiblock', parameters=[WemParameter(parameter_id='WW-Programm', name='WW-Programm', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Warmwassertemperatur', name='Warmwassertemperatur', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None), WemParameter(parameter_id='WW-Push', name='Nachladung', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=0, name='Aus'), EnumValue(value=5, name='5'), EnumValue(value=10, name='10'), EnumValue(value=15, name='15'), EnumValue(value=20, name='20'), EnumValue(value=25, name='25'), EnumValue(value=30, name='30'), EnumValue(value=35, name='35'), EnumValue(value=40, name='40'), EnumValue(value=45, name='45'), EnumValue(value=50, name='50'), EnumValue(value=55, name='55'), EnumValue(value=60, name='60'), EnumValue(value=65, name='65'), EnumValue(value=70, name='70'), EnumValue(value=75, name='75'), EnumValue(value=80, name='80'), EnumValue(value=85, name='85'), EnumValue(value=90, name='90'), EnumValue(value=95, name='95'), EnumValue(value=100, name='100'), EnumValue(value=105, name='105'), EnumValue(value=110, name='110'), EnumValue(value=115, name='115'), EnumValue(value=120, name='120'), EnumValue(value=125, name='125'), EnumValue(value=130, name='130'), EnumValue(value=135, name='135'), EnumValue(value=140, name='140'), EnumValue(value=145, name='145'), EnumValue(value=150, name='150'), EnumValue(value=155, name='155'), EnumValue(value=160, name='160'), EnumValue(value=165, name='165'), EnumValue(value=170, name='170'), EnumValue(value=175, name='175'), EnumValue(value=180, name='180'), EnumValue(value=185, name='185'), EnumValue(value=190, name='190'), EnumValue(value=195, name='195'), EnumValue(value=200, name='200'), EnumValue(value=205, name='205'), EnumValue(value=210, name='210'), EnumValue(value=215, name='215'), EnumValue(value=220, name='220'), EnumValue(value=225, name='225'), EnumValue(value=230, name='230'), EnumValue(value=235, name='235'), EnumValue(value=240, name='240')], value=None), WemParameter(parameter_id='NormalWW', name='WW Normal', data_type=<DataType.decimal_value: -1>, min_value=5.0, max_value=60.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='AbsenkWW', name='WW Absenk', data_type=<DataType.decimal_value: -1>, min_value=5.0, max_value=60.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None)]), WemModule(index=1, custom_numbering=1, name='Heizkreis 1', type=<ModuleType.heater_circuit: 2>, dynamisation=False, fwu_version='ecbiblock', parameters=[WemParameter(parameter_id='Heizprogramm1', name='Heizprogramm1', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='U_Beginn', name='U_Beginn', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='U_Ende', name='U_Ende', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Raumtemperatur', name='HK 1 Raumtemperatur', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None), WemParameter(parameter_id='AktRaumSoll', name='HK 1 Raumsoll', data_type=<DataType.decimal_value: -1>, min_value=18.0, max_value=28.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Komfort', name='HK1 Raum Komfort', data_type=<DataType.decimal_value: -1>, min_value=20.0, max_value=28.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Absenk', name='HK 1 Raum Absenk', data_type=<DataType.decimal_value: -1>, min_value=16.0, max_value=20.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Normal', name='HK 1 Raum Normal', data_type=<DataType.decimal_value: -1>, min_value=18.0, max_value=21.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Betriebsart', name='Systembetriebsart', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=1, name='Heizen'), EnumValue(value=3, name='Sommer'), EnumValue(value=4, name='Standby'), EnumValue(value=5, name='2. WEZ'), EnumValue(value=0, name='Automatik'), EnumValue(value=2, name='Kühlen')], value=None), WemParameter(parameter_id='PP_Funktion', name='Party/Pause', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=1, name='Pausenzeit 12.0 h'), EnumValue(value=2, name='Pausenzeit 11.5 h'), EnumValue(value=3, name='Pausenzeit 11.0 h'), EnumValue(value=4, name='Pausenzeit 10.5 h'), EnumValue(value=5, name='Pausenzeit 10.0 h'), EnumValue(value=6, name='Pausenzeit 9.5 h'), EnumValue(value=7, name='Pausenzeit 9.0 h'), EnumValue(value=8, name='Pausenzeit 8.5 h'), EnumValue(value=9, name='Pausenzeit 8.0 h'), EnumValue(value=10, name='Pausenzeit 7.5 h'), EnumValue(value=11, name='Pausenzeit 7.0 h'), EnumValue(value=12, name='Pausenzeit 6.5 h'), EnumValue(value=13, name='Pausenzeit 6.0 h'), EnumValue(value=14, name='Pausenzeit 5.5 h'), EnumValue(value=15, name='Pausenzeit 5.0 h'), EnumValue(value=16, name='Pausenzeit 4.5 h'), EnumValue(value=17, name='Pausenzeit 4.0 h'), EnumValue(value=18, name='Pausenzeit 3.5 h'), EnumValue(value=19, name='Pausenzeit 3.0 h'), EnumValue(value=20, name='Pausenzeit 2.5 h'), EnumValue(value=21, name='Pausenzeit 2.0 h'), EnumValue(value=22, name='Pausenzeit 1.5 h'), EnumValue(value=23, name='Pausenzeit 1.0 h'), EnumValue(value=24, name='Pausenzeit 0.5 h'), EnumValue(value=25, name='Automatik'), EnumValue(value=26, name='Party 0.5 h'), EnumValue(value=27, name='Party 1.0 h'), EnumValue(value=28, name='Party 1.5 h'), EnumValue(value=29, name='Party 2.0 h'), EnumValue(value=30, name='Party 2.5 h'), EnumValue(value=31, name='Party 3.0 h'), EnumValue(value=32, name='Party 3.5 h'), EnumValue(value=33, name='Party 4.0 h'), EnumValue(value=34, name='Party 4.5 h'), EnumValue(value=35, name='Party 5.0 h'), EnumValue(value=36, name='Party 5.5 h'), EnumValue(value=37, name='Party 6.0 h'), EnumValue(value=38, name='Party 6.5 h'), EnumValue(value=39, name='Party 7.0 h'), EnumValue(value=40, name='Party 7.5 h'), EnumValue(value=41, name='Party 8.0 h'), EnumValue(value=42, name='Party 8.5 h'), EnumValue(value=43, name='Party 9.0 h'), EnumValue(value=44, name='Party 9.5 h'), EnumValue(value=45, name='Party 10.0 h'), EnumValue(value=46, name='Party 10.5 h'), EnumValue(value=47, name='Party 11.0 h'), EnumValue(value=48, name='Party 11.5 h'), EnumValue(value=49, name='Party 12.0 h')], value=None)]), WemModule(index=3, custom_numbering=3, name='Heizkreis 3', type=<ModuleType.heater_circuit: 2>, dynamisation=False, fwu_version='ecbiblock', parameters=[WemParameter(parameter_id='Heizprogramm1', name='Heizprogramm1', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='U_Beginn', name='U_Beginn', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='U_Ende', name='U_Ende', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='AktRaumSoll', name='HK 3 Raumsoll', data_type=<DataType.decimal_value: -1>, min_value=18.0, max_value=28.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Komfort', name='HK3 Raum Komfort', data_type=<DataType.decimal_value: -1>, min_value=23.0, max_value=28.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Absenk', name='HK 3 Raum Absenk', data_type=<DataType.decimal_value: -1>, min_value=16.0, max_value=23.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Normal', name='HK 3 Raum Normal', data_type=<DataType.decimal_value: -1>, min_value=18.0, max_value=24.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Betriebsart', name='Systembetriebsart', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=1, name='Heizen'), EnumValue(value=3, name='Sommer'), EnumValue(value=4, name='Standby'), EnumValue(value=5, name='2. WEZ'), EnumValue(value=0, name='Automatik'), EnumValue(value=2, name='Kühlen')], value=None), WemParameter(parameter_id='PP_Funktion', name='Party/Pause', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=1, name='Pausenzeit 12.0 h'), EnumValue(value=2, name='Pausenzeit 11.5 h'), EnumValue(value=3, name='Pausenzeit 11.0 h'), EnumValue(value=4, name='Pausenzeit 10.5 h'), EnumValue(value=5, name='Pausenzeit 10.0 h'), EnumValue(value=6, name='Pausenzeit 9.5 h'), EnumValue(value=7, name='Pausenzeit 9.0 h'), EnumValue(value=8, name='Pausenzeit 8.5 h'), EnumValue(value=9, name='Pausenzeit 8.0 h'), EnumValue(value=10, name='Pausenzeit 7.5 h'), EnumValue(value=11, name='Pausenzeit 7.0 h'), EnumValue(value=12, name='Pausenzeit 6.5 h'), EnumValue(value=13, name='Pausenzeit 6.0 h'), EnumValue(value=14, name='Pausenzeit 5.5 h'), EnumValue(value=15, name='Pausenzeit 5.0 h'), EnumValue(value=16, name='Pausenzeit 4.5 h'), EnumValue(value=17, name='Pausenzeit 4.0 h'), EnumValue(value=18, name='Pausenzeit 3.5 h'), EnumValue(value=19, name='Pausenzeit 3.0 h'), EnumValue(value=20, name='Pausenzeit 2.5 h'), EnumValue(value=21, name='Pausenzeit 2.0 h'), EnumValue(value=22, name='Pausenzeit 1.5 h'), EnumValue(value=23, name='Pausenzeit 1.0 h'), EnumValue(value=24, name='Pausenzeit 0.5 h'), EnumValue(value=25, name='Automatik'), EnumValue(value=26, name='Party 0.5 h'), EnumValue(value=27, name='Party 1.0 h'), EnumValue(value=28, name='Party 1.5 h'), EnumValue(value=29, name='Party 2.0 h'), EnumValue(value=30, name='Party 2.5 h'), EnumValue(value=31, name='Party 3.0 h'), EnumValue(value=32, name='Party 3.5 h'), EnumValue(value=33, name='Party 4.0 h'), EnumValue(value=34, name='Party 4.5 h'), EnumValue(value=35, name='Party 5.0 h'), EnumValue(value=36, name='Party 5.5 h'), EnumValue(value=37, name='Party 6.0 h'), EnumValue(value=38, name='Party 6.5 h'), EnumValue(value=39, name='Party 7.0 h'), EnumValue(value=40, name='Party 7.5 h'), EnumValue(value=41, name='Party 8.0 h'), EnumValue(value=42, name='Party 8.5 h'), EnumValue(value=43, name='Party 9.0 h'), EnumValue(value=44, name='Party 9.5 h'), EnumValue(value=45, name='Party 10.0 h'), EnumValue(value=46, name='Party 10.5 h'), EnumValue(value=47, name='Party 11.0 h'), EnumValue(value=48, name='Party 11.5 h'), EnumValue(value=49, name='Party 12.0 h')], value=None)])], connection_status=<ConnectionStatus.connected: 0>, has_errors=False, heating_statistic=None, hot_water_statistic=None)] 2023-02-13 11:44:27,750 - DEBUG - Refreshing and retrieving new values 2023-02-13 11:44:28,461 - DEBUG - https://www.wemportal.de:443 "POST /app/DataAccess/Refresh HTTP/1.1" 200 82 2023-02-13 11:44:28,908 - DEBUG - https://www.wemportal.de:443 "POST /app/DataAccess/Read HTTP/1.1" 200 3160 [WemDevice(id=5537, name='Heizung', device_type=<DeviceType.heating_pump: 2>, modules=[WemModule(index=1, custom_numbering=None, name='System ', type=<ModuleType.system: 1>, dynamisation=False, fwu_version='ecbiblock', parameters=[]), WemModule(index=1, custom_numbering=None, name='Test ', type=<ModuleType.test: 240>, dynamisation=False, fwu_version='ecbiblock', parameters=[]), WemModule(index=0, custom_numbering=None, name='Wärmeerzeuger ', type=<ModuleType.we: 7>, dynamisation=False, fwu_version='ecbiblock', parameters=[WemParameter(parameter_id='Außentemperatur', name='Außentemperatur', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None), WemParameter(parameter_id='Vorlauftemperatur', name='Vorlauftemperatur', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None), WemParameter(parameter_id='Leistung', name='Leistungsabgabe', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None)]), WemModule(index=1, custom_numbering=None, name='Warmwasser ', type=<ModuleType.hot_water_circuit: 3>, dynamisation=False, fwu_version='ecbiblock', parameters=[WemParameter(parameter_id='WW-Programm', name='WW-Programm', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Warmwassertemperatur', name='Warmwassertemperatur', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None), WemParameter(parameter_id='WW-Push', name='Nachladung', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=0, name='Aus'), EnumValue(value=5, name='5'), EnumValue(value=10, name='10'), EnumValue(value=15, name='15'), EnumValue(value=20, name='20'), EnumValue(value=25, name='25'), EnumValue(value=30, name='30'), EnumValue(value=35, name='35'), EnumValue(value=40, name='40'), EnumValue(value=45, name='45'), EnumValue(value=50, name='50'), EnumValue(value=55, name='55'), EnumValue(value=60, name='60'), EnumValue(value=65, name='65'), EnumValue(value=70, name='70'), EnumValue(value=75, name='75'), EnumValue(value=80, name='80'), EnumValue(value=85, name='85'), EnumValue(value=90, name='90'), EnumValue(value=95, name='95'), EnumValue(value=100, name='100'), EnumValue(value=105, name='105'), EnumValue(value=110, name='110'), EnumValue(value=115, name='115'), EnumValue(value=120, name='120'), EnumValue(value=125, name='125'), EnumValue(value=130, name='130'), EnumValue(value=135, name='135'), EnumValue(value=140, name='140'), EnumValue(value=145, name='145'), EnumValue(value=150, name='150'), EnumValue(value=155, name='155'), EnumValue(value=160, name='160'), EnumValue(value=165, name='165'), EnumValue(value=170, name='170'), EnumValue(value=175, name='175'), EnumValue(value=180, name='180'), EnumValue(value=185, name='185'), EnumValue(value=190, name='190'), EnumValue(value=195, name='195'), EnumValue(value=200, name='200'), EnumValue(value=205, name='205'), EnumValue(value=210, name='210'), EnumValue(value=215, name='215'), EnumValue(value=220, name='220'), EnumValue(value=225, name='225'), EnumValue(value=230, name='230'), EnumValue(value=235, name='235'), EnumValue(value=240, name='240')], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 43, 22), numeric_value=0.0, string_value='Aus', dynamisation=False, parameter_id='WW-Push')), WemParameter(parameter_id='NormalWW', name='WW Normal', data_type=<DataType.decimal_value: -1>, min_value=5.0, max_value=60.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='AbsenkWW', name='WW Absenk', data_type=<DataType.decimal_value: -1>, min_value=5.0, max_value=60.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None)]), WemModule(index=1, custom_numbering=1, name='Heizkreis 1', type=<ModuleType.heater_circuit: 2>, dynamisation=False, fwu_version='ecbiblock', parameters=[WemParameter(parameter_id='Heizprogramm1', name='Heizprogramm1', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 34, 26), numeric_value=None, string_value='{"MO-1":"06:00-22:00","MO-2":"00:00-00:00","MO-3":"00:00-00:00","DI-1":"06:00-22:00","DI-2":"00:00-00:00","DI-3":"00:00-00:00","MI-1":"06:00-22:00","MI-2":"00:00-00:00","MI-3":"00:00-00:00","DO-1":"06:00-22:00","DO-2":"00:00-00:00","DO-3":"00:00-00:00","FR-1":"06:00-22:00","FR-2":"00:00-00:00","FR-3":"00:00-00:00","SA-1":"06:00-22:00","SA-2":"00:00-00:00","SA-3":"00:00-00:00","SO-1":"06:00-22:00","SO-2":"00:00-00:00","SO-3":"00:00-00:00","MO":"HHH","DI":"HHH","MI":"HHH","DO":"HHH","FR":"HHH","SA":"HHH","SO":"HHH","zone":"1","type":"Functionlist","TransferId":"3FA0A76C","mode":"cycletime","cmd":"load","status":"ok"}', dynamisation=False, parameter_id='Heizprogramm1')), WemParameter(parameter_id='U_Beginn', name='U_Beginn', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='U_Ende', name='U_Ende', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Raumtemperatur', name='HK 1 Raumtemperatur', data_type=<DataType.decimal_value: -1>, min_value=0.0, max_value=0.0, default_value='', is_readable=True, is_writeable=False, enum_values=[], value=None), WemParameter(parameter_id='AktRaumSoll', name='HK 1 Raumsoll', data_type=<DataType.decimal_value: -1>, min_value=18.0, max_value=28.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Komfort', name='HK1 Raum Komfort', data_type=<DataType.decimal_value: -1>, min_value=20.0, max_value=28.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Absenk', name='HK 1 Raum Absenk', data_type=<DataType.decimal_value: -1>, min_value=16.0, max_value=20.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='Normal', name='HK 1 Raum Normal', data_type=<DataType.decimal_value: -1>, min_value=18.0, max_value=21.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 35, 10), numeric_value=17.0, string_value='Label ist null', dynamisation=False, parameter_id='Normal')), WemParameter(parameter_id='Betriebsart', name='Systembetriebsart', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=1, name='Heizen'), EnumValue(value=3, name='Sommer'), EnumValue(value=4, name='Standby'), EnumValue(value=5, name='2. WEZ'), EnumValue(value=0, name='Automatik'), EnumValue(value=2, name='Kühlen')], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 43, 23), numeric_value=0.0, string_value='Automatik', dynamisation=False, parameter_id='Betriebsart')), WemParameter(parameter_id='PP_Funktion', name='Party/Pause', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=1, name='Pausenzeit 12.0 h'), EnumValue(value=2, name='Pausenzeit 11.5 h'), EnumValue(value=3, name='Pausenzeit 11.0 h'), EnumValue(value=4, name='Pausenzeit 10.5 h'), EnumValue(value=5, name='Pausenzeit 10.0 h'), EnumValue(value=6, name='Pausenzeit 9.5 h'), EnumValue(value=7, name='Pausenzeit 9.0 h'), EnumValue(value=8, name='Pausenzeit 8.5 h'), EnumValue(value=9, name='Pausenzeit 8.0 h'), EnumValue(value=10, name='Pausenzeit 7.5 h'), EnumValue(value=11, name='Pausenzeit 7.0 h'), EnumValue(value=12, name='Pausenzeit 6.5 h'), EnumValue(value=13, name='Pausenzeit 6.0 h'), EnumValue(value=14, name='Pausenzeit 5.5 h'), EnumValue(value=15, name='Pausenzeit 5.0 h'), EnumValue(value=16, name='Pausenzeit 4.5 h'), EnumValue(value=17, name='Pausenzeit 4.0 h'), EnumValue(value=18, name='Pausenzeit 3.5 h'), EnumValue(value=19, name='Pausenzeit 3.0 h'), EnumValue(value=20, name='Pausenzeit 2.5 h'), EnumValue(value=21, name='Pausenzeit 2.0 h'), EnumValue(value=22, name='Pausenzeit 1.5 h'), EnumValue(value=23, name='Pausenzeit 1.0 h'), EnumValue(value=24, name='Pausenzeit 0.5 h'), EnumValue(value=25, name='Automatik'), EnumValue(value=26, name='Party 0.5 h'), EnumValue(value=27, name='Party 1.0 h'), EnumValue(value=28, name='Party 1.5 h'), EnumValue(value=29, name='Party 2.0 h'), EnumValue(value=30, name='Party 2.5 h'), EnumValue(value=31, name='Party 3.0 h'), EnumValue(value=32, name='Party 3.5 h'), EnumValue(value=33, name='Party 4.0 h'), EnumValue(value=34, name='Party 4.5 h'), EnumValue(value=35, name='Party 5.0 h'), EnumValue(value=36, name='Party 5.5 h'), EnumValue(value=37, name='Party 6.0 h'), EnumValue(value=38, name='Party 6.5 h'), EnumValue(value=39, name='Party 7.0 h'), EnumValue(value=40, name='Party 7.5 h'), EnumValue(value=41, name='Party 8.0 h'), EnumValue(value=42, name='Party 8.5 h'), EnumValue(value=43, name='Party 9.0 h'), EnumValue(value=44, name='Party 9.5 h'), EnumValue(value=45, name='Party 10.0 h'), EnumValue(value=46, name='Party 10.5 h'), EnumValue(value=47, name='Party 11.0 h'), EnumValue(value=48, name='Party 11.5 h'), EnumValue(value=49, name='Party 12.0 h')], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 43, 29), numeric_value=25.0, string_value='Automatik', dynamisation=False, parameter_id='PP_Funktion'))]), WemModule(index=3, custom_numbering=3, name='Heizkreis 3', type=<ModuleType.heater_circuit: 2>, dynamisation=False, fwu_version='ecbiblock', parameters=[WemParameter(parameter_id='Heizprogramm1', name='Heizprogramm1', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 35, 8), numeric_value=None, string_value='{"MO-1":"00:00-24:00","MO-2":"00:00-00:00","MO-3":"00:00-00:00","DI-1":"00:00-24:00","DI-2":"00:00-00:00","DI-3":"00:00-00:00","MI-1":"00:00-24:00","MI-2":"00:00-00:00","MI-3":"00:00-00:00","DO-1":"00:00-24:00","DO-2":"00:00-00:00","DO-3":"00:00-00:00","FR-1":"00:00-24:00","FR-2":"00:00-00:00","FR-3":"00:00-00:00","SA-1":"00:00-24:00","SA-2":"00:00-00:00","SA-3":"00:00-00:00","SO-1":"00:00-24:00","SO-2":"00:00-00:00","SO-3":"00:00-00:00","MO":"HHH","DI":"HHH","MI":"HHH","DO":"HHH","FR":"HHH","SA":"HHH","SO":"HHH","zone":"3","type":"Functionlist","TransferId":"3FA0AC00","mode":"cycletime","cmd":"load","status":"ok"}', dynamisation=False, parameter_id='Heizprogramm1')), WemParameter(parameter_id='U_Beginn', name='U_Beginn', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='U_Ende', name='U_Ende', data_type=<DataType.time: 2>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=None), WemParameter(parameter_id='AktRaumSoll', name='HK 3 Raumsoll', data_type=<DataType.decimal_value: -1>, min_value=18.0, max_value=28.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=WemValue(unit='°C', time=datetime.datetime(2023, 2, 13, 11, 35, 10), numeric_value=20.0, string_value='Label ist null', dynamisation=False, parameter_id='AktRaumSoll')), WemParameter(parameter_id='Komfort', name='HK3 Raum Komfort', data_type=<DataType.decimal_value: -1>, min_value=23.0, max_value=28.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 35, 5), numeric_value=20.0, string_value='Label ist null', dynamisation=False, parameter_id='Komfort')), WemParameter(parameter_id='Absenk', name='HK 3 Raum Absenk', data_type=<DataType.decimal_value: -1>, min_value=16.0, max_value=23.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 35, 5), numeric_value=18.0, string_value='Label ist null', dynamisation=False, parameter_id='Absenk')), WemParameter(parameter_id='Normal', name='HK 3 Raum Normal', data_type=<DataType.decimal_value: -1>, min_value=18.0, max_value=24.0, default_value='', is_readable=True, is_writeable=True, enum_values=[], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 35, 5), numeric_value=19.0, string_value='Label ist null', dynamisation=False, parameter_id='Normal')), WemParameter(parameter_id='Betriebsart', name='Systembetriebsart', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=1, name='Heizen'), EnumValue(value=3, name='Sommer'), EnumValue(value=4, name='Standby'), EnumValue(value=5, name='2. WEZ'), EnumValue(value=0, name='Automatik'), EnumValue(value=2, name='Kühlen')], value=None), WemParameter(parameter_id='PP_Funktion', name='Party/Pause', data_type=<DataType.function: 1>, min_value=None, max_value=None, default_value='', is_readable=True, is_writeable=True, enum_values=[EnumValue(value=1, name='Pausenzeit 12.0 h'), EnumValue(value=2, name='Pausenzeit 11.5 h'), EnumValue(value=3, name='Pausenzeit 11.0 h'), EnumValue(value=4, name='Pausenzeit 10.5 h'), EnumValue(value=5, name='Pausenzeit 10.0 h'), EnumValue(value=6, name='Pausenzeit 9.5 h'), EnumValue(value=7, name='Pausenzeit 9.0 h'), EnumValue(value=8, name='Pausenzeit 8.5 h'), EnumValue(value=9, name='Pausenzeit 8.0 h'), EnumValue(value=10, name='Pausenzeit 7.5 h'), EnumValue(value=11, name='Pausenzeit 7.0 h'), EnumValue(value=12, name='Pausenzeit 6.5 h'), EnumValue(value=13, name='Pausenzeit 6.0 h'), EnumValue(value=14, name='Pausenzeit 5.5 h'), EnumValue(value=15, name='Pausenzeit 5.0 h'), EnumValue(value=16, name='Pausenzeit 4.5 h'), EnumValue(value=17, name='Pausenzeit 4.0 h'), EnumValue(value=18, name='Pausenzeit 3.5 h'), EnumValue(value=19, name='Pausenzeit 3.0 h'), EnumValue(value=20, name='Pausenzeit 2.5 h'), EnumValue(value=21, name='Pausenzeit 2.0 h'), EnumValue(value=22, name='Pausenzeit 1.5 h'), EnumValue(value=23, name='Pausenzeit 1.0 h'), EnumValue(value=24, name='Pausenzeit 0.5 h'), EnumValue(value=25, name='Automatik'), EnumValue(value=26, name='Party 0.5 h'), EnumValue(value=27, name='Party 1.0 h'), EnumValue(value=28, name='Party 1.5 h'), EnumValue(value=29, name='Party 2.0 h'), EnumValue(value=30, name='Party 2.5 h'), EnumValue(value=31, name='Party 3.0 h'), EnumValue(value=32, name='Party 3.5 h'), EnumValue(value=33, name='Party 4.0 h'), EnumValue(value=34, name='Party 4.5 h'), EnumValue(value=35, name='Party 5.0 h'), EnumValue(value=36, name='Party 5.5 h'), EnumValue(value=37, name='Party 6.0 h'), EnumValue(value=38, name='Party 6.5 h'), EnumValue(value=39, name='Party 7.0 h'), EnumValue(value=40, name='Party 7.5 h'), EnumValue(value=41, name='Party 8.0 h'), EnumValue(value=42, name='Party 8.5 h'), EnumValue(value=43, name='Party 9.0 h'), EnumValue(value=44, name='Party 9.5 h'), EnumValue(value=45, name='Party 10.0 h'), EnumValue(value=46, name='Party 10.5 h'), EnumValue(value=47, name='Party 11.0 h'), EnumValue(value=48, name='Party 11.5 h'), EnumValue(value=49, name='Party 12.0 h')], value=WemValue(unit='', time=datetime.datetime(2023, 2, 13, 11, 43, 30), numeric_value=25.0, string_value='Automatik', dynamisation=False, parameter_id='PP_Funktion'))])], connection_status=<ConnectionStatus.connected: 0>, has_errors=False, heating_statistic=None, hot_water_statistic=None)]
Doesn't look too bad. Heizkreis 3 is there with values. Maybe it's just not printed in the example code? Please experiment with something like that:
from wemportal.wem_portal import WemPortal
# Create API object
api = WemPortal(
username="<WEM Portal Username>",
password="<WEM Portal Password>"
)
# Fetch data
api.login()
devices = api.fetch_devices()
api.logout()
# Print values
for device in devices:
print(f"== Device {device.name} ==\n")
print("Values:")
for data in device.get_parameter_values():
print(f"\t{data['ModuleName']}/{data['ParameterId']}: {data['ValueNumericValue']} {data['ValueUnit']}")
You can also print the output of device.get_parameter_values()
(e.g. in json/yaml) and inspect, if Heizkreis 3 is there.
Best, floek
Perfect, thank you for your help and patience.
I'm glad to see the project in use ;). closing.
Hi,
I'm currently using a stripped version of https://github.com/erikkastelec/hass-WEM-Portal and would like to switch to your module. Just like you I don't use Home Assistant and push the data to influxdb/grafana.
Unfortunately the module does not return any data for my Heat pump. I used the example from the Readme.md without any modification (apart from username and passord):
[...]$ ./wemportal-test.py 2023-02-13 07:50:28,444 - DEBUG - Starting new HTTPS connection (1): www.wemportal.de:443 2023-02-13 07:50:28,612 - DEBUG - https://www.wemportal.de:443 "POST /app/Account/Login HTTP/1.1" 200 128 2023-02-13 07:50:28,613 - DEBUG - Login to wemportal 2023-02-13 07:50:28,615 - DEBUG - Starting new HTTPS connection (1): www.wemportal.de:443 2023-02-13 07:50:28,797 - DEBUG - https://www.wemportal.de:443 "GET /Web/Login.aspx HTTP/1.1" 302 162 2023-02-13 07:50:28,873 - DEBUG - https://www.wemportal.de:443 "GET /Web/Login.aspx?AspxAutoDetectCookieSupport=1 HTTP/1.1" 200 25980 2023-02-13 07:50:29,169 - DEBUG - https://www.wemportal.de:443 "POST /Web/Login.aspx HTTP/1.1" 302 134 2023-02-13 07:50:29,622 - DEBUG - https://www.wemportal.de:443 "GET /Web/Default.aspx HTTP/1.1" 200 150830 2023-02-13 07:50:29,671 - DEBUG - Fetching api device data 2023-02-13 07:50:29,841 - DEBUG - https://www.wemportal.de:443 "GET /app/device/Read HTTP/1.1" 200 62 2023-02-13 07:50:29,841 - DEBUG - Refreshing and retrieving new values [...]$
Is the mdoule limited to a specific type of heating systems?
Best regards Andre