-
Notifications
You must be signed in to change notification settings - Fork 10
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
ITec missing operational status #14
Comments
@oskari, you observe that COMP_STATUS_ITEC is 19. This value is a binary number: 19 = 16 + 2 + 1, which means that: 1: COMP_VALUE_COMPR is on, i.e. the compressor is running. So, this looks like normal behaviour. |
But I don't think this library is currently reading it as so? I was expecting |
@oskari Seems that your heat pump has a different compressor status register name than others, which is why the compressor status for you is Thanks for the heads up, I will add support for your heat pump with the next release. |
@klejejs Great, thanks! Is there anything else I could provide? Do you want the full debug.txt for this unit? It's an 2017 Thermia iTec |
@oskari No, thanks! This is enough data for me unless there are any other values that you don't see and want to have in the API. |
I believe this is the same for mine, which is an Atlas 18, even though im not sure if this is available. I dont believe i can see the data OP screenshoted, fx if the compressor is running in the dashboard. Although i do see the Operational Status (Heating) which is why i guess its the same? Using the genesis api:
|
@Gjorret I assume you already see this data in
|
The latest |
Running
|
|
@Gjorret Do you see available operational statuses with the new version? |
@oskari Sorry I made a mapping mistake. The new |
Updated to
@klejejs If there's any debug or api data I can provide, just let me know! |
Here's a debug.txt with deviceId and name removed: debug.txt |
@oskari Thanks for the debug file. It is hard for me to test something that I personally do not see, so excuse me for many iterations. Can you please try version |
@klejejs It's okay, that's why I'm asking if you need anything more :) If you want, I can get you the json api responses from thermia online if it helps?
|
@oskari Thanks, I think I have everything, it's just that with these functions that I cannot test, I start making stupid mistakes. I should find time and write unit tests to ensure everything works correctly. |
|
@oskari Version |
Great! Looks a lot more better now:
|
Many years ago every byte used in a computer was valuable so you tried to squeeze as much information in every byte as possible. I was surprised to see that this technique was still used in this interface. Sorry for the confusing explanation of the binary value.
The code that I use is:
...
mode = heat_pump.get_register_data_by_register_group_and_name("REG_GROUP_OPERATIONAL_STATUS", "COMP_STATUS")["value"]
mode = mode & 0b111001
if mode == 8: heat pump_mode = "cooling"
elif mode == 9: heat pump_mode = "pool"
elif mode == 17: heat pump_mode = "hot water"
elif mode == 33: heat pump_mode = "heating"
elif heat pump_mode = "off"
....
The statement "mode = mode & 0b111001" gets rid of bit numbers 1 and 2 (bit counting starts at zero), for my heat pump these refer to the radiator pump and the brine pump. I'm not particularly interested in those.
If you just want to know if the compressor (bit 0, "COMPR") is running you would use: mode = mode & 0b000001.
A few things:
in my case bit 5 (value 16) refers to hot water. I sometimes observe mode is 16 and sometimes mode is 17: 17 means that the compressor is actually switched on and and water is heated; 16 means that the compressor has not been switched on yet: the brine pump needs to run for a while and once it is switched on, the state will change to 17. Same happens for heating and pool heating.
the bits have different meanings in different heat pumps, In my case HOT_WATER is 16; in Oskari's case HOT_WATER is 8. Fortunately you can get this from the Available operational statuses (map).
In my case bit 3 (value 8) is used for both COOLING and POOL. Mode 9 will always mean POOL, Mode 8 may mean COOLING or POOL while the compressor has not been switched on yet.
And finally, you are already exposing the multi-value operational status. I would not know how to to present it in a better way than as e.g. ['HEATING', 'RADIATORPUMP', 'COMPR'] (taken from Askari''s message):
Operational status
Operational status: ['HEATING', 'RADIATORPUMP', 'COMPR']
Available operational statuses: ValuesView(ChainMap({1: 'COMPR'}, {2: 'RADIATORPUMP'}, {8: 'HOT_WATER'}, {16: 'HEATING'}, {32: 'DEFROST'}, {64: 'POOL'}, {128: 'COOLING'}))
Available operational statuses map: ChainMap({1: 'COMPR'}, {2: 'RADIATORPUMP'}, {8: 'HOT_WATER'}, {16: 'HEATING'}, {32: 'DEFROST'}, {64: 'POOL'}, {128: 'COOLING'})
As an aside, I use the interface to measure the energy consumption of the heat pump. Unfortunately the heat pump does not provide this information, so I installed some current sensors. Every minute I read the operational status form the Thermia_api and get the average current (and hence wattage) for that minute. This way I know how much energy goes into heating, cooling, hot water and the pool.
… Op 6 jan. 2023, om 00:40 heeft Krisjanis Lejejs ***@***.***> het volgende geschreven:
I finally inderstand what @wouterse <https://github.com/wouterse> meant by status being a binary number :). Thanks for the tip @wouterse <https://github.com/wouterse>, I would have never figured that out.
I will have to investigate how to properly implement that logic and return multiple statuses.
—
Reply to this email directly, view it on GitHub <#14 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AY4EXTNJ6RRELCDJB3AKZXDWQ5LWRANCNFSM6AAAAAATM5UL2E>.
You are receiving this because you were mentioned.
|
@wouterse thanks for the detailed explanation on this. I recently studied bitwise operations at university, so it is interesting to see how they are used in a real-life scenario. I would have never thought though that something like this would be still used too. |
Sorry for late reply, but yes, i now see the operational status:
|
Example how its shown on thermia online (classic), unfortunately I couldn't change the UI language.
Running example.py / debug lists:
I think the related entry in debug.txt is:
The text was updated successfully, but these errors were encountered: