geoffdavis / esphome-mitsubishiheatpump

ESPHome Climate Component for Mitsubishi Heatpumps using direct serial connection
BSD 2-Clause "Simplified" License
588 stars 158 forks source link

Add vertical and horizontal vane position controls #109

Closed nathanjw closed 5 months ago

nathanjw commented 1 year ago

Starting from https://github.com/geoffdavis/esphome-mitsubishiheatpump/pull/103 by @seime, extract the vane implementation code and format according to existing style. Leave behind all the reformatting.

SanderDevCode commented 1 year ago

I've tested this PR on my units (MSZ-AP**VGK, currently tested on MSZ-AP25GK and MSZ-AP55VGK, but the board is the same) and they are working as expected. I've used the by SSMCD on 4th august (line 231 > Horizontal Vane Position > ${name} Vertical Vane)

geoffdavis commented 1 year ago

Can you rebase this onto devel instead of master? I've got some pending commits on the devel branch that I need to package as a release. They're mostly documentation changes.

nathanjw commented 1 year ago

Rebased against devel, and caught up to the changes there. I also re-added the models that @seime mentioned.

SGXander commented 11 months ago

Tested nathanjw:unformat-select and it's working well on MSZ-LN25VG2

Ferrox85 commented 11 months ago

Can this be merged? I Want to get rid of the MELCLOUD integration, but I need this kind of control to be able to do that..

geoffdavis commented 11 months ago

Can this be merged? I Want to get rid of the MELCLOUD integration, but I need this kind of control to be able to do that..

Not until the change I requested is made, and the conflicts are resolved.

SGXander commented 11 months ago

I've made a slight alteration at https://github.com/SGXander/esphome-mitsubishiheatpump/tree/split_fix which I'd be happy to PR either here or into nathanjws fork, let me know which. The underlying swicago library specifies "<>" which in nathanjws version is marked as "auto" but during testing I have discovered it is actually "split" (leaving the middle clear and sending air left and right). I've updated this in my fork under the split_fix branch but so far I haven't found the command code to activate auto on the horizontal_vane so have left it out of the options variable. Edit: I'm giving up for the night but auto is not 0x00 like vertical (of course not) but it must be another value not listed as the select returns to default(left) when unset. I'll carry on looking tomorrow.

nathanjw commented 11 months ago

Please take another look. I had adjusted the defaults as requested, but missed that merge conflict. I think that is resolved now.

eclair4151 commented 11 months ago

Whats the best way to test this PR on my Home Assistant install? I tried replacing the external component URL with your branch URL, but it didnt seem to have any effect.

SGXander commented 11 months ago

Whats the best way to test this PR on my Home Assistant install? I tried replacing the external component URL with your branch URL, but it didnt seem to have any effect.

external_components:
  - source: github://nathanjw/esphome-mitsubishiheatpump@unformat-select
eclair4151 commented 11 months ago

Awesome, thanks! Just tested it out, working for me as well. I wish Home assistant let you customize the HVAC card to allow you to put the swing in the card, oh well :). @SGXander I think you still need to mark the PR ready for review.

SGXander commented 10 months ago

Awesome, thanks! Just tested it out, working for me as well. I wish Home assistant let you customize the HVAC card to allow you to put the swing in the card, oh well :). @SGXander I think you still need to mark the PR ready for review.

Not my repo, it's ready to merge already though if you want it to report "split" instead of "auto" then use my fork for now as I don't think nathanjw has updated this one.

eclair4151 commented 10 months ago

Ah whoops, @nathanjw thoughts on adding in support for horizontal vane split position in this PR and marking it ready for review?

SGXander commented 10 months ago

put in https://github.com/nathanjw/esphome-mitsubishiheatpump/pull/1 for the split thing that way it should update this PR if approved

eclair4151 commented 10 months ago

@nathanjw Whats the status on this? If we dont hear back should we just raise a separate PR based on yours SGXander which includes the fix?

nathanjw commented 10 months ago

I think I'd like to get this in as is and then a cosmetic renaming of that horizontal mode could be a much easier followon.

jamiebegin commented 10 months ago

Whats the best way to test this PR on my Home Assistant install? I tried replacing the external component URL with your branch URL, but it didnt seem to have any effect.

external_components:
  - source: github://nathanjw/esphome-mitsubishiheatpump@unformat-select

I'm getting a whole slew of errors when I attempt to compile using this branch. It starts with:

In file included from src/esphome.h:33,
                 from src/esphome/components/mitsubishi_heatpump/espmhp.h:20,
                 from src/esphome/components/mitsubishi_heatpump/espmhp.cpp:21:
src/esphome/components/mitsubishi_heatpump/espmhp.h:182:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<std::chrono::duration<long long, std::ratio<60>>> remote_operating_timeout_;

These errors don't happen when using the base branch. I'm not much of a C++ guy so I'm not sure where to start looking for the problem?

SanderDevCode commented 10 months ago

@jamiebegin

You have to add some options to help the compiler use C++17

See the sample below. You've to add the platformio_options with the build_unflag and build_flags

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  # Set platform options to use c++ 17 instead of 11
  platformio_options:
    build_unflags:
      - "-std=gnu++11"
    build_flags:
      - "-std=gnu++17"
davidcd13 commented 9 months ago

Vane selection cannot be integrated into the default home assistant climate card? Is it necessarily a separate card? With Melcloud, vane position is integrated into the default climate card.

SanderDevCode commented 8 months ago

Vane selection cannot be integrated into the default home assistant climate card? Is it necessarily a separate card? With Melcloud, vane position is integrated into the default climate card.

It is possible, with the "features" you can add to the climate card. And with the service-call-tile-feature add-on from Nerwyn (https://github.com/Nerwyn/service-call-tile-feature):

Screenshot 2024-03-16 at 17 30 11
type: thermostat
entity: climate.airco_
features:
  - style: icons
    hvac_modes:
      - 'off'
      - cool
      - heat
      - fan_only
      - dry
    type: climate-hvac-modes
  - style: dropdown
    fan_modes:
      - auto
      - low
      - medium
      - high
    type: climate-fan-modes
  - type: custom:service-call
    entries:
      - type: selector
        entity_id: select.airco_horizontal_vane_position
        options:
          - option: left
            icon: mdi:chevron-double-left
          - option: left_center
            icon: mdi:chevron-left
          - option: center
            icon: mdi:format-horizontal-align-center
          - option: right_center
            icon: mdi:chevron-right
          - option: right
            icon: mdi:chevron-double-left
  - type: custom:service-call
    entries:
      - type: selector
        entity_id: select.airco_vertical_vane_position
        options:
          - option: up
            icon: mdi:chevron-double-up
          - option: up_center
            icon: mdi:chevron-up
          - option: center
            icon: mdi:format-vertical-align-center
          - option: down_center
            icon: mdi:chevron-down
          - option: down
            icon: mdi:chevron-double-down
show_current_as_primary: false

You can change the icons or options as you like.