Issue with sync_command #16

Merged
VadymMelnychuk merged 20 commits from main into main 2023-10-12 16:43:41 +02:00
VadymMelnychuk commented 2023-07-24 15:34:41 +02:00 (Migrated from github.com)

I discovered next issue
when my HomeAssistant start I see all modes related to my WaterHeater
machMode = [1,2,3]

in settings section this parameter has type 'Range'
However, after I call command startProgram the 'machMode' become like a fixed. Only value '1' allowed
It happens bcs startProgram also has parameter 'machMode' but with type fixed. So, when you sync fixed -> range you do the reset for ranges.

Also i exxtended sync_command with 'to_sync' parameter:

  • if to_sync==True -> will sync only mandatory parameters
  • if to_sync is list -> will sync only parameters that exists in to_sync list

+2 minor fixes.

  • if cannot find parameter - havee to just continue (not return)
  • improved virtual 'active' state for water heater
I discovered next issue when my HomeAssistant start I see all modes related to my WaterHeater machMode = [1,2,3] in settings section this parameter has type 'Range' However, after I call command `startProgram` the 'machMode' become like a fixed. Only value '1' allowed It happens bcs `startProgram` also has parameter 'machMode' but with type fixed. So, when you sync fixed -> range you do the reset for ranges. Also i exxtended `sync_command` with 'to_sync' parameter: - if to_sync==True -> will sync only mandatory parameters - if to_sync is list -> will sync only parameters that exists in to_sync list +2 minor fixes. - if cannot find parameter - havee to just continue (not return) - improved virtual 'active' state for water heater
Andre0512 (Migrated from github.com) reviewed 2023-07-27 18:53:16 +02:00
Andre0512 (Migrated from github.com) commented 2023-07-27 18:53:16 +02:00

This is important for other functions and will introduce problems for other appliances if we remove it.
Please use startProgram.program to switch the mode instead of settings.machMode.

This is important for other functions and will introduce problems for other appliances if we remove it. Please use `startProgram.program` to switch the mode instead of `settings.machMode`.
VadymMelnychuk (Migrated from github.com) reviewed 2023-07-27 21:40:47 +02:00
VadymMelnychuk (Migrated from github.com) commented 2023-07-27 21:40:47 +02:00

Wait. Looks like my explanation is not so good.
So.
I use command 'startProgram' for turn on water heater. I have no any other ways to turn on appliance.
Next. startProgram has 3 params:
onOffStatus (mandatory, fixed)
machMode (optional, fixed)
tempSel (optional, fixed)

However, real settings.machMode is range, and has 1,2 and 3 modes (eco, max, bps). And it's correct type of this parameter.
I don't know why manufacturer implement parameter 'startProgram.machMode' as fixed. But, we have what we have.

As result. I call start program - >sync command replace range of 'settings.machMode' with only one value. It's incorrect. More over. I didn't touch sync if base and target parameter are range. I removed sync code only for case if base parameter is fixed and target is range. That's it.
Let me know of you need more examples.

Wait. Looks like my explanation is not so good. So. I use command 'startProgram' for turn on water heater. I have no any other ways to turn on appliance. Next. startProgram has 3 params: onOffStatus (mandatory, fixed) machMode (optional, fixed) tempSel (optional, fixed) However, real settings.machMode is range, and has 1,2 and 3 modes (eco, max, bps). And it's correct type of this parameter. I don't know why manufacturer implement parameter 'startProgram.machMode' as fixed. But, we have what we have. As result. I call start program - >sync command replace range of 'settings.machMode' with only one value. It's incorrect. More over. I didn't touch sync if base and target parameter are range. I removed sync code only for case if base parameter is fixed and target is range. That's it. Let me know of you need more examples.
VadymMelnychuk (Migrated from github.com) reviewed 2023-08-02 20:31:58 +02:00
VadymMelnychuk (Migrated from github.com) commented 2023-08-02 20:31:57 +02:00

@Andre0512
Any comments or suggestions from your side?

@Andre0512 Any comments or suggestions from your side?
VadymMelnychuk (Migrated from github.com) reviewed 2023-10-04 10:57:30 +02:00
VadymMelnychuk (Migrated from github.com) commented 2023-10-04 10:57:30 +02:00

@Andre0512 hey man
will we continue on this request? Tell me, should I wait or not

@Andre0512 hey man will we continue on this request? Tell me, should I wait or not
Andre0512 (Migrated from github.com) reviewed 2023-10-12 01:18:09 +02:00
Andre0512 (Migrated from github.com) commented 2023-10-12 01:18:09 +02:00

Hi, sorry you had to wait so long!
So I can`t merge this unfortunately if it removes line 301-303, this will break functionalities of some appliances...

If you change startProgram.program to 'eco' then machMode is 1, if you change startProgram.program to 'max' then machMode is 2 and so on. So you don't need to change machMode itself at any time, you can work with changing startProgram.program and it's ok that machMode is fixed, it will be updated with the changing program. This is how I implemented it for other appliances. The user can't change machMode itself, you always need to change startProgram.program
Is it understandable what I mean and can you try it? 🙂

Hi, sorry you had to wait so long! So I can`t merge this unfortunately if it removes line 301-303, this will break functionalities of some appliances... If you change `startProgram.program` to 'eco' then `machMode` is 1, if you change `startProgram.program` to 'max' then `machMode` is 2 and so on. So you don't need to change `machMode` itself at any time, you can work with changing `startProgram.program` and it's ok that `machMode` is fixed, it will be updated with the changing program. This is how I implemented it for other appliances. The user can't change `machMode` itself, you always need to change `startProgram.program` Is it understandable what I mean and can you try it? :slightly_smiling_face:
VadymMelnychuk (Migrated from github.com) reviewed 2023-10-12 15:37:51 +02:00
VadymMelnychuk (Migrated from github.com) commented 2023-10-12 15:37:51 +02:00

@Andre0512 Thanks. I understood the concept. It was not clear for me at the start.
So, I rewrite my fork of hOn according to your explanation. All work. I revert back sync_command
Should be fine now.

@Andre0512 Thanks. I understood the concept. It was not clear for me at the start. So, I rewrite my fork of hOn according to your explanation. All work. I revert back `sync_command` Should be fine now.
Andre0512 (Migrated from github.com) approved these changes 2023-10-12 16:42:49 +02:00
Andre0512 (Migrated from github.com) left a comment

All fine now, thanks 👍

All fine now, thanks 👍
Sign in to join this conversation.
No description provided.