Baldhor / Homey-ESPhome-Enhanced

This is an Homey app which adds support for ESPHome devices. ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems. More information on their homepage: https://www.esphome.io/
GNU General Public License v3.0
5 stars 3 forks source link

[Custom Enum Request] Mitsubishi Heavy Industries (MHI) airco #67

Closed denstol closed 7 months ago

denstol commented 7 months ago

Reminder Homey doesn't support dynamic capability for 'list of values'. Every 'list of values' (enumeration) require a specific implementation! It takes about 10 minutes to do it correctly and imply support in case fix are needed. It also means that I need to maintain all those custom enum in the long term!

This is discussed in details here: https://github.com/Baldhor/Homey-ESPhome-Enhanced/wiki/Custom-capabilities

Pay for a Service The idea here is not to sell my service for a price, but more likely to say "Hey, you own me a beer!".

Drinking alcohol is bad for your health, ask for help :)

Jump to my paypal and offer me a beer: https://www.paypal.com/paypalme/baldhors

Price for a beer in France is about 6€ ...

Implemented for you, but available for ALL The custom enum you request will benefit everyone that may have the same need! Little by little, the list could cover 90% of everyone needs.

Meaning, no more beer for me in the medium term :(

Custom enum requested Detail here the custom enum you need! Include a 'collect debug info' file, you can obtain it through the page 'Manage your physical devices' page. Refer to the User Guide if needed: https://github.com/Baldhor/Homey-ESPhome-Enhanced/wiki/User-Guide#manage-your-physical-devices-page

denstol commented 7 months ago

Hi Baldhor,

We were in contact recently about the Mitsubishi Heavy Industries (MHI) airco's. I would like to make use of your service to implement the dynamic capabilities for my airco's. I think the mode setting is equal to the Panasonic airco, but the Fan Up/Down and Fan Left/Right will be different. I attached the debug info file and, of course, for this implementation I will buy you a beer. You know what, I will buy you 2 beers ;-) One for each dynamic list.

Thanks for your help and let me know if you need more information.

collect debug info.txt

Baldhor commented 7 months ago

@denstol

          "supportedModesList": [
            0,
            1,
            2,
            3,
            4,
            5
          ],
          "supportedFanModesList": [
            2,
            3,
            4,
            5,
            9
          ],
          "supportedSwingModesList": [
            0,
            1,
            2,
            3
          ],

Yeah, the first one "mode" should works, but not the other two I suppose :)

Baldhor commented 7 months ago

What values you would expect? I will also check ESPhome specification for usual values.

Baldhor commented 7 months ago

I checked the specification from ESPhome, should be:

          "supportedFanModesList": [
            2, => auto
            3, => low
            4, => medium
            5, => high
            9  => quiet
          ],
          "supportedSwingModesList": [
            0, => off
            1, => both
            2, => vertical
            3  => horizontal
          ],

It matches?

denstol commented 7 months ago

@Baldhor: copied below snippets from the build in webserver.

Mode: image

Fan Mode Left / Right: image Does this make sense?

Fan Mode Up / Down: image

Maybe I'm mixing things up here

denstol commented 7 months ago

Ok, I see them in the list. The supportedFanModesList is ok I guess. Don't know what the other one does, but I guess that's ok too ;-)

Baldhor commented 7 months ago

@denstol You are right, I missed those 2!

      {
        "id": 3539886882,
        "type": "Select",
        "name": "Airco Werkkamer Fan Control Left Right",
        "config": {
          "objectId": "airco_werkkamer_fan_control_left_right",
          "key": 3539886882,
          "name": "Airco Werkkamer Fan Control Left Right",
          "uniqueId": "airco_werkkamerselectairco_werkkamer_fan_control_left_right",
          "icon": "mdi:arrow-left-right",
          "optionsList": [
            "Left",
            "Left/Center",
            "Center",
            "Center/Right",
            "Right",
            "Wide",
            "Spot",
            "Swing"
          ],
          "disabledByDefault": false,
          "entityCategory": 0
        }
      },
      {
        "id": 3884021616,
        "type": "Select",
        "name": "Airco Werkkamer Fan Control Up Down",
        "config": {
          "objectId": "airco_werkkamer_fan_control_up_down",
          "key": 3884021616,
          "name": "Airco Werkkamer Fan Control Up Down",
          "uniqueId": "airco_werkkamerselectairco_werkkamer_fan_control_up_down",
          "icon": "mdi:arrow-up-down",
          "optionsList": [
            "Up",
            "Up/Center",
            "Center/Down",
            "Down",
            "Swing"
          ],
          "disabledByDefault": false,
          "entityCategory": 0
        }
      },

Your airco device has a very long list of native capabilities :)

So I will jsut add all 4 of them. And aslo implement numeric to string conversion for fanMode, swingMode and preset.

denstol commented 7 months ago

Ok, that would be very nice of you.

denstol commented 7 months ago

Would you like more beer?

Baldhor commented 7 months ago

@denstol Here you go: https://homey.app/fr-fr/app/nl.inversion.esphome/ESPhome/test/

And thanks for the 2 beers! Just a reminder, I cannot test it fully, but I was as carefull as possible :)

denstol commented 7 months ago

@Baldhor Thanks for your swift response. I will test it quickly and give you some feedback.

denstol commented 7 months ago

I did some quick testing... I added a new virtual device which contained a lot of text, temperature and all custom enums. Unfortunately when testing this in the Android app, I could not select the virtual device. The app crashed. So as a second step I removed all test and temperature capabilities and only left the 5 custom enums. This worked better, I could see 4 custom enums and was able to see and change their values. I did not checked on the real airco, because everybody is sleeping here and I want to give them a good night sleep ;-) The Fan mode, was a select thing, not an enum. But maybe I selected the wrong capability.

I give it another try tomorrow and will let you know the results. Thanks for your help so far. It is really appreciated!

Baldhor commented 7 months ago

The Fan mode, was a select thing, not an enum. But maybe I selected the wrong capability.

Fixed! => It was missing a value in the numerical to string conversion.

And I think it explain the crash you got!

New version => https://homey.app/fr-fr/app/nl.inversion.esphome/ESPhome/test/

denstol commented 7 months ago

You are awesome... Don't you ever sleep ;-)

Baldhor commented 7 months ago

You are awesome... Don't you ever sleep ;-)

Watching a netflix movie on the computer :)

denstol commented 7 months ago

Nice. Enjoy your movie ;-)

Baldhor commented 7 months ago

@denstol any news?

denstol commented 7 months ago

@Baldhor sorry, did not have a chance to test. Will be in the upcoming weekend. I cant keep up with your pace 😉

Baldhor commented 7 months ago

closing, reopen if any problem :)