Giter Club home page Giter Club logo

Comments (8)

geoffdavis avatar geoffdavis commented on August 17, 2024 1

The lack of responsiveness is likely due to the polling loop only running once every two seconds. You might get it to be more responsive by fiddling with the value for poll_interval - decrease that from the default of 2000 milliseconds to 1000 and see if it works any better. In your lambda, declare it like auto my_heat_pump = new HeatPump(&Serial, 1000); in your lambda.

(Code that implements is here)

A possibly better solution would be to convert to callbacks but I was unable to get those to work during my development, and just wanted to get this thing out the door.

from esphome-mitsubishiheatpump.

geoffdavis avatar geoffdavis commented on August 17, 2024 1

As for the different fan modes, @DeltaAngle nailed it on the head.

I'd love to get the custom modes like gysmo's implementation, but I haven't figured out how to override the ESPHome definitions. There seems to be a lot of work that would have to happen in the ESPHome code base in order to provide custom fan levels, as the conversation between ESPHome and HomeAssistant is pretty heavily locked down. There may be a way to make it work akin to how the FastLED component lets you declare "lamba modes", but that's likely a whole lot of development work.

from esphome-mitsubishiheatpump.

geoffdavis avatar geoffdavis commented on August 17, 2024 1

@jascdk I did some experiments with the refresh interval, and found that:

  • 1000ms is an improvement
  • 500 ms didn't yield much in the way of responsiveness

Watching the logs, it appears that the heat pump doesn't report a changed state until the fan vanes open. In particular, if the unit is off, and you turn it on, the HeatPump won't report the change over it's serial port until the slats open up. This can take up to 10 seconds.

So that's one mode of slowness.

The other sluggish part is the temperature changes. I have a feeling that getting the callbacks working is going to help that. Right now, the code sends an update to Home Assistant every polling loop. My theory is that the constant stream of state changes is too much for HomeAssistant, either in the core (not likely) or in the web front end components. By converting to callbacks, update messages would only be sent to home assistant IF something changed. I'll see if I can get that functionality working.

from esphome-mitsubishiheatpump.

geoffdavis avatar geoffdavis commented on August 17, 2024 1

Release 1.1.0 addresses the responsiveness issue.

I got callbacks to work (turns out that my initialization fixes had fixed all of the crashes I was seeing with the callbacks), and increased the polling interval from 2 seconds to 500 ms. The web interface is much snappier, and your temperature graphs shouldn't be as large now due to it only including data points when things change rather than every update.

Please try it out and let me know if you see any problems in a new ticket.

Thanks!

from esphome-mitsubishiheatpump.

jascdk avatar jascdk commented on August 17, 2024

This is taken from the code at Gysmos repo:

Here is some examples of the states of the fan and vane:

https://pastebin.com/rNznHWEB

if (strcmp(settings.fan, "AUTO") == 0) {
700 controlPage.replace("FAN_A", "selected");
701 }
702 else if (strcmp(settings.fan, "QUIET") == 0) {
703 controlPage.replace("FAN_Q", "selected");
704 }
705 else if (strcmp(settings.fan, "1") == 0) {
706 controlPage.replace("FAN_1", "selected");
707 }
708 else if (strcmp(settings.fan, "2") == 0) {
709 controlPage.replace("FAN_2", "selected");
710 }
711 else if (strcmp(settings.fan, "3") == 0) {
712 controlPage.replace("FAN_3", "selected");
713 }
714 else if (strcmp(settings.fan, "4") == 0) {
715 controlPage.replace("FAN_4", "selected");
716 }
717

718 controlPage.replace("VANE_V", settings.vane);
719 if (strcmp(settings.vane, "AUTO") == 0) {
720 controlPage.replace("VANE_A", "selected");
721 }
722 else if (strcmp(settings.vane, "1") == 0) {
723 controlPage.replace("VANE_1", "selected");
724 }
725 else if (strcmp(settings.vane, "2") == 0) {
726 controlPage.replace("VANE_2", "selected");
727 }
728 else if (strcmp(settings.vane, "3") == 0) {
729 controlPage.replace("VANE_3", "selected");
730 }
731 else if (strcmp(settings.vane, "4") == 0) {
732 controlPage.replace("VANE_4", "selected");
733 }
734 else if (strcmp(settings.vane, "5") == 0) {
735 controlPage.replace("VANE_5", "selected");
736 }
737 else if (strcmp(settings.vane, "SWING") == 0) {
738 controlPage.replace("VANE_S", "selected");
739 }
740

741 controlPage.replace("WIDEVANE_V", settings.wideVane);
742 if (strcmp(settings.wideVane, "<<") == 0) {
743 controlPage.replace("WVANE_1", "selected");
744 }
745 else if (strcmp(settings.wideVane, "<") == 0) {
746 controlPage.replace("WVANE_2", "selected");
747 }
748 else if (strcmp(settings.wideVane, "|") == 0) {
749 controlPage.replace("WVANE_3", "selected");
750 }
751 else if (strcmp(settings.wideVane, ">") == 0) {
752 controlPage.replace("WVANE_4", "selected");
753 }
754 else if (strcmp(settings.wideVane, ">>") == 0) {
755 controlPage.replace("WVANE_5", "selected");
756 }
757 else if (strcmp(settings.wideVane, "SWING") == 0) {
758 controlPage.replace("WVANE_S", "selected");
759 }

from esphome-mitsubishiheatpump.

DeltaAngle avatar DeltaAngle commented on August 17, 2024

The fan and swing modes in Geoff's code are based on the supported functions in the ESPHome Dev branch. You can see these documented here, https://next.esphome.io/components/climate/index.html. ESPHome would need to be updated to support the numerical fan speed, vane swing, and wide vane swing settings.

from esphome-mitsubishiheatpump.

jascdk avatar jascdk commented on August 17, 2024

@DeltaAngle Ahhh thanks - that makes sense;)

Any thoughts on the responsiveness?

from esphome-mitsubishiheatpump.

jascdk avatar jascdk commented on August 17, 2024

Release 1.1.0 addresses the responsiveness issue.

I got callbacks to work (turns out that my initialization fixes had fixed all of the crashes I was seeing with the callbacks), and increased the polling interval from 2 seconds to 500 ms. The web interface is much snappier, and your temperature graphs shouldn't be as large now due to it only including data points when things change rather than every update.

Please try it out and let me know if you see any problems in a new ticket.

Thanks!

Hi Geoff:)

That did make an hell of a difference instead of the old one:) Nice that you got it working out! If I have other issues I will get back to you. I have put this repo on my watch list, so I can keep up with eventually other updates! Nice work Geoff!!!!

from esphome-mitsubishiheatpump.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.