midea-ac-py
midea-ac-py copied to clipboard
expose LED switch and outdoor temp to home assistant
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.
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
Perhaps you could expose this as a switch entity? Or add a custom service to toggle it? PRs welcome :)
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?
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.
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
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?
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