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

Update Register 2, 4, 6 values min_max with checking Register 2 min/max which depends on emmission type installed #60

Merged
merged 13 commits into from
Nov 2, 2024

Conversation

rysiulg
Copy link
Contributor

@rysiulg rysiulg commented Oct 22, 2024

No description provided.

rysiulg and others added 4 commits October 21, 2024 22:27
Register 2 with checks for min and max allowed temp depends for emmission types -unfortunatelly it is impossible to set min_value and max_value in lambda ;(
…ensor

I'm sorry -i was missed some Register 210 bits that is ReadOnly -this move these back to binary sensors ;)
Changed in lambda  mapping array position to if condition check to avoid error in array select ;)
heatpump.yaml Outdated
@@ -3189,23 +3078,49 @@ number:
value_bytes[0] = value >> 8; // high byte (zone 2)
value_bytes[1] = value & 0x00FF; // low byte (zone 1)

// ESP_LOGI("","Zone 1 is %d", value_bytes[1]);
// ESP_LOGI("","Zone 2 is %d", value_bytes[0]);
auto operation_state = id(${devicename}_operational_mode).state;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what this code exactly does. I seems to me that the value (read and write) is changed based on the emission type.

We should not interfere with the input of the user, if the user specifies a certain value, then that value should be used. We must only limit the value of the slider, based on the limits of the specification in the manual

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rereading your code helped 😉 What you do is set the limit based on the emission type. I see two issues with this:

  1. The user sets a value, but the system changes that value without feedback to user. If the user does not verify, another value can be used then he/she wanted.
  2. The limits are hard coded and are easily forgotten if these are changed somewhere else.

I rather keep it simple and only define the upper and lower limit, thus as it already is.

Commented in lambda ESP_LOG
restoring extracting 4-bit values
corrections of zones decode
remove reg:272 bit 12-15 mapping global from x ;)
removed extra line
@rysiulg
Copy link
Contributor Author

rysiulg commented Oct 26, 2024 via email

@Mosibi
Copy link
Owner

Mosibi commented Oct 26, 2024

I will keep this in mind, but for now let's move it out and revert it.

Maybe in the (near) future we can introduce a global var that defines the limits for the specific emission types. Then we can use those vars in both the default range and in the code. That way we only have to change it at one spot.

@rysiulg
Copy link
Contributor Author

rysiulg commented Oct 26, 2024 via email

Rebverted in write lmabda:
      // Apply minmax for standard temp
      auto operation_state = id(${devicename}_operational_mode).state;
      auto end_heating_unit = id(${devicename}_zone_2_end_heating_mode_emission_type).state;
      auto end_cooling_unit = id(${devicename}_zone_2_end_cooling_mode_emission_type).state;
      if (operation_state == "Cool") {
        if (x < 5 and end_cooling_unit == "Fan Coil Unit") value_byte = 5;
        if (x < 18 and end_cooling_unit != "Fan Coil Unit") value_byte = 18;
        if (x >25) value_byte = 25;
      } else if (operation_state == "Heat") {
        if (x < 25 and end_heating_unit == "Underfloor Heating") value_byte = 25;
        if (x > 55 and end_heating_unit == "Underfloor Heating") value_byte = 55;
        if (x < 35 and end_heating_unit == "Radiator") value_byte = 35;
        if (x > 60 and end_heating_unit == "Radiator") value_byte = 60;
      }
Removed spaces in globals registers 210
@Mosibi
Copy link
Owner

Mosibi commented Oct 30, 2024

@rysiulg I am a bit busy lately, this weekend I will look into your PR

@Mosibi Mosibi merged commit 939b8e7 into Mosibi:master Nov 2, 2024
@Mosibi
Copy link
Owner

Mosibi commented Nov 2, 2024

@rysiulg merged. Again thank you for your contribution !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants