midea-ac-py icon indicating copy to clipboard operation
midea-ac-py copied to clipboard

expose LED switch and outdoor temp to home assistant

Open aa755 opened this issue 5 years ago • 7 comments
trafficstars

Describe the solution you'd like LED (AC display) could be exposed as a switch. Outdoor temp could be exposed as a sensor. The upstream library appears to support these.

aa755 avatar May 18 '20 05:05 aa755

I added a setter for the AC LED light on/off state and tested it: it works. https://github.com/aa755/midea-ac-lib/commit/6aa0eb660edea4f08bce73ab31e51d6992dd7e87#diff-6ad3d8b7b3d88f8f4c5bb4a84db572f8R109

aa755 avatar Jun 07 '20 04:06 aa755

Perhaps you could expose this as a switch entity? Or add a custom service to toggle it? PRs welcome :)

andersonshatch avatar Jun 07 '20 20:06 andersonshatch

If exposed as a separate switch entity, I am not sure how the switch and the AC entities would share the same midea.device object. Custom service seems simpler to implement. By any chance, do you know any developer-oriented tutorial for writing custom services in home assistant?

aa755 avatar Jun 07 '20 21:06 aa755

For home assistant to be able to log and draw graphs of outdoor temperature, I think custom service wont suffice and it would need to be exposed as a sensor.

aa755 avatar Jun 07 '20 21:06 aa755

Consider the method used by the Dyson component. They don't expose it as a switch, however they do provide a service and attribute.

I have used template switches to give me what I want.

- platform: template
  switches:
    template_service_midea.set_night_mode:
      friendly_name: Midea LED Night Mode
      value_template: "{{ is_state_attr('fan.midea_0123456789ABCDEF', 'night_mode', true) }}"
      turn_on:
        service: midea.set_night_mode
        data:
          entity_id: fan.midea_0123456789ABCDEF
          night_mode: true
      turn_off:
        service: midea.set_night_mode
        data:
          entity_id: fan.midea_0123456789ABCDEF
          night_mode: false

Dyson Cool Link Tower only expose fan… whereas Dyson Hot+Cool expose both climate and fan…

https://github.com/home-assistant/core/tree/dev/homeassistant/components/dyson

homekitter avatar Jun 11 '20 02:06 homekitter

Well, it's summer again. And I've put my window rattler back in place. Bought a second one as well...

Anyone have any further interest in exposing the LED as a switch or as a service?

homekitter avatar May 21 '21 20:05 homekitter

Perhaps the night_mode concepts from shenxn/ha-dyson would be helpful

https://github.com/shenxn/ha-dyson/blob/main/custom_components/dyson_local/switch.py

homekitter avatar May 21 '21 20:05 homekitter