geoffdavis / esphome-mitsubishiheatpump

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

can u include your project inside esphome ? #5

Open blademckain opened 4 years ago

blademckain commented 4 years ago

Can u include your project inside official esphome? By creating a custom component that can be used directly with:

climate:
  - platform: mitsubishiheatpump
.....
IsaacBreuer commented 4 years ago

There is already a esphome Mitsubishi version, I use it https://github.com/geoffdavis/esphome-mitsubishiheatpump/blob/master/README.md

On Thu, May 28, 2020, 5:12 AM blademckain notifications@github.com wrote:

Can u include your project inside official esphome? By creating a custom component that can be used directly with:

climate:

  • platform: mitsubishiheatpump .....

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNS2YSRT5SECXU37L4IT6TRTYTIFANCNFSM4NM42DJQ .

blademckain commented 4 years ago

yeah! but u have to manually insert a custom component. I asked if it is possible to pull this repository directly into the official esphome repository. In this way it could be maintained by the esphome community also in the next updates / changes

geoffdavis commented 4 years ago

Hi @blademckain

Getting this included into mainline ESPhome was always my goal with this project. I wanted to do some testing and get a few people using it before going through the merge process with the main project.

blademckain commented 4 years ago

ok @geoffdavis thank you very much for your additions to esphome. in this period I'm buying mitsubishi air conditioners. I will try your component as soon as it is included.

Phillipzx3 commented 4 years ago

Hello @geoffdavis

Total github noob here (still learning the terms), so please let me know if I'm going about asking this in an offensive way. I've been trying to incorporate my 2 Mr. Slim units into HA via MQTT. I got as far as seeing all the data (using the "SwiCago/Heatpump" library) in the Temperature card in Lovelace but I hadn't got to where I could change anything. Then I saw your project and decided that might be a better way of going. :-)

Ok, here's where I get stumped. You say these files (repository?) needs to be in my "esphome configuration" directory. Can I assume that is the same esphome directory I see via using my "File Editor" add-on? I see the directories are there and I can create a "src" directory I made (inside the esphome folder/directory) there as well.

Ok...once that's done, I'm lost. I have no clue how to "git clone" into that directory. Each (guessed at) attempt places the files in the esphome folder and not the src folder. Unfortunatly there are no Youtube videos explaining this process that I could find.

I'm running HA on a Oracle VirtualBox if it matters. I also have the ESPHome dev version installed.

If I'm out of line, just ignore this message and I'll wait until you have it ready for "the masses." :-)

Thanks Phil K7JBL

Edit for update:

I got it all sorted out. My paths were different, but it compiled and flashed on the Wemo D1 mini lite just fine. I now have a card in Lovelace showing (almost) everything.

Swing mode is "off" or "On." But I'm guessing that;s the part I need to learn how to do.

Thank you for the work you guys put into this. Seems a lot cleaner than using MQTT, but that opinion might be from my ignorance.

loongyh commented 4 years ago

Hi @blademckain

Getting this included into mainline ESPhome was always my goal with this project. I wanted to do some testing and get a few people using it before going through the merge process with the main project.

@geoffdavis excellent work and many thanks for this integration, it's working very well currently for my units. Since I live in a hot and humid tropical region there isn't a heat mode for my unit, as such I have to modify the traits to hide it. If you're intending to create an official ESPHome component for this it'll be great if the modes can be selected/hidden in the .yaml config. Edit: iirc I did come across some models with horizontal swing. And also some models with quiet (diffuse) fan mode. Perhaps the swing and fan modes can also be made .yaml configurable.

geoffdavis commented 4 years ago

@Phillipzx3 You'll want to check out the repository under the HomeAssistant config directory, in config/esphome/src/esphome-mitsubishiheatpump.

Assuming that you're using HassOS, this could either be done with Visual Studio Code running on your HomeAssistant node, or with the command line git client using the SMB Share plugin from HomeAssistant. I've done both.

Here's what the tree should look like, as viewed in VS Code. Basically, under config/esphome, create a subdirectory called src and then check out this repository under that src directory.

Screen Shot 2020-07-06 at 1 44 42 PM
geoffdavis commented 4 years ago

@loongyh thanks for your other pull request. In terms of adding flags, presumably the best way to do that would be by adding optional arguments to the constructor for the MitsubishiHeatPump class. As it currently stands, the class itself does no parsing of the YAML configuration, so any arguments need to be passed within the lambda block.

Using my current configuration as a starting point:

climate:
  - platform: custom
    lambda: |-
      auto my_heatpump = new MitsubishiHeatPump(&Serial); /* Add arguments here */
      App.register_component(my_heatpump);
      return {my_heatpump};

    climates:
      - name: ${friendly_name}
Phillipzx3 commented 4 years ago

@geoffdavis Geoffdavis...Fortunately, I managed to stumble my way into the Visual Studio Code and Samba share add-on. Once that happened, I saw the light! :-) My directories are now where they belong. :-)

I can control fan speed, all the modes ( à la modes? :-) ) and the vertical swing. Still haven't figured out how to do the "split vane" mode, "horizontal swing" or "vane positioning" (I'm using a MSZ-FH09NA) but that's no biggie. The fact that I can do what I can is enough.

Thank you for providing this code. I'm not ready to dive into MQTT. :-)

davralin commented 3 years ago

Any updates or thoughts regarding moving this into esphome's main repo?

geoffdavis commented 3 years ago

I haven't had a chance to look into it recently, but with all of the API changes it might be a good idea to do so.

kalosbg commented 2 years ago

Hello @geoffdavis, Today I switched from SwiCago's project to yours. It worked without any issues. Thank you!

loongyh commented 2 years ago

I have contributed ESPHome integrations before, do let me know if you need assistance or if you'd like me to do it for you.

geoffdavis commented 2 years ago

Thanks Barry. I’ve made minor contributions to the main ESPHOME repo before, but I haven’t done a full component like this before.

Right now it’s just a lack of dev cycles to shepherd it through the process. I’ve been out in the field deploying instruments on towers, so not much time is available for coding, or hanging Christmas lights for that matter. :)

On Wed, Dec 1, 2021 at 03:28 Barry Loong @.***> wrote:

I have contributed ESPHome integrations before, do let me know if you need assistance or if you'd like me to do it for you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/geoffdavis/esphome-mitsubishiheatpump/issues/5#issuecomment-983548322, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDYSXUY2VBWFNLVODMWA3UOYBHRANCNFSM4NM42DJQ .

loongyh commented 2 years ago

No worries in #opensource we help each other 😉.

First, we'll probably need to reimplement the mitsubishi protocol used in the swicago library in the component itself, as the maintainers have an aversion to external/lib dependencies and prefer self-contained components. We'll then need to refactor the serial to use UARTComponent, should be straightforward to do.

I'll try to find some time to do up the scaffolding, will submit a PR then.

davralin commented 2 years ago

Let me know if you need any testers for it, I can't submit any code - but I'd be more than happy to test something.

echavet commented 10 months ago

No worries in #opensource we help each other 😉.

First, we'll probably need to reimplement the mitsubishi protocol used in the swicago library in the component itself, as the maintainers have an aversion to external/lib dependencies and prefer self-contained components. We'll then need to refactor the serial to use UARTComponent, should be straightforward to do.

I'll try to find some time to do up the scaffolding, will submit a PR then. I did it here: https://github.com/echavet/MitsubishiCN105ESPHome