@@ -131,12 +131,109 @@ Maximum configuration witch will use all possible options will look like this:
131131 name : Haier hOn Climate quiet mode
132132
133133 select :
134- - platform : haier
135- haier_id : haier_ac
136- vertical_airflow :
137- name : Haier hOn Climate airflow vertical
138- horizontal_airflow :
139- name : Haier hOn Climate airflow horizontal
134+ - platform : template
135+ id : haier_ac_vertical_direction
136+ name : Haier hOn Climate airflow vertical
137+ entity_category : config
138+ icon : mdi:arrow-expand-vertical
139+ update_interval : 5s
140+ options :
141+ - Health Up
142+ - Max Up
143+ - Up
144+ - Center
145+ - Down
146+ - Max Down
147+ - Health Down
148+ - Auto
149+ lambda : >-
150+ switch (id(haier_ac).get_vertical_airflow().value_or(esphome::haier::hon_protocol::VerticalSwingMode::CENTER))
151+ {
152+ case esphome::haier::hon_protocol::VerticalSwingMode::HEALTH_UP:
153+ return std::string("Health Up");
154+ case esphome::haier::hon_protocol::VerticalSwingMode::MAX_UP:
155+ return std::string("Max Up");
156+ case esphome::haier::hon_protocol::VerticalSwingMode::UP:
157+ return std::string("Up");
158+ default:
159+ case esphome::haier::hon_protocol::VerticalSwingMode::CENTER:
160+ return std::string("Center");
161+ case esphome::haier::hon_protocol::VerticalSwingMode::DOWN:
162+ return std::string("Down");
163+ case esphome::haier::hon_protocol::VerticalSwingMode::MAX_DOWN:
164+ return std::string("Max Down");
165+ case esphome::haier::hon_protocol::VerticalSwingMode::HEALTH_DOWN:
166+ return std::string("Health Down");
167+ case esphome::haier::hon_protocol::VerticalSwingMode::AUTO:
168+ case esphome::haier::hon_protocol::VerticalSwingMode::AUTO_SPECIAL:
169+ return std::string("Auto");
170+ }
171+ set_action :
172+ - climate.haier.set_vertical_airflow :
173+ id : haier_ac
174+ vertical_airflow : !lambda >-
175+ if (x == "Health Up")
176+ return esphome::haier::hon_protocol::VerticalSwingMode::HEALTH_UP;
177+ else if (x == "Max Up")
178+ return esphome::haier::hon_protocol::VerticalSwingMode::MAX_UP;
179+ else if (x == "Up")
180+ return esphome::haier::hon_protocol::VerticalSwingMode::UP;
181+ else if (x == "Down")
182+ return esphome::haier::hon_protocol::VerticalSwingMode::DOWN;
183+ else if (x == "Max Down")
184+ return esphome::haier::hon_protocol::VerticalSwingMode::MAX_DOWN;
185+ else if (x == "Health Down")
186+ return esphome::haier::hon_protocol::VerticalSwingMode::HEALTH_DOWN;
187+ else if (x == "Auto")
188+ return esphome::haier::hon_protocol::VerticalSwingMode::AUTO;
189+ else
190+ return esphome::haier::hon_protocol::VerticalSwingMode::CENTER;
191+ - platform : template
192+ id : haier_ac_horizontal_direction
193+ name : Haier hOn Climate airflow horizontal
194+ entity_category : config
195+ icon : mdi:arrow-expand-horizontal
196+ update_interval : 5s
197+ options :
198+ - Max Left
199+ - Left
200+ - Center
201+ - Right
202+ - Max Right
203+ - Auto
204+ lambda : >-
205+ switch (id(haier_ac).get_horizontal_airflow().value_or(esphome::haier::hon_protocol::HorizontalSwingMode::CENTER))
206+ {
207+ case esphome::haier::hon_protocol::HorizontalSwingMode::MAX_LEFT:
208+ return std::string("Max Left");
209+ case esphome::haier::hon_protocol::HorizontalSwingMode::LEFT:
210+ return std::string("Left");
211+ default:
212+ case esphome::haier::hon_protocol::HorizontalSwingMode::CENTER:
213+ return std::string("Center");
214+ case esphome::haier::hon_protocol::HorizontalSwingMode::RIGHT:
215+ return std::string("Right");
216+ case esphome::haier::hon_protocol::HorizontalSwingMode::MAX_RIGHT:
217+ return std::string("Max Right");
218+ case esphome::haier::hon_protocol::HorizontalSwingMode::AUTO:
219+ return std::string("Auto");
220+ }
221+ set_action :
222+ - climate.haier.set_horizontal_airflow :
223+ id : haier_ac
224+ horizontal_airflow : !lambda >-
225+ if (x == "Max Left")
226+ return esphome::haier::hon_protocol::HorizontalSwingMode::MAX_LEFT;
227+ else if (x == "Left")
228+ return esphome::haier::hon_protocol::HorizontalSwingMode::LEFT;
229+ else if (x == "Right")
230+ return esphome::haier::hon_protocol::HorizontalSwingMode::RIGHT;
231+ else if (x == "Max Right")
232+ return esphome::haier::hon_protocol::HorizontalSwingMode::MAX_RIGHT;
233+ else if (x == "Auto")
234+ return esphome::haier::hon_protocol::HorizontalSwingMode::AUTO;
235+ else
236+ return esphome::haier::hon_protocol::HorizontalSwingMode::CENTER;
140237
141238 sensor :
142239 - platform : haier
0 commit comments