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

Custom AHU control #65

Open
Fettkeewl opened this issue Dec 4, 2024 · 2 comments
Open

Custom AHU control #65

Fettkeewl opened this issue Dec 4, 2024 · 2 comments

Comments

@Fettkeewl
Copy link

Created my own EVE control because I don't like the native control.
Still a work in progress, if you wanna try it
Find and Replace "loke_01" with the name if your device

Create 3 helpers accordingly
image

  • Supply Temp = the temp you would normally want to have when this control is not in use
  • Supply Temp Adjusted = the temp that is in use when this automation is in control
  • AHU Use EVE = Boolean to toggle automation on/off

Basically if the boolean helper is enabled the Air handling unit will have its own native control.
But if disabled the automation will prevent EVE from being used until you are below a minimum treshold
which is set in the variable declaration part of the automation. The automation will also prevent the rotor from spinning
down by manipulating the target temperature. Currently only made working for the normal mode.

In short:

  • If rotor spins down -> increase target temp according to variable
  • if EVE is in use -> decrease target temp according to variable

This will minimize the use of EVE until it's really cold and also not waste any precious heat by slowing down
the rotor to keep the supply temp at set value.

Hopefully this won't strain the flash memory to much.
(I do not know if "only" changing the target temperature is saved to memory)
((I doubt it because there is a "SAVE" button on installer page))

GL and feel free to remove this if you don't want it here @bj00rn

alias: AC|Loke01|RotorRPMCtrl
description: |-
  Custom Controller for EVE usage in LOKE-01.
  AHU = Air Handling Unit
  EVE = Electric Ventilation Element
  TNT = Target Normal Temperature
  TAT = Target Adjusted Temperature
triggers:
  - alias: Rotor spinning down
    trigger: numeric_state
    entity_id:
      - sensor.loke_01_heat_exchanger_rotor_speed_percent
    below: 95
    id: id:rotorSpeedLow
    for:
      hours: 0
      minutes: 0
      seconds: 10
  - alias: EVE in use
    trigger: numeric_state
    entity_id:
      - sensor.loke_01_heater_power_percent
    for:
      hours: 0
      minutes: 1
      seconds: 0
    above: 5
    id: id:eveInUse
  - alias: AHU Ctrl Enabled
    trigger: state
    entity_id:
      - input_boolean.ahu_use_eve
    to: "on"
    from: "off"
    id: id:ahuUsesEve
conditions:
  - condition: template
    value_template: |-
      {{ 
        trigger.from_state.state not in ["unavailable", "unknown"]
        and
        trigger.to_state.state not in ["unavailable", "unknown"]
      }}
    alias: Skip Actions on unknown Triggers
actions:
  - variables:
      temp_min: 15
      temp_max: 20
      temp_incr: 1
      temp_decr: 1
      temp_supply: "{{ states('sensor.loke_01_supply_air_temperature')|round() }}"
      repeat_max: 10
    alias: Define Settings
  - choose:
      - conditions:
          - alias: Confirm setting and trigger
            condition: and
            conditions:
              - condition: state
                entity_id: input_boolean.ahu_use_eve
                state: "on"
                alias: Confirm AHU EVE Ctrl Enabled by User
              - condition: trigger
                id:
                  - id:ahuUsesEve
                alias: Confirm Trigger is id:ahuUsesEve
        sequence:
          - action: select.select_option
            metadata: {}
            data:
              option: Normal
            target:
              entity_id: select.loke_01_temperature_mode
            alias: Set AHU to Normal Mode
          - delay:
              hours: 0
              minutes: 0
              seconds: 2
              milliseconds: 0
            alias: Delay 2s
          - action: number.set_value
            target:
              entity_id: number.loke_01_normal_temperature
            data:
              value: "{{ states('input_number.ahu_supply_temp') }}"
            alias: Set AHU Normal Temperature
        alias: AHU in Ctrl
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: input_boolean.ahu_use_eve
                state: "off"
                alias: Confirm AHU EVE Ctrl Disabled by User
              - alias: Confirm Supply Temp below max
                condition: template
                value_template: "{{ temp_supply <= temp_max }}"
              - alias: Confirm Supply Temp above min
                condition: template
                value_template: "{{ temp_supply >= (temp_min - 1) }}"
        sequence:
          - choose:
              - conditions:
                  - condition: trigger
                    id:
                      - id:rotorSpeedLow
                    alias: If TriggerID is id:rotorSpeedLow
                sequence:
                  - variables:
                      temp_new: >-
                        {{ (temp_supply+temp_incr if
                        temp_supply+temp_incr<=temp_max else temp_max)|int }}
                    alias: Define temp_new
                  - action: input_number.set_value
                    metadata: {}
                    data:
                      value: "{{ temp_new }}"
                    target:
                      entity_id: input_number.ahu_supply_temp_adjusted
                    alias: Set AHU TAT to temp_new
                  - alias: Repeat until TNT eq temp_new
                    repeat:
                      sequence:
                        - action: number.set_value
                          target:
                            entity_id: number.loke_01_normal_temperature
                          data:
                            value: "{{ temp_new }}"
                          alias: Set TNT to temp_new
                        - delay:
                            hours: 0
                            minutes: 0
                            seconds: 5
                            milliseconds: 0
                          alias: Delay 5 s
                      until:
                        - condition: or
                          conditions:
                            - alias: Confirm TNT eq temp_new
                              condition: template
                              value_template: >-
                                {% set ahu_set_temp =
                                states('sensor.loke_01_normal_temperature')|int()
                                %}

                                {{ ahu_set_temp == temp_new }}
                            - condition: template
                              value_template: "{{ repeat.index == repeat_max }}"
                              alias: Check if repeat_max is reached
                alias: If rotor is spinning down
              - conditions:
                  - condition: trigger
                    id:
                      - id:eveInUse
                    alias: If EVE is in use
                sequence:
                  - variables:
                      temp_new: >-
                        {{ (temp_supply-temp_decr if
                        temp_supply-temp_decr>=temp_min else temp_min)|int }}
                    alias: Define temp_new
                  - action: input_number.set_value
                    metadata: {}
                    data:
                      value: "{{ temp_new }}"
                    target:
                      entity_id: input_number.ahu_supply_temp_adjusted
                    alias: Set AHU TAT to temp_new
                  - alias: Repeat until TNT eq temp_new
                    repeat:
                      sequence:
                        - action: number.set_value
                          target:
                            entity_id: number.loke_01_normal_temperature
                          data:
                            value: "{{ temp_new }}"
                          alias: Set TNT to temp_new
                        - delay:
                            hours: 0
                            minutes: 0
                            seconds: 5
                            milliseconds: 0
                          alias: Delay 5 s
                      until:
                        - condition: or
                          conditions:
                            - alias: Confirm TNT eq temp_new
                              condition: template
                              value_template: >-
                                {% set ahu_set_temp =
                                states('sensor.loke_01_normal_temperature')|int()
                                %}

                                {{ ahu_set_temp == temp_new }}
                            - condition: template
                              value_template: "{{ repeat.index == repeat_max }}"
                              alias: Check if repeat_max is reached
        alias: HA in Ctrl
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
    alias: End Marker
mode: single
@bj00rn
Copy link
Owner

bj00rn commented Dec 6, 2024

Nice! Let me know how it works long term!

@Fettkeewl
Copy link
Author

Yea I saw that update, I've adjusted accordingly. Will be updating my post tomorrow from my pc 😂

It's been working fine so far, rather cold now so at 15 degree minimum target temp I don't get eve started until supply temp drops to below 14. So I've minimized the heating alot from eve all while keeping it active to prevent the supply air from dropping to low. Any time I go above my target temp and the rotor starts spinning down the automation automatically bumps up the target temp by 1-2 degrees and rotor spins upp quite fast thereafter. I'm pleased so far.

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

No branches or pull requests

2 participants