├── .github
└── workflows
│ └── pylint.yml
├── .gitignore
├── .vscode
└── c_cpp_properties.json
├── LICENSE
├── README.md
├── comfoair.yaml
├── components
└── comfoair
│ ├── __init__.py
│ ├── comfoair.h
│ └── registers.h
├── doc
├── T568B.png
├── bom.jpg
├── esp_comfoair.pdf
├── gen1.jpg
├── gen2.jpg
├── installed.jpg
└── schematic.png
└── simple_thermostat.yaml
/.github/workflows/pylint.yml:
--------------------------------------------------------------------------------
1 | name: Pylint
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build:
7 | runs-on: ubuntu-latest
8 | strategy:
9 | matrix:
10 | python-version: ["3.9", "3.10", "3.11", "3.12"]
11 | steps:
12 | - uses: actions/checkout@v4
13 | - name: Set up Python ${{ matrix.python-version }}
14 | uses: actions/setup-python@v5
15 | with:
16 | python-version: ${{ matrix.python-version }}
17 | - name: Install dependencies
18 | run: |
19 | pip install pylint esphome
20 | - name: Analysing the code with pylint
21 | run: |
22 | pylint $(git ls-files '*.py')
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3 | ################################################################################
4 |
5 | /.vs/slnx.sqlite
6 | /.vs
7 | /root@
8 |
--------------------------------------------------------------------------------
/.vscode/c_cpp_properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "Win32",
5 | "includePath": [
6 | "${workspaceFolder}/**",
7 | "C:\\Projects\\GitHub\\esphome"
8 | ],
9 | "defines": [
10 | "_DEBUG",
11 | "UNICODE",
12 | "_UNICODE"
13 | ],
14 | "windowsSdkVersion": "10.0.19041.0",
15 | "compilerPath": "cl.exe",
16 | "cStandard": "c17",
17 | "cppStandard": "c++17",
18 | "intelliSenseMode": "windows-msvc-x64"
19 | }
20 | ],
21 | "version": 4
22 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/julianpas/esphome-comfoair/actions/workflows/pylint.yml)
2 |
3 | # ComfoAir
4 | This is a clone of https://github.com/wichers/esphome-comfoair repo with a few modifications:
5 |
6 | 1. It contains the fixes to the Climate control modifciations made in https://github.com/nilsbebelaar/esphome-comfoair fork.
7 | - Set prefered temp.
8 | - Proper checksum computation.
9 | 1. More cannonical C++ style of the code (e.g. no this-> all over the place).
10 | 1. Supports connecting a ComfoSense remote to a second UART and proxies commands back and forth.
11 | 1. Support for status leds
12 | 1. Support for filter reset command
13 | 1. Support for a phisical button on the device
14 |
15 | ## Building the thing
16 |
17 | ### BOM:
18 |
19 | 1. ESP8266 serial WIFI Witty cloud Development Board ESP-12F module MINI nodemcu [buy here](https://www.aliexpress.com/item/32832264128.html)
20 | 2. ~~Mini RS232 MAX3232 Levels to TTL level converter board serial converter board [buy here](https://www.aliexpress.com/item/32261741207.html)~~
21 | 3. MAX 232 DIP RS232 [buy here](https://www.reichelt.com/ch/de/rs232-2-treiber-2-empfaenger-dil-16-max-232-dip-p11216.html)
22 | 4. 12V zu 5V 3A 15W DC-DC Step Down Buck Converter Power Supply Module Mini USB [buy here](https://www.aliexpress.com/item/33032878289.html)
23 | 5. Aerial Butt Welding Type 5EDGRKC-5.08mm 5pin Male [buy here](https://www.aliexpress.com/item/1005003988825751.html)
24 | 6. Aerial Butt Welding Type 5EDGRKC-5.08mm 5pin Female [buy here](https://www.aliexpress.com/item/1005003988825751.html)
25 |
26 |
27 |
28 | *Note:*
29 |
30 | ~~The MAX2323 board only breaks out the second tranciever channel so I soldered cables directly to pins 11,12 (TTL TX,RX) and 13,14 (RS232 TX,RX) on the MAX2323 chip.~~
31 |
32 | The MAX2323 board I first bought from Aliexpress turned out to be a cheap clone that let the magic smoke out on me twice and was the source of all my issues I was seeing initially with poor data transmision. You can find tons of articles on the internet citing the same issues.
33 |
34 | ### Schematic:
35 |
36 | 
37 | [Schematic](doc/esp_comfoair.pdf)
38 |
39 | ### Assembly:
40 |
41 | I went through a few iterations of this board starting with a monstrosity of cables ending up with this neat board:
42 |
43 | Gen1 using the buggy MAX2323 breakout baord:
44 | 
45 |
46 | Gen2 using the DIP MAX3232 chip in a DIP socket:
47 | 
48 |
49 | Which I embedded into the unit like this:
50 | 
51 |
52 | ### Firmware:
53 |
54 | The ESPHome application uses pins GPIO5 and GPIO14 for the second software serial interface because almost all other pins are already claimed by the LED light (GPIO12, GPIO13, GPIO15), the button (GPIO4) or the light sensor (ADC) or have some other special function.
55 |
56 | Eventually I might move to an ESP32 board to be able to use two hardware UART ports but the low baud rate of the deviced of 9600bps is not really a problem for the ESP8266 either.
57 |
58 | ### Parting remarks:
59 |
60 | I was using ESPHome from my Udoo single board PC which I use to run Home Assistant but compiling on it is very slow and tortures the SD Card a lot so I ended up installing only ESPHome standalone in a Docker container on my Nas which speeds up building a lot.
61 |
62 | Since initially I was using the board that already had all the capacitors for the charge pump installed I haven't really taken care to mark polarities in the schematic above. But since I only had polarized caps I had to be careful with that. They were mostly self explanatory but I ended up consulting the data sheet of the chip to make sure I don't screw it up.
63 |
64 | Initially I was going to just dump all of that inside the ComfoAir casing but the WiFi connectivity behind the metal case is poor so I ended up making a crappy mountaing plate for the schematic which I might revisit in the future.
65 |
66 | There are still some messages that are proxied (or rather dropped) from the ComfoSense unit with incorrect checksums. I haven't bothered fixing those yet. Pull requests are welcome.
67 |
--------------------------------------------------------------------------------
/comfoair.yaml:
--------------------------------------------------------------------------------
1 | esphome:
2 | name: comfoair
3 | platform: ESP8266
4 | board: nodemcu
5 |
6 | # Disable uart logging
7 | logger:
8 | baud_rate: 0
9 |
10 | sensor:
11 | binary_sensor:
12 | - platform: gpio
13 | pin:
14 | number: GPIO4
15 | mode:
16 | input: true
17 | pullup: true
18 | name: "Mode button"
19 | filters:
20 | - invert:
21 | - delayed_on: 10ms
22 | on_multi_click:
23 | - timing:
24 | - ON for at most 1s
25 | - OFF for at most 1s
26 | - ON for at most 1s
27 | - OFF for at least 0.2s
28 | then:
29 | lambda: "id(comfoair_climate).set_level(3);"
30 | - timing:
31 | - ON for 1s to 2s
32 | - OFF for at least 0.5s
33 | then:
34 | lambda: "id(comfoair_climate).set_level(1);"
35 | - timing:
36 | - ON for at most 1s
37 | - OFF for at least 0.5s
38 | then:
39 | lambda: "id(comfoair_climate).set_level(2);"
40 |
41 | uart:
42 | - id: uart_bus
43 | baud_rate: 9600
44 | tx_pin: TX
45 | rx_pin: RX
46 | - id: uart_proxy
47 | baud_rate: 9600
48 | tx_pin: GPIO5
49 | rx_pin: GPIO14
50 |
51 | external_components:
52 | - source:
53 | type: git
54 | url: https://github.com/julianpas/esphome-comfoair
55 | components: ["comfoair"]
56 |
57 | button:
58 | - platform: restart
59 | id: reset_button
60 | name: "Reset Comfoair"
61 | - platform: template
62 | id: filter_reset_button
63 | name: "Reset Filter"
64 | on_press:
65 | then:
66 | lambda: "id(comfoair_climate).reset_filters();"
67 |
68 | switch:
69 | - platform: gpio
70 | pin: GPIO12
71 | name: "LED Green Light"
72 | id: green_led_gpio
73 | - platform: gpio
74 | pin: GPIO13
75 | name: "LED Blue Light"
76 | id: blue_led_gpio
77 | - platform: gpio
78 | pin: GPIO15
79 | name: "LED Red Light"
80 | id: red_led_gpio
81 |
82 | comfoair:
83 | id: comfoair_climate
84 | name: "ComfoAir 310 SL"
85 | uart_id: uart_bus
86 | proxy_uart: uart_proxy
87 | red_led: red_led_gpio
88 | green_led: green_led_gpio
89 | blue_led: blue_led_gpio
90 | type:
91 | name: "type"
92 | size:
93 | name: "size"
94 | intake_fan_speed:
95 | name: "intake_fan_speed"
96 | exhaust_fan_speed:
97 | name: "exhaust_fan_speed"
98 | intake_fan_speed_rpm:
99 | name: "intake_fan_speed_rpm"
100 | exhaust_fan_speed_rpm:
101 | name: "exhaust_fan_speed_rpm"
102 | ventilation_level:
103 | name: "ventilation_level"
104 | bypass_present:
105 | name: "bypass_present"
106 | bypass_valve:
107 | name: "bypass_valve"
108 | bypass_valve_open:
109 | name: "bypass_valve_open"
110 | preheating_state:
111 | name: "preheating_state"
112 | outside_air_temperature:
113 | name: "outside_air_temperature"
114 | supply_air_temperature:
115 | name: "supply_air_temperature"
116 | return_air_temperature:
117 | name: "return_air_temperature"
118 | exhaust_air_temperature:
119 | name: "exhaust_air_temperature"
120 | enthalpy_temperature:
121 | name: "enthalpy_temperature"
122 | ewt_temperature:
123 | name: "ewt_temperature"
124 | reheating_temperature:
125 | name: "reheating_temperature"
126 | kitchen_hood_temperature:
127 | name: "kitchen_hood_temperature"
128 | return_air_level:
129 | name: "return_air_level"
130 | supply_air_level:
131 | name: "supply_air_level"
132 | supply_fan_active:
133 | name: "supply_fan_active"
134 | filter_status:
135 | name: "filter_status"
136 | filter_full:
137 | name: "is_filter_full"
138 | enthalpy_present:
139 | name: "enthalpy_present"
140 | ewt_present:
141 | name: "ewt_present"
142 | options_present:
143 | name: "options_present"
144 | fireplace_present:
145 | name: "fireplace_present"
146 | kitchen_hood_present:
147 | name: "kitchen_hood_present"
148 | postheating_present:
149 | name: "postheating_present"
150 | postheating_pwm_mode_present:
151 | name: "postheating_pwm_mode_present"
152 | preheating_present:
153 | name: "preheating_present"
154 | bypass_factor:
155 | name: "bypass_factor"
156 | bypass_step:
157 | name: "bypass_step"
158 | bypass_correction:
159 | name: "bypass_correction"
160 | bypass_open_hours:
161 | name: "bypass_open_hours"
162 | preheating_hours:
163 | name: "preheating_hours"
164 | level0_hours:
165 | name: "level0_hours"
166 | level1_hours:
167 | name: "level1_hours"
168 | level2_hours:
169 | name: "level2_hours"
170 | level3_hours:
171 | name: "level3_hours"
172 | preheating_valve:
173 | name: "preheating_valve"
174 | frost_protection_active:
175 | name: "frost_protection_active"
176 | frost_protection_hours:
177 | name: "frost_protection_hours"
178 | frost_protection_minutes:
179 | name: "frost_protection_minutes"
180 | frost_protection_level:
181 | name: "frost_protection_level"
182 | filter_hours:
183 | name: "filter_hours"
184 | motor_current_bypass:
185 | name: "motor_current_bypass"
186 | motor_current_preheating:
187 | name: "motor_current_preheating"
188 | summer_mode:
189 | name: "summer_mode"
190 | p10_active:
191 | name: "p10_active"
192 | p11_active:
193 | name: "p11_active"
194 | p12_active:
195 | name: "p12_active"
196 | p13_active:
197 | name: "p13_active"
198 | p14_active:
199 | name: "p14_active"
200 | p15_active:
201 | name: "p15_active"
202 | p16_active:
203 | name: "p16_active"
204 | p17_active:
205 | name: "p17_active"
206 | p18_active:
207 | name: "p18_active"
208 | p19_active:
209 | name: "p19_active"
210 | p90_active:
211 | name: "p90_active"
212 | p91_active:
213 | name: "p91_active"
214 | p92_active:
215 | name: "p92_active"
216 | p93_active:
217 | name: "p93_active"
218 | p94_active:
219 | name: "p94_active"
220 | p95_active:
221 | name: "p95_active"
222 | p96_active:
223 | name: "p96_active"
224 | p97_active:
225 | name: "p97_active"
226 | bathroom_switch_on_delay_minutes:
227 | name: "bathroom_switch_on_delay_minutes"
228 | bathroom_switch_off_delay_minutes:
229 | name: "bathroom_switch_off_delay_minutes"
230 | l1_switch_off_delay_minutes:
231 | name: "l1_switch_off_delay_minutes"
232 | boost_ventilation_minutes:
233 | name: "boost_ventilation_minutes"
234 | filter_warning_weeks:
235 | name: "filter_warning_weeks"
236 | rf_high_time_short_minutes:
237 | name: "rf_high_time_short_minutes"
238 | rf_high_time_long_minutes:
239 | name: "rf_high_time_long_minutes"
240 | extractor_hood_switch_off_delay_minutes:
241 | name: "extractor_hood_switch_off_delay_minutes"
242 |
243 | # Enable Home Assistant API
244 | api:
245 | encryption:
246 | key: !secret comfoair_encryption_key
247 | custom_services: true
248 |
249 | ota:
250 | password: !secret comfoair_ota_password
251 | platform: esphome
252 |
253 | wifi:
254 | ssid: !secret wifi_ssid
255 | password: !secret wifi_password
256 |
257 | # Enable fallback hotspot (captive portal) in case wifi connection fails
258 | ap:
259 | ssid: "Comfoair Fallback Hotspot"
260 | password: !secret comfoair_ap_password
261 |
262 | captive_portal:
263 |
264 |
--------------------------------------------------------------------------------
/components/comfoair/__init__.py:
--------------------------------------------------------------------------------
1 | """ Creates module ComfoAir """
2 |
3 | import esphome.codegen as cg
4 | import esphome.config_validation as cv
5 | from esphome.components import binary_sensor, sensor, switch, text_sensor, uart, climate
6 | from esphome.const import (CONF_ID, CONF_UART_ID, DEVICE_CLASS_CURRENT,
7 | DEVICE_CLASS_EMPTY, DEVICE_CLASS_SPEED,
8 | DEVICE_CLASS_TEMPERATURE, DEVICE_CLASS_VOLUME,
9 | STATE_CLASS_MEASUREMENT, UNIT_AMPERE, UNIT_CELSIUS,
10 | UNIT_CUBIC_METER, UNIT_HOUR, UNIT_MINUTE,
11 | UNIT_PERCENT, UNIT_REVOLUTIONS_PER_MINUTE, CONF_DISABLED_BY_DEFAULT)
12 |
13 | comfoair_ns = cg.esphome_ns.namespace("comfoair")
14 | ComfoAirComponent = comfoair_ns.class_("ComfoAirComponent", climate.Climate, cg.Component, uart.UARTDevice)
15 |
16 | DEPENDENCIES = ["uart"]
17 | AUTO_LOAD = ["sensor", "climate", "binary_sensor", "text_sensor"]
18 | REQUIRED_KEY_NAME = "name"
19 | CONF_HUB_ID = "comfoair"
20 | CONF_PROXY_UART_ID = "proxy_uart"
21 | CONF_RED_LED_ID = "red_led"
22 | CONF_GREEN_LED_ID = "green_led"
23 | CONF_BLUE_LED_ID = "blue_led"
24 |
25 | UNIT_WEEK = "weeks"
26 |
27 | CONF_TYPE = "type"
28 | CONF_SIZE = "size"
29 | CONF_INTAKE_FAN_SPEED = "intake_fan_speed"
30 | CONF_EXHAUST_FAN_SPEED = "exhaust_fan_speed"
31 | CONF_INTAKE_FAN_SPEED_RPM = "intake_fan_speed_rpm"
32 | CONF_EXHAUST_FAN_SPEED_RPM = "exhaust_fan_speed_rpm"
33 | CONF_VENTILATION_LEVEL = "ventilation_level"
34 | CONF_PREHEATING_STATE = "preheating_state"
35 | CONF_OUTSIDE_AIR_TEMPERATURE = "outside_air_temperature"
36 | CONF_SUPPLY_AIR_TEMPERATURE = "supply_air_temperature"
37 | CONF_RETURN_AIR_TEMPERATURE = "return_air_temperature"
38 | CONF_EXHAUST_AIR_TEMPERATURE = "exhaust_air_temperature"
39 | CONF_ENTHALPY_TEMPERATURE = "enthalpy_temperature"
40 | CONF_EWT_TEMPERATURE = "ewt_temperature"
41 | CONF_REHEATING_TEMPERATURE = "reheating_temperature"
42 | CONF_KITCHEN_HOOD_TEMPERATURE = "kitchen_hood_temperature"
43 | CONF_RETURN_AIR_LEVEL = "return_air_level"
44 | CONF_SUPPLY_AIR_LEVEL = "supply_air_level"
45 | CONF_SUPPLY_FAN_ACTIVE = "supply_fan_active"
46 | CONF_FILTER_STATUS = "filter_status"
47 | CONF_FILTER_FULL = "filter_full"
48 | CONF_BYPASS_PRESENT = "bypass_present"
49 | CONF_ENTHALPY_PRESENT = "enthalpy_present"
50 | CONF_EWT_PRESENT = "ewt_present"
51 | CONF_OPTIONS_PRESENT = "options_present"
52 | CONF_FIREPLACE_PRESENT = "fireplace_present"
53 | CONF_KITCHEN_HOOD_PRESENT = "kitchen_hood_present"
54 | CONF_POSTHEATING_PRESENT = "postheating_present"
55 | CONF_POSTHEATING_PWM_MODE_PRESENT = "postheating_pwm_mode_present"
56 | CONF_PREHEATING_PRESENT = "preheating_present"
57 | CONF_BYPASS_VALVE = "bypass_valve"
58 | CONF_BYPASS_VALVE_OPEN = "bypass_valve_open"
59 | CONF_BYPASS_FACTOR = "bypass_factor"
60 | CONF_BYPASS_STEP = "bypass_step"
61 | CONF_BYPASS_CORRECTION = "bypass_correction"
62 | CONF_BYPASS_OPEN_HOURS = "bypass_open_hours"
63 | CONF_MOTOR_CURRENT_BYPASS = "motor_current_bypass"
64 | CONF_MOTOR_CURRENT_PREHEATING = "motor_current_preheating"
65 | CONF_PREHEATING_HOURS = "preheating_hours"
66 | CONF_PREHEATING_VALVE = "preheating_valve"
67 | CONF_LEVEL0_HOURS = "level0_hours"
68 | CONF_LEVEL1_HOURS = "level1_hours"
69 | CONF_LEVEL2_HOURS = "level2_hours"
70 | CONF_LEVEL3_HOURS = "level3_hours"
71 | CONF_FROST_PROTECTION_ACTIVE = "frost_protection_active"
72 | CONF_FROST_PROTECTION_HOURS = "frost_protection_hours"
73 | CONF_FROST_PROTECTION_MINUTES = "frost_protection_minutes"
74 | CONF_FROST_PROTECTION_LEVEL = "frost_protection_level"
75 | CONF_FILTER_HOURS = "filter_hours"
76 | CONF_SUMMER_MODE = "summer_mode"
77 |
78 | CONF_P10_ACTIVE = "p10_active"
79 | CONF_P11_ACTIVE = "p11_active"
80 | CONF_P12_ACTIVE = "p12_active"
81 | CONF_P13_ACTIVE = "p13_active"
82 | CONF_P14_ACTIVE = "p14_active"
83 | CONF_P15_ACTIVE = "p15_active"
84 | CONF_P16_ACTIVE = "p16_active"
85 | CONF_P17_ACTIVE = "p17_active"
86 | CONF_P18_ACTIVE = "p18_active"
87 | CONF_P19_ACTIVE = "p19_active"
88 | CONF_P90_ACTIVE = "p90_active"
89 | CONF_P91_ACTIVE = "p91_active"
90 | CONF_P92_ACTIVE = "p92_active"
91 | CONF_P93_ACTIVE = "p93_active"
92 | CONF_P94_ACTIVE = "p94_active"
93 | CONF_P95_ACTIVE = "p95_active"
94 | CONF_P96_ACTIVE = "p96_active"
95 | CONF_P97_ACTIVE = "p97_active"
96 |
97 | CONF_BATHROOM_SWITCH_ON_DELAY_MINUTES = "bathroom_switch_on_delay_minutes"
98 | CONF_BATHROOM_SWITCH_OFF_DELAY_MINUTES = "bathroom_switch_off_delay_minutes"
99 | CONF_L1_SWITCH_OFF_DELAY_MINUTES = "l1_switch_off_delay_minutes"
100 | CONF_BOOST_VENTILATION_MINUTES = "boost_ventilation_minutes"
101 | CONF_FILTER_WARNING_WEEKS = "filter_warning_weeks"
102 | CONF_RF_HIGH_TIME_SHORT_MINUTES = "rf_high_time_short_minutes"
103 | CONF_RF_HIGH_TIME_LONG_MINUTES = "rf_high_time_long_minutes"
104 | CONF_EXTRACTOR_HOOD_SWITCH_OFF_DELAY_MINUTES = "extractor_hood_switch_off_delay_minutes"
105 |
106 | helper_comfoair = {
107 | "sensor": [
108 | CONF_INTAKE_FAN_SPEED,
109 | CONF_EXHAUST_FAN_SPEED,
110 | CONF_INTAKE_FAN_SPEED_RPM,
111 | CONF_EXHAUST_FAN_SPEED_RPM,
112 | CONF_VENTILATION_LEVEL,
113 | CONF_OUTSIDE_AIR_TEMPERATURE,
114 | CONF_SUPPLY_AIR_TEMPERATURE,
115 | CONF_RETURN_AIR_TEMPERATURE,
116 | CONF_EXHAUST_AIR_TEMPERATURE,
117 | CONF_ENTHALPY_TEMPERATURE,
118 | CONF_EWT_TEMPERATURE,
119 | CONF_REHEATING_TEMPERATURE,
120 | CONF_KITCHEN_HOOD_TEMPERATURE,
121 | CONF_RETURN_AIR_LEVEL,
122 | CONF_SUPPLY_AIR_LEVEL,
123 | CONF_BYPASS_VALVE,
124 | CONF_BYPASS_FACTOR,
125 | CONF_BYPASS_STEP,
126 | CONF_BYPASS_CORRECTION,
127 | CONF_BYPASS_OPEN_HOURS,
128 | CONF_MOTOR_CURRENT_BYPASS,
129 | CONF_MOTOR_CURRENT_PREHEATING,
130 | CONF_PREHEATING_HOURS,
131 | CONF_LEVEL0_HOURS,
132 | CONF_LEVEL1_HOURS,
133 | CONF_LEVEL2_HOURS,
134 | CONF_LEVEL3_HOURS,
135 | CONF_FROST_PROTECTION_HOURS,
136 | CONF_FROST_PROTECTION_MINUTES,
137 | CONF_FILTER_HOURS,
138 | CONF_BATHROOM_SWITCH_ON_DELAY_MINUTES,
139 | CONF_BATHROOM_SWITCH_OFF_DELAY_MINUTES,
140 | CONF_L1_SWITCH_OFF_DELAY_MINUTES,
141 | CONF_BOOST_VENTILATION_MINUTES,
142 | CONF_FILTER_WARNING_WEEKS,
143 | CONF_RF_HIGH_TIME_SHORT_MINUTES,
144 | CONF_RF_HIGH_TIME_LONG_MINUTES,
145 | CONF_EXTRACTOR_HOOD_SWITCH_OFF_DELAY_MINUTES,
146 | ],
147 | "binary_sensor": [
148 | CONF_BYPASS_PRESENT,
149 | CONF_ENTHALPY_PRESENT,
150 | CONF_EWT_PRESENT,
151 | CONF_OPTIONS_PRESENT,
152 | CONF_FIREPLACE_PRESENT,
153 | CONF_KITCHEN_HOOD_PRESENT,
154 | CONF_POSTHEATING_PRESENT,
155 | CONF_POSTHEATING_PWM_MODE_PRESENT,
156 | CONF_PREHEATING_PRESENT,
157 | CONF_BYPASS_VALVE_OPEN,
158 | CONF_PREHEATING_STATE,
159 | CONF_SUMMER_MODE,
160 | CONF_SUPPLY_FAN_ACTIVE,
161 | CONF_FROST_PROTECTION_ACTIVE,
162 | CONF_FILTER_FULL,
163 |
164 | CONF_P10_ACTIVE,
165 | CONF_P11_ACTIVE,
166 | CONF_P12_ACTIVE,
167 | CONF_P13_ACTIVE,
168 | CONF_P14_ACTIVE,
169 | CONF_P15_ACTIVE,
170 | CONF_P16_ACTIVE,
171 | CONF_P17_ACTIVE,
172 | CONF_P18_ACTIVE,
173 | CONF_P19_ACTIVE,
174 | CONF_P90_ACTIVE,
175 | CONF_P91_ACTIVE,
176 | CONF_P92_ACTIVE,
177 | CONF_P93_ACTIVE,
178 | CONF_P94_ACTIVE,
179 | CONF_P95_ACTIVE,
180 | CONF_P96_ACTIVE,
181 | CONF_P97_ACTIVE,
182 | ],
183 | "text_sensor": [
184 | CONF_TYPE,
185 | CONF_SIZE,
186 | CONF_FILTER_STATUS,
187 | CONF_FROST_PROTECTION_LEVEL,
188 | CONF_PREHEATING_VALVE,
189 | ],
190 | }
191 |
192 | comfoair_sensors_schemas = cv.Schema(
193 | {
194 | cv.Optional(CONF_TYPE): text_sensor.text_sensor_schema(),
195 | cv.Optional(CONF_SIZE): text_sensor.text_sensor_schema(),
196 | cv.Optional(CONF_FILTER_STATUS): text_sensor.text_sensor_schema(),
197 | cv.Optional(CONF_FROST_PROTECTION_LEVEL): text_sensor.text_sensor_schema(),
198 | cv.Optional(CONF_PREHEATING_VALVE): text_sensor.text_sensor_schema(),
199 |
200 | cv.Optional(CONF_INTAKE_FAN_SPEED): sensor.sensor_schema(
201 | device_class=DEVICE_CLASS_SPEED,
202 | unit_of_measurement=UNIT_PERCENT,
203 | accuracy_decimals=0,
204 | state_class=STATE_CLASS_MEASUREMENT,
205 | ).extend(),
206 | cv.Optional(CONF_EXHAUST_FAN_SPEED): sensor.sensor_schema(
207 | device_class=DEVICE_CLASS_SPEED,
208 | unit_of_measurement=UNIT_PERCENT,
209 | accuracy_decimals=0,
210 | state_class=STATE_CLASS_MEASUREMENT,
211 | ).extend(),
212 | cv.Optional(CONF_INTAKE_FAN_SPEED_RPM): sensor.sensor_schema(
213 | device_class=DEVICE_CLASS_SPEED,
214 | unit_of_measurement=UNIT_REVOLUTIONS_PER_MINUTE,
215 | accuracy_decimals=0,
216 | state_class=STATE_CLASS_MEASUREMENT,
217 | ).extend(),
218 | cv.Optional(CONF_EXHAUST_FAN_SPEED_RPM): sensor.sensor_schema(
219 | device_class=DEVICE_CLASS_SPEED,
220 | unit_of_measurement=UNIT_REVOLUTIONS_PER_MINUTE,
221 | accuracy_decimals=0,
222 | state_class=STATE_CLASS_MEASUREMENT,
223 | ).extend(),
224 | cv.Optional(CONF_VENTILATION_LEVEL): sensor.sensor_schema(
225 | device_class=DEVICE_CLASS_EMPTY,
226 | accuracy_decimals=0,
227 | state_class=STATE_CLASS_MEASUREMENT,
228 | ).extend(),
229 | cv.Optional(CONF_OUTSIDE_AIR_TEMPERATURE): sensor.sensor_schema(
230 | device_class=DEVICE_CLASS_TEMPERATURE,
231 | unit_of_measurement=UNIT_CELSIUS,
232 | accuracy_decimals=1,
233 | state_class=STATE_CLASS_MEASUREMENT,
234 | ).extend(),
235 | cv.Optional(CONF_SUPPLY_AIR_TEMPERATURE): sensor.sensor_schema(
236 | device_class=DEVICE_CLASS_TEMPERATURE,
237 | unit_of_measurement=UNIT_CELSIUS,
238 | accuracy_decimals=1,
239 | state_class=STATE_CLASS_MEASUREMENT,
240 | ).extend(),
241 | cv.Optional(CONF_RETURN_AIR_TEMPERATURE): sensor.sensor_schema(
242 | device_class=DEVICE_CLASS_TEMPERATURE,
243 | unit_of_measurement=UNIT_CELSIUS,
244 | accuracy_decimals=1,
245 | state_class=STATE_CLASS_MEASUREMENT,
246 | ).extend(),
247 | cv.Optional(CONF_EXHAUST_AIR_TEMPERATURE): sensor.sensor_schema(
248 | device_class=DEVICE_CLASS_TEMPERATURE,
249 | unit_of_measurement=UNIT_CELSIUS,
250 | accuracy_decimals=1,
251 | state_class=STATE_CLASS_MEASUREMENT,
252 | ).extend(),
253 | cv.Optional(CONF_ENTHALPY_TEMPERATURE): sensor.sensor_schema(
254 | device_class=DEVICE_CLASS_TEMPERATURE,
255 | unit_of_measurement=UNIT_CELSIUS,
256 | accuracy_decimals=1,
257 | state_class=STATE_CLASS_MEASUREMENT,
258 | ).extend(),
259 | cv.Optional(CONF_EWT_TEMPERATURE): sensor.sensor_schema(
260 | device_class=DEVICE_CLASS_TEMPERATURE,
261 | unit_of_measurement=UNIT_CELSIUS,
262 | accuracy_decimals=1,
263 | state_class=STATE_CLASS_MEASUREMENT,
264 | ).extend(),
265 | cv.Optional(CONF_REHEATING_TEMPERATURE): sensor.sensor_schema(
266 | device_class=DEVICE_CLASS_TEMPERATURE,
267 | unit_of_measurement=UNIT_CELSIUS,
268 | accuracy_decimals=1,
269 | state_class=STATE_CLASS_MEASUREMENT,
270 | ).extend(),
271 | cv.Optional(CONF_KITCHEN_HOOD_TEMPERATURE): sensor.sensor_schema(
272 | device_class=DEVICE_CLASS_TEMPERATURE,
273 | unit_of_measurement=UNIT_CELSIUS,
274 | accuracy_decimals=1,
275 | state_class=STATE_CLASS_MEASUREMENT,
276 | ).extend(),
277 | cv.Optional(CONF_RETURN_AIR_LEVEL): sensor.sensor_schema(
278 | device_class=DEVICE_CLASS_VOLUME,
279 | unit_of_measurement=UNIT_CUBIC_METER,
280 | accuracy_decimals=1,
281 | state_class=STATE_CLASS_MEASUREMENT,
282 | ).extend(),
283 | cv.Optional(CONF_SUPPLY_AIR_LEVEL): sensor.sensor_schema(
284 | device_class=DEVICE_CLASS_VOLUME,
285 | unit_of_measurement=UNIT_CUBIC_METER,
286 | accuracy_decimals=1,
287 | state_class=STATE_CLASS_MEASUREMENT,
288 | ).extend(),
289 | cv.Optional(CONF_BYPASS_FACTOR): sensor.sensor_schema(
290 | device_class=DEVICE_CLASS_VOLUME,
291 | accuracy_decimals=0,
292 | state_class=STATE_CLASS_MEASUREMENT,
293 | ).extend(),
294 | cv.Optional(CONF_BYPASS_STEP): sensor.sensor_schema(
295 | device_class=DEVICE_CLASS_VOLUME,
296 | accuracy_decimals=0,
297 | state_class=STATE_CLASS_MEASUREMENT,
298 | ).extend(),
299 | cv.Optional(CONF_BYPASS_CORRECTION): sensor.sensor_schema(
300 | device_class=DEVICE_CLASS_VOLUME,
301 | accuracy_decimals=0,
302 | state_class=STATE_CLASS_MEASUREMENT,
303 | ).extend(),
304 | cv.Optional(CONF_BYPASS_OPEN_HOURS): sensor.sensor_schema(
305 | device_class=DEVICE_CLASS_EMPTY,
306 | unit_of_measurement=UNIT_HOUR,
307 | accuracy_decimals=0,
308 | state_class=STATE_CLASS_MEASUREMENT,
309 | ).extend(),
310 | cv.Optional(CONF_MOTOR_CURRENT_BYPASS): sensor.sensor_schema(
311 | device_class=DEVICE_CLASS_CURRENT,
312 | unit_of_measurement=UNIT_AMPERE,
313 | accuracy_decimals=1,
314 | state_class=STATE_CLASS_MEASUREMENT,
315 | ).extend(),
316 | cv.Optional(CONF_MOTOR_CURRENT_PREHEATING): sensor.sensor_schema(
317 | device_class=DEVICE_CLASS_CURRENT,
318 | unit_of_measurement=UNIT_AMPERE,
319 | accuracy_decimals=1,
320 | state_class=STATE_CLASS_MEASUREMENT,
321 | ).extend(),
322 |
323 | cv.Optional(CONF_PREHEATING_HOURS): sensor.sensor_schema(
324 | device_class=DEVICE_CLASS_EMPTY,
325 | unit_of_measurement=UNIT_HOUR,
326 | accuracy_decimals=0,
327 | state_class=STATE_CLASS_MEASUREMENT,
328 | ).extend(),
329 | cv.Optional(CONF_LEVEL0_HOURS): sensor.sensor_schema(
330 | device_class=DEVICE_CLASS_EMPTY,
331 | unit_of_measurement=UNIT_HOUR,
332 | accuracy_decimals=0,
333 | state_class=STATE_CLASS_MEASUREMENT,
334 | ).extend(),
335 | cv.Optional(CONF_LEVEL1_HOURS): sensor.sensor_schema(
336 | device_class=DEVICE_CLASS_EMPTY,
337 | unit_of_measurement=UNIT_HOUR,
338 | accuracy_decimals=0,
339 | state_class=STATE_CLASS_MEASUREMENT,
340 | ).extend(),
341 | cv.Optional(CONF_LEVEL2_HOURS): sensor.sensor_schema(
342 | device_class=DEVICE_CLASS_EMPTY,
343 | unit_of_measurement=UNIT_HOUR,
344 | accuracy_decimals=0,
345 | state_class=STATE_CLASS_MEASUREMENT,
346 | ).extend(),
347 | cv.Optional(CONF_LEVEL3_HOURS): sensor.sensor_schema(
348 | device_class=DEVICE_CLASS_EMPTY,
349 | unit_of_measurement=UNIT_HOUR,
350 | accuracy_decimals=0,
351 | state_class=STATE_CLASS_MEASUREMENT,
352 | ).extend(),
353 | cv.Optional(CONF_FROST_PROTECTION_HOURS): sensor.sensor_schema(
354 | device_class=DEVICE_CLASS_EMPTY,
355 | unit_of_measurement=UNIT_HOUR,
356 | accuracy_decimals=0,
357 | state_class=STATE_CLASS_MEASUREMENT,
358 | ).extend(),
359 | cv.Optional(CONF_FROST_PROTECTION_MINUTES): sensor.sensor_schema(
360 | device_class=DEVICE_CLASS_EMPTY,
361 | unit_of_measurement=UNIT_MINUTE,
362 | accuracy_decimals=0,
363 | state_class=STATE_CLASS_MEASUREMENT,
364 | ).extend(),
365 | cv.Optional(CONF_FILTER_HOURS): sensor.sensor_schema(
366 | device_class=DEVICE_CLASS_EMPTY,
367 | unit_of_measurement=UNIT_HOUR,
368 | accuracy_decimals=0,
369 | state_class=STATE_CLASS_MEASUREMENT,
370 | ).extend(),
371 |
372 | cv.Optional(CONF_BYPASS_VALVE): sensor.sensor_schema(
373 | device_class=DEVICE_CLASS_VOLUME,
374 | unit_of_measurement=UNIT_PERCENT,
375 | accuracy_decimals=0,
376 | state_class=STATE_CLASS_MEASUREMENT,
377 | ).extend(),
378 |
379 | cv.Optional(CONF_BATHROOM_SWITCH_ON_DELAY_MINUTES): sensor.sensor_schema(
380 | device_class=DEVICE_CLASS_EMPTY,
381 | accuracy_decimals=0,
382 | state_class=STATE_CLASS_MEASUREMENT,
383 | ).extend(),
384 | cv.Optional(CONF_BATHROOM_SWITCH_OFF_DELAY_MINUTES): sensor.sensor_schema(
385 | device_class=DEVICE_CLASS_EMPTY,
386 | accuracy_decimals=0,
387 | state_class=STATE_CLASS_MEASUREMENT,
388 | ).extend(),
389 | cv.Optional(CONF_L1_SWITCH_OFF_DELAY_MINUTES): sensor.sensor_schema(
390 | device_class=DEVICE_CLASS_EMPTY,
391 | accuracy_decimals=0,
392 | state_class=STATE_CLASS_MEASUREMENT,
393 | ).extend(),
394 | cv.Optional(CONF_BOOST_VENTILATION_MINUTES): sensor.sensor_schema(
395 | device_class=DEVICE_CLASS_EMPTY,
396 | accuracy_decimals=0,
397 | state_class=STATE_CLASS_MEASUREMENT,
398 | ).extend(),
399 | cv.Optional(CONF_FILTER_WARNING_WEEKS): sensor.sensor_schema(
400 | device_class=DEVICE_CLASS_EMPTY,
401 | unit_of_measurement=UNIT_WEEK,
402 | accuracy_decimals=0,
403 | state_class=STATE_CLASS_MEASUREMENT,
404 | ).extend(),
405 | cv.Optional(CONF_RF_HIGH_TIME_SHORT_MINUTES): sensor.sensor_schema(
406 | device_class=DEVICE_CLASS_EMPTY,
407 | accuracy_decimals=0,
408 | state_class=STATE_CLASS_MEASUREMENT,
409 | ).extend(),
410 | cv.Optional(CONF_RF_HIGH_TIME_LONG_MINUTES): sensor.sensor_schema(
411 | device_class=DEVICE_CLASS_EMPTY,
412 | accuracy_decimals=0,
413 | state_class=STATE_CLASS_MEASUREMENT,
414 | ).extend(),
415 | cv.Optional(CONF_EXTRACTOR_HOOD_SWITCH_OFF_DELAY_MINUTES): sensor.sensor_schema(
416 | device_class=DEVICE_CLASS_EMPTY,
417 | accuracy_decimals=0,
418 | state_class=STATE_CLASS_MEASUREMENT,
419 | ).extend(),
420 |
421 | cv.Optional(CONF_FROST_PROTECTION_ACTIVE): binary_sensor.binary_sensor_schema(
422 | device_class=DEVICE_CLASS_EMPTY
423 | ).extend(),
424 | cv.Optional(CONF_BYPASS_PRESENT): binary_sensor.binary_sensor_schema(
425 | device_class=DEVICE_CLASS_EMPTY
426 | ).extend(),
427 | cv.Optional(CONF_ENTHALPY_PRESENT): binary_sensor.binary_sensor_schema(
428 | device_class=DEVICE_CLASS_EMPTY
429 | ).extend(),
430 | cv.Optional(CONF_EWT_PRESENT): binary_sensor.binary_sensor_schema(
431 | device_class=DEVICE_CLASS_EMPTY
432 | ).extend(),
433 | cv.Optional(CONF_OPTIONS_PRESENT): binary_sensor.binary_sensor_schema(
434 | device_class=DEVICE_CLASS_EMPTY
435 | ).extend(),
436 | cv.Optional(CONF_FIREPLACE_PRESENT): binary_sensor.binary_sensor_schema(
437 | device_class=DEVICE_CLASS_EMPTY
438 | ).extend(),
439 | cv.Optional(CONF_KITCHEN_HOOD_PRESENT): binary_sensor.binary_sensor_schema(
440 | device_class=DEVICE_CLASS_EMPTY
441 | ).extend(),
442 | cv.Optional(CONF_POSTHEATING_PRESENT): binary_sensor.binary_sensor_schema(
443 | device_class=DEVICE_CLASS_EMPTY
444 | ).extend(),
445 | cv.Optional(CONF_POSTHEATING_PWM_MODE_PRESENT): binary_sensor.binary_sensor_schema(
446 | device_class=DEVICE_CLASS_EMPTY
447 | ).extend(),
448 | cv.Optional(CONF_PREHEATING_PRESENT): binary_sensor.binary_sensor_schema(
449 | device_class=DEVICE_CLASS_EMPTY
450 | ).extend(),
451 | cv.Optional(CONF_BYPASS_VALVE_OPEN): binary_sensor.binary_sensor_schema(
452 | device_class=DEVICE_CLASS_EMPTY
453 | ).extend(),
454 | cv.Optional(CONF_PREHEATING_STATE): binary_sensor.binary_sensor_schema(
455 | device_class=DEVICE_CLASS_EMPTY
456 | ).extend(),
457 | cv.Optional(CONF_SUMMER_MODE): binary_sensor.binary_sensor_schema(
458 | device_class=DEVICE_CLASS_EMPTY
459 | ).extend(),
460 | cv.Optional(CONF_SUPPLY_FAN_ACTIVE): binary_sensor.binary_sensor_schema(
461 | device_class=DEVICE_CLASS_EMPTY
462 | ).extend(),
463 | cv.Optional(CONF_P10_ACTIVE): binary_sensor.binary_sensor_schema(
464 | device_class=DEVICE_CLASS_EMPTY
465 | ).extend(),
466 | cv.Optional(CONF_P11_ACTIVE): binary_sensor.binary_sensor_schema(
467 | device_class=DEVICE_CLASS_EMPTY
468 | ).extend(),
469 | cv.Optional(CONF_P12_ACTIVE): binary_sensor.binary_sensor_schema(
470 | device_class=DEVICE_CLASS_EMPTY
471 | ).extend(),
472 | cv.Optional(CONF_P13_ACTIVE): binary_sensor.binary_sensor_schema(
473 | device_class=DEVICE_CLASS_EMPTY
474 | ).extend(),
475 | cv.Optional(CONF_P14_ACTIVE): binary_sensor.binary_sensor_schema(
476 | device_class=DEVICE_CLASS_EMPTY
477 | ).extend(),
478 | cv.Optional(CONF_P15_ACTIVE): binary_sensor.binary_sensor_schema(
479 | device_class=DEVICE_CLASS_EMPTY
480 | ).extend(),
481 | cv.Optional(CONF_P16_ACTIVE): binary_sensor.binary_sensor_schema(
482 | device_class=DEVICE_CLASS_EMPTY
483 | ).extend(),
484 | cv.Optional(CONF_P17_ACTIVE): binary_sensor.binary_sensor_schema(
485 | device_class=DEVICE_CLASS_EMPTY
486 | ).extend(),
487 | cv.Optional(CONF_P18_ACTIVE): binary_sensor.binary_sensor_schema(
488 | device_class=DEVICE_CLASS_EMPTY
489 | ).extend(),
490 | cv.Optional(CONF_P19_ACTIVE): binary_sensor.binary_sensor_schema(
491 | device_class=DEVICE_CLASS_EMPTY
492 | ).extend(),
493 | cv.Optional(CONF_P90_ACTIVE): binary_sensor.binary_sensor_schema(
494 | device_class=DEVICE_CLASS_EMPTY
495 | ).extend(),
496 | cv.Optional(CONF_P91_ACTIVE): binary_sensor.binary_sensor_schema(
497 | device_class=DEVICE_CLASS_EMPTY
498 | ).extend(),
499 | cv.Optional(CONF_P92_ACTIVE): binary_sensor.binary_sensor_schema(
500 | device_class=DEVICE_CLASS_EMPTY
501 | ).extend(),
502 | cv.Optional(CONF_P93_ACTIVE): binary_sensor.binary_sensor_schema(
503 | device_class=DEVICE_CLASS_EMPTY
504 | ).extend(),
505 | cv.Optional(CONF_P94_ACTIVE): binary_sensor.binary_sensor_schema(
506 | device_class=DEVICE_CLASS_EMPTY
507 | ).extend(),
508 | cv.Optional(CONF_P95_ACTIVE): binary_sensor.binary_sensor_schema(
509 | device_class=DEVICE_CLASS_EMPTY
510 | ).extend(),
511 | cv.Optional(CONF_P96_ACTIVE): binary_sensor.binary_sensor_schema(
512 | device_class=DEVICE_CLASS_EMPTY
513 | ).extend(),
514 | cv.Optional(CONF_P97_ACTIVE): binary_sensor.binary_sensor_schema(
515 | device_class=DEVICE_CLASS_EMPTY
516 | ).extend(),
517 | cv.Optional(CONF_FILTER_FULL): binary_sensor.binary_sensor_schema(
518 | device_class=DEVICE_CLASS_EMPTY
519 | ).extend(),
520 | }
521 | )
522 |
523 | CONFIG_SCHEMA = cv.All(
524 | climate.CLIMATE_SCHEMA.extend(
525 | {
526 | cv.GenerateID(CONF_ID): cv.declare_id(ComfoAirComponent),
527 | cv.Required(REQUIRED_KEY_NAME): cv.string,
528 | cv.Required(CONF_PROXY_UART_ID): cv.use_id(uart),
529 | cv.Optional(CONF_RED_LED_ID): cv.use_id(switch),
530 | cv.Optional(CONF_GREEN_LED_ID): cv.use_id(switch),
531 | cv.Optional(CONF_BLUE_LED_ID): cv.use_id(switch),
532 | }
533 | )
534 | .extend(uart.UART_DEVICE_SCHEMA)
535 | .extend(comfoair_sensors_schemas)
536 | .extend(cv.COMPONENT_SCHEMA)
537 | )
538 |
539 |
540 | def to_code(config):
541 | """Generates code"""
542 | proxy_uart = yield cg.get_variable(config[CONF_PROXY_UART_ID])
543 | var = cg.new_Pvariable(config[CONF_ID])
544 | yield cg.register_component(var, config)
545 | yield uart.register_uart_device(var, config)
546 | yield climate.register_climate(var, config)
547 | cg.add(var.set_name(config[REQUIRED_KEY_NAME]))
548 | paren = yield cg.get_variable(config[CONF_UART_ID])
549 | cg.add(var.set_uart_component(paren))
550 | cg.add(var.set_proxy_uart_component(proxy_uart))
551 | if CONF_RED_LED_ID in config:
552 | red_led = yield cg.get_variable(config[CONF_RED_LED_ID])
553 | cg.add(var.set_red_led_component(red_led))
554 | if CONF_GREEN_LED_ID in config:
555 | green_led = yield cg.get_variable(config[CONF_GREEN_LED_ID])
556 | cg.add(var.set_green_led_component(green_led))
557 | if CONF_BLUE_LED_ID in config:
558 | blue_led = yield cg.get_variable(config[CONF_BLUE_LED_ID])
559 | cg.add(var.set_blue_led_component(blue_led))
560 | for k, values in helper_comfoair.items():
561 | for v in values:
562 | if not v in config:
563 | continue
564 | sens = None
565 | if k == "sensor":
566 | sens = yield sensor.new_sensor(config[v])
567 | elif k == "binary_sensor":
568 | sens = yield binary_sensor.new_binary_sensor(config[v])
569 | elif k == "text_sensor":
570 | sens = yield text_sensor.new_text_sensor(config[v])
571 | if sens is not None:
572 | func = getattr(var, "set_" + v)
573 | cg.add(func(sens))
574 |
--------------------------------------------------------------------------------
/components/comfoair/comfoair.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "esphome.h"
4 | #include "esphome/core/component.h"
5 | #include "esphome/components/api/custom_api_device.h"
6 | #include "esphome/components/climate/climate.h"
7 | #include "esphome/components/climate/climate_mode.h"
8 | #include "esphome/components/climate/climate_traits.h"
9 | #include "esphome/components/sensor/sensor.h"
10 | #include "esphome/components/switch/switch.h"
11 | #include "esphome/components/uart/uart.h"
12 | #include "registers.h"
13 |
14 | namespace esphome {
15 | namespace comfoair {
16 |
17 | static const char *TAG = "comfoair";
18 |
19 | static const uint8_t COMFOAIR_MIN_SUPPORTED_TEMP = 12;
20 | static const uint8_t COMFOAIR_MAX_SUPPORTED_TEMP = 29;
21 | static const float COMFOAIR_SUPPORTED_TEMP_STEP = 0.5f;
22 |
23 | class ComfoAirComponent : public climate::Climate, public api::CustomAPIDevice, public PollingComponent, public uart::UARTDevice {
24 | public:
25 | // Poll every 600ms
26 | ComfoAirComponent() :
27 | Climate(),
28 | PollingComponent(2000),
29 | UARTDevice() { }
30 |
31 | void setup() override {
32 | register_service(&ComfoAirComponent::control_set_operation_mode, "climate_set_operation_mode", {"exhaust_fan", "supply_fan"});
33 | register_service(&ComfoAirComponent::control_set_speeds, "climate_set_speeds", {"exhaust_fan", "supply_fan", "off", "low", "mid", "high"});
34 | register_service(&ComfoAirComponent::control_set_curmode_speeds, "climate_set_current_mode_speeds", {"exhaust", "supply"});
35 | }
36 |
37 | void control_set_operation_mode(bool exhaust, bool supply) {
38 | ESP_LOGI(TAG, "Setting operation mode target exhaust: %i, supply: %i", exhaust, supply);
39 | uint8_t command_data[CMD_SET_VENTILATION_LEVEL_LENGTH] = {
40 | exhaust ? ventilation_levels_[0] : (uint8_t)0,
41 | exhaust ? ventilation_levels_[2] : (uint8_t)0,
42 | exhaust ? ventilation_levels_[4] : (uint8_t)0,
43 | supply ? ventilation_levels_[1] : (uint8_t)0,
44 | supply ? ventilation_levels_[3] : (uint8_t)0,
45 | supply ? ventilation_levels_[5] : (uint8_t)0,
46 | exhaust ? ventilation_levels_[6] : (uint8_t)0,
47 | supply ? ventilation_levels_[7] : (uint8_t)0,
48 | (uint8_t)0x00
49 | };
50 | write_command_(CMD_SET_VENTILATION_LEVEL, command_data, sizeof(command_data));
51 | }
52 |
53 | void control_set_curmode_speeds(int exhaust, int supply) {
54 | // Default values: Abw ab 16 - Abw zu 0 - Low ab 47 - Low zu 35 - Middle ab 67 - Middle zu 50 - High ab 87 - High zu 70
55 | ESP_LOGI(TAG, "Setting speeds for level %i to: %i,%i", ventilation_level->state, exhaust, supply);
56 | uint8_t command_data[CMD_SET_VENTILATION_LEVEL_LENGTH] = {
57 | (ventilation_level->state==0x01) ? ventilation_levels_[0] : (uint8_t)exhaust,
58 | (ventilation_level->state==0x02) ? ventilation_levels_[2] : (uint8_t)exhaust,
59 | (ventilation_level->state==0x03) ? ventilation_levels_[4] : (uint8_t)exhaust,
60 | (ventilation_level->state==0x01) ? ventilation_levels_[1] : (uint8_t)supply,
61 | (ventilation_level->state==0x02) ? ventilation_levels_[3] : (uint8_t)supply,
62 | (ventilation_level->state==0x03) ? ventilation_levels_[5] : (uint8_t)supply,
63 | (ventilation_level->state==0x04) ? ventilation_levels_[6] : (uint8_t)exhaust,
64 | (ventilation_level->state==0x04) ? ventilation_levels_[7] : (uint8_t)supply,
65 | (uint8_t)0x00
66 | };
67 | write_command_(CMD_SET_VENTILATION_LEVEL, command_data, sizeof(command_data));
68 | }
69 |
70 | void control_set_speeds(bool exhaust, bool supply, int off, int low, int mid, int high) {
71 | // Default values: Abw ab 16 - Abw zu 0 - Low ab 47 - Low zu 35 - Middle ab 67 - Middle zu 50 - High ab 87 - High zu 70
72 | uint8_t command_data[CMD_SET_VENTILATION_LEVEL_LENGTH] = {
73 | !exhaust ? ventilation_levels_[0] : (uint8_t)off,
74 | !exhaust ? ventilation_levels_[2] : (uint8_t)low,
75 | !exhaust ? ventilation_levels_[4] : (uint8_t)mid,
76 | !supply ? ventilation_levels_[1] : (uint8_t)off,
77 | !supply ? ventilation_levels_[3] : (uint8_t)low,
78 | !supply ? ventilation_levels_[5] : (uint8_t)mid,
79 | !exhaust ? ventilation_levels_[6] : (uint8_t)high,
80 | !supply ? ventilation_levels_[7] : (uint8_t)high,
81 | (uint8_t)0x00
82 | };
83 | write_command_(CMD_SET_VENTILATION_LEVEL, command_data, sizeof(command_data));
84 | }
85 |
86 |
87 | /// Return the traits of this controller.
88 | climate::ClimateTraits traits() override {
89 | auto traits = climate::ClimateTraits();
90 | traits.set_supports_current_temperature(true);
91 | traits.set_visual_min_temperature(COMFOAIR_MIN_SUPPORTED_TEMP);
92 | traits.set_visual_max_temperature(COMFOAIR_MAX_SUPPORTED_TEMP);
93 | traits.set_visual_temperature_step(COMFOAIR_SUPPORTED_TEMP_STEP);
94 | traits.set_supported_fan_modes({
95 | climate::CLIMATE_FAN_AUTO,
96 | climate::CLIMATE_FAN_LOW,
97 | climate::CLIMATE_FAN_MEDIUM,
98 | climate::CLIMATE_FAN_HIGH,
99 | climate::CLIMATE_FAN_OFF,
100 | });
101 | return traits;
102 | }
103 |
104 | /// Override control to change settings of the climate device.
105 | void control(const climate::ClimateCall &call) override {
106 | if (call.get_fan_mode().has_value()) {
107 | int level;
108 |
109 | fan_mode = *call.get_fan_mode();
110 | switch (fan_mode.value()) {
111 | case climate::CLIMATE_FAN_HIGH:
112 | level = 0x04;
113 | break;
114 | case climate::CLIMATE_FAN_MEDIUM:
115 | level = 0x03;
116 | break;
117 | case climate::CLIMATE_FAN_LOW:
118 | level = 0x02;
119 | break;
120 | case climate::CLIMATE_FAN_OFF:
121 | level = 0x01;
122 | break;
123 | case climate::CLIMATE_FAN_AUTO:
124 | level = 0x00;
125 | break;
126 | case climate::CLIMATE_FAN_ON:
127 | case climate::CLIMATE_FAN_MIDDLE:
128 | case climate::CLIMATE_FAN_DIFFUSE:
129 | default:
130 | level = -1;
131 | break;
132 | }
133 |
134 | if (level >= 0) {
135 | set_level_(level);
136 | }
137 |
138 | }
139 | if (call.get_target_temperature().has_value()) {
140 | target_temperature = *call.get_target_temperature();
141 | set_comfort_temperature_(target_temperature);
142 | }
143 |
144 | publish_state();
145 | }
146 |
147 | void dump_config() override {
148 | uint8_t *p;
149 | ESP_LOGCONFIG(TAG, "ComfoAir:");
150 | //LOG_UPDATE_INTERVAL(this);
151 | p = bootloader_version_;
152 | ESP_LOGCONFIG(TAG, " Bootloader %.10s v%0d.%02d b%2d", p + 3, *p, *(p + 1), *(p + 2));
153 | p = firmware_version_;
154 | ESP_LOGCONFIG(TAG, " Firmware %.10s v%0d.%02d b%2d", p + 3, *p, *(p + 1), *(p + 2));
155 | p = connector_board_version_;
156 | ESP_LOGCONFIG(TAG, " Connector Board %.10s v%0d.%02d", p + 2, *p, *(p + 1));
157 |
158 | if (*(p + 12) != 0) {
159 | ESP_LOGCONFIG(TAG, " CC-Ease v%0d.%02d", *(p + 12) >> 4, *(p + 12) & 0x0f);
160 | }
161 | if (*(p + 13) != 0) {
162 | ESP_LOGCONFIG(TAG, " CC-Luxe v%0d.%02d", *(p + 13) >> 4, *(p + 13) & 0x0f);
163 | }
164 | }
165 |
166 | void update() override {
167 | switch(update_counter_) {
168 | case -4:
169 | write_command_(CMD_GET_BOOTLOADER_VERSION, nullptr, 0);
170 | break;
171 | case -3:
172 | write_command_(CMD_GET_FIRMWARE_VERSION, nullptr, 0);
173 | break;
174 | case -2:
175 | write_command_(CMD_GET_CONNECTOR_BOARD_VERSION, nullptr, 0);
176 | break;
177 | case -1:
178 | write_command_(CMD_GET_STATUS, nullptr, 0);
179 | break;
180 | case 0:
181 | get_fan_status_();
182 | break;
183 | case 1:
184 | get_valve_status_();
185 | break;
186 | case 2:
187 | get_sensor_data_();
188 | break;
189 | case 3:
190 | get_ventilation_level_();
191 | break;
192 | case 4:
193 | get_temperatures_();
194 | break;
195 | case 5:
196 | get_error_status_();
197 | break;
198 | case 6:
199 | get_bypass_control_status_();
200 | break;
201 | case 7:
202 | get_operation_hours_();
203 | break;
204 | case 8:
205 | get_preheating_status_();
206 | break;
207 | case 9:
208 | get_time_delay_();
209 | break;
210 | }
211 |
212 | update_counter_++;
213 | if (update_counter_ > num_update_counter_elements_)
214 | update_counter_ = 0;
215 | }
216 |
217 | void loop() override {
218 | // Proxy commands from the display.
219 | while(uart_proxy_.available() != 0) {
220 | uart_proxy_.read_byte(&proxy_data_[proxy_data_index_]);
221 | auto check = check_byte_(proxy_data_, proxy_data_index_);
222 | if (!check.has_value()) {
223 | ESP_LOGV(TAG, "Proxying command 0x%02X from confosense with %i bytes.", proxy_data_[COMMAND_IDX_MSG_ID], proxy_data_index_+1);
224 | if (data_index_ == 0) {
225 | write_array(proxy_data_, proxy_data_index_+1);
226 | flush();
227 | proxy_data_index_ = 0;
228 | } else {
229 | proxy_data_pending_ = true;
230 | }
231 | break;
232 | } else if (!*check) {
233 | // wrong data
234 | ESP_LOGV(TAG, "Byte %i of received data frame is invalid.", proxy_data_index_);
235 | proxy_data_index_ = 0;
236 | } else {
237 | proxy_data_index_++;
238 | }
239 | }
240 |
241 | while (available() != 0) {
242 | read_byte(&data_[data_index_]);
243 | auto check = check_byte_(data_, data_index_);
244 | if (!check.has_value()) {
245 | // finished
246 | ESP_LOGV(TAG, "Response 0x%02X from confosense with %i bytes.", data_[COMMAND_IDX_MSG_ID], data_index_+1);
247 | if (data_[COMMAND_ID_ACK] != COMMAND_ACK) {
248 | parse_data_();
249 | }
250 | // Proxy result to the display.
251 | uart_proxy_.write_array(data_, data_index_+1);
252 | uart_proxy_.flush();
253 | if (proxy_data_pending_) {
254 | proxy_data_pending_ = false;
255 | write_array(proxy_data_, proxy_data_index_+1);
256 | flush();
257 | proxy_data_index_ = 0;
258 | }
259 | data_index_ = 0;
260 | } else if (!*check) {
261 | // wrong data
262 | ESP_LOGV(TAG, "Byte %i of received data frame is invalid.", data_index_);
263 | data_index_ = 0;
264 | } else {
265 | // next byte
266 | data_index_++;
267 | }
268 | }
269 | }
270 |
271 | float get_setup_priority() const override { return setup_priority::DATA; }
272 |
273 | void reset_errors(void) {reset_errors_(false, true);}
274 | void reset_filters(void) {reset_errors_(true, false);}
275 | void set_level(int level) {set_level_(level);}
276 |
277 |
278 | void set_name(const char* value) {name = value;}
279 | void set_uart_component(uart::UARTComponent* parent) {set_uart_parent(parent);}
280 | void set_proxy_uart_component(uart::UARTComponent* proxy) {uart_proxy_.set_uart_parent(proxy);}
281 | void set_red_led_component(switch_::Switch* red_led) {red_led_ = red_led;}
282 | void set_green_led_component(switch_::Switch* green_led) {green_led_ = green_led;}
283 | void set_blue_led_component(switch_::Switch* blue_led) {blue_led_ = blue_led;}
284 |
285 | protected:
286 |
287 | void reset_errors_(bool filters, bool errors) {
288 | uint8_t reset_cmd[CMD_RESET_AND_SELF_TEST_LENGTH] = {errors ? (uint8_t)1 : (uint8_t)0, 0, 0, filters ? (uint8_t)1 : (uint8_t)0};
289 | write_command_(CMD_RESET_AND_SELF_TEST, reset_cmd, sizeof(reset_cmd));
290 | }
291 |
292 | void set_level_(int level) {
293 | if (level < 0 || level > 4) {
294 | ESP_LOGI(TAG, "Ignoring invalid level request: %i", level);
295 | return;
296 | }
297 |
298 | ESP_LOGI(TAG, "Setting level to: %i", level);
299 | uint8_t command[CMD_SET_LEVEL_LENGTH] = {(uint8_t) level};
300 | write_command_(CMD_SET_LEVEL, command, sizeof(command));
301 | }
302 |
303 | void set_comfort_temperature_(float temperature) {
304 | if (temperature < COMFOAIR_MIN_SUPPORTED_TEMP ||
305 | temperature > COMFOAIR_MAX_SUPPORTED_TEMP) {
306 | ESP_LOGI(TAG, "Ignoring invalid temperature request: %i", temperature);
307 | return;
308 | }
309 |
310 | ESP_LOGI(TAG, "Setting temperature to: %i", temperature);
311 | uint8_t command[CMD_SET_COMFORT_TEMPERATURE_LENGTH] = {(uint8_t) ((temperature + 20.0f) * 2.0f)};
312 | write_command_(CMD_SET_COMFORT_TEMPERATURE, command, sizeof(command));
313 | }
314 |
315 | void write_command_(const uint8_t command, const uint8_t *command_data, uint8_t command_data_length) {
316 | write_byte(COMMAND_PREFIX);
317 | write_byte(COMMAND_HEAD);
318 | write_byte(0x00);
319 | write_byte(command);
320 | write_byte(command_data_length);
321 | if (command_data_length > 0) {
322 | write_array(command_data, command_data_length);
323 | write_byte((command + command_data_length + comfoair_checksum_(command_data, command_data_length)) & 0xff);
324 | } else {
325 | write_byte(comfoair_checksum_(&command, 1));
326 | }
327 | write_byte(COMMAND_PREFIX);
328 | write_byte(COMMAND_TAIL);
329 | flush();
330 | }
331 |
332 | uint8_t comfoair_checksum_(const uint8_t *command_data, uint8_t length) const {
333 | uint8_t sum = 0xAD;
334 | bool last_seven = false;
335 | for (uint8_t i = 0; i < length; i++) {
336 | // The checksum counting logic is rather convoluted.
337 | // It counts all bytes except if two consecutive bytes are
338 | // 0x07 but only in the data section not in the header.
339 | if (command_data[i] == 0x07 && i > 2) {
340 | if (last_seven) {
341 | last_seven = false;
342 | continue;
343 | }
344 | last_seven = true;
345 | } else {
346 | last_seven = false;
347 | }
348 | sum += command_data[i];
349 | }
350 | return sum;
351 | }
352 |
353 | uint8_t comfoair_checksum_in_(const uint8_t *command_data, uint8_t length) const {
354 | uint8_t sum = 0xAD;
355 | for (uint8_t i = 0; i < length; i++) {
356 | sum += command_data[i];
357 | }
358 | return sum;
359 | }
360 |
361 | optional check_byte_(uint8_t* data, uint8_t &index) {
362 | const uint8_t byte = data[index];
363 |
364 | if (index == 0) {
365 | encountered_seven_ = false;
366 | return byte == COMMAND_PREFIX;
367 | }
368 |
369 | if (index == 1) {
370 | if (byte == COMMAND_ACK)
371 | return {};
372 | else
373 | return byte == COMMAND_HEAD;
374 | }
375 |
376 | if (index == 2)
377 | return byte == 0x00;
378 |
379 | if (index < COMMAND_LEN_HEAD)
380 | return true;
381 |
382 | uint8_t data_length = data[COMMAND_IDX_DATA];
383 |
384 | if ((COMMAND_LEN_HEAD + data_length + COMMAND_LEN_TAIL) > sizeof(data_)) {
385 | ESP_LOGW(TAG, "ComfoAir message too large");
386 | return false;
387 | }
388 |
389 | if (index < COMMAND_LEN_HEAD + data_length || encountered_seven_) {
390 | if (byte == 0x07) {
391 | if (encountered_seven_) {
392 | encountered_seven_ = false;
393 | index--;
394 | return true;
395 | }
396 | encountered_seven_ = true;
397 | } else {
398 | if (encountered_seven_)
399 | ESP_LOGW(TAG, "No 0x07 after another one encoutered %02X instead at index.", byte, index);
400 | encountered_seven_ = false;
401 | }
402 | return true;
403 | }
404 |
405 | if (index == COMMAND_LEN_HEAD + data_length) {
406 | // checksum is without checksum bytes
407 | uint8_t checksum = comfoair_checksum_in_(data + 2, COMMAND_LEN_HEAD + data_length - 2);
408 | if (checksum != byte) {
409 | //ESP_LOG_BUFFER_HEX(TAG, data_, index+1);
410 | //[10:58:52][W][comfoair:389]: ComfoAir Checksum doesn't match: 0x07!=0xDD (4 3E 09 FA 07 07 00 00 C8)
411 | ESP_LOGW(TAG, "Checksum mismatch: r:0x%02X!=c:0x%02X (l:%d cmd:%02X [%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X])", byte, checksum, data_length, data[COMMAND_IDX_MSG_ID], data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10], data[11], data[12], data[13], data[14], data[15], data[16], data[17], data[18], data[19], data[20], data[21], data[22], data[23], data[24], data[25]);
412 | // Still can't find what is wrong with those checksums.
413 | //if (data[COMMAND_IDX_MSG_ID] == 0x3e || data[COMMAND_IDX_MSG_ID] == 0xe6 || data[COMMAND_IDX_MSG_ID] == 0xec)
414 | // return true;
415 | return false;
416 | }
417 | return true;
418 | }
419 |
420 | if (index == COMMAND_LEN_HEAD + data_length + 1)
421 | return byte == COMMAND_PREFIX;
422 |
423 | if (index == COMMAND_LEN_HEAD + data_length + 2) {
424 | if (byte != COMMAND_TAIL)
425 | return false;
426 | }
427 |
428 | return {};
429 | }
430 |
431 | void parse_data_() {
432 | status_clear_warning();
433 | uint8_t *msg = &data_[COMMAND_LEN_HEAD];
434 |
435 | switch (data_[COMMAND_IDX_MSG_ID]) {
436 | case RES_GET_BOOTLOADER_VERSION:
437 | memcpy(bootloader_version_, msg, data_[COMMAND_IDX_DATA]);
438 | break;
439 | case RES_GET_FIRMWARE_VERSION:
440 | memcpy(firmware_version_, msg, data_[COMMAND_IDX_DATA]);
441 | break;
442 | case RES_GET_CONNECTOR_BOARD_VERSION:
443 | memcpy(connector_board_version_, msg, data_[COMMAND_IDX_DATA]);
444 | break;
445 | case RES_GET_FAN_STATUS: {
446 | if (intake_fan_speed != nullptr) {
447 | intake_fan_speed->publish_state(msg[0]);
448 | }
449 | if (exhaust_fan_speed != nullptr) {
450 | exhaust_fan_speed->publish_state(msg[1]);
451 | }
452 | if (intake_fan_speed_rpm != nullptr) {
453 | intake_fan_speed_rpm->publish_state(1875000.0f / get_uint16_(2));
454 | }
455 | if (exhaust_fan_speed_rpm != nullptr) {
456 | exhaust_fan_speed_rpm->publish_state(1875000.0f / get_uint16_(4));
457 | }
458 | break;
459 | }
460 | case RES_GET_VALVE_STATUS: {
461 | if (bypass_valve != nullptr) {
462 | bypass_valve->publish_state(msg[0]);
463 | }
464 | if (bypass_valve_open != nullptr) {
465 | bypass_valve_open->publish_state(msg[0] != 0);
466 | }
467 | if (preheating_state != nullptr) {
468 | preheating_state->publish_state(msg[1] != 0);
469 | }
470 | if (motor_current_bypass != nullptr) {
471 | motor_current_bypass->publish_state(msg[2]);
472 | }
473 | if (motor_current_preheating != nullptr) {
474 | motor_current_preheating->publish_state(msg[3]);
475 | }
476 | break;
477 | }
478 | case RES_GET_BYPASS_CONTROL_STATUS: {
479 | if (bypass_factor != nullptr) {
480 | bypass_factor->publish_state(msg[2]);
481 | }
482 | if (bypass_step != nullptr) {
483 | bypass_step->publish_state(msg[3]);
484 | }
485 | if (bypass_correction != nullptr) {
486 | bypass_correction->publish_state(msg[4]);
487 | }
488 | if (summer_mode != nullptr) {
489 | summer_mode->publish_state(msg[6] != 0);
490 | }
491 | break;
492 | }
493 | case RES_GET_TEMPERATURE_STATUS: {
494 |
495 | // T1 / outside air
496 | if (outside_air_temperature != nullptr) {
497 | outside_air_temperature->publish_state((float) msg[0] / 2.0f - 20.0f);
498 | }
499 | // T2 / supply air
500 | if (supply_air_temperature != nullptr) {
501 | supply_air_temperature->publish_state((float) msg[1] / 2.0f - 20.0f);
502 | }
503 | // T3 / return air
504 | if (return_air_temperature != nullptr) {
505 | return_air_temperature->publish_state((float) msg[2] / 2.0f - 20.0f);
506 | }
507 | // T4 / exhaust air
508 | if (exhaust_air_temperature != nullptr) {
509 | exhaust_air_temperature->publish_state((float) msg[3] / 2.0f - 20.0f);
510 | }
511 | break;
512 | }
513 | case RES_GET_SENSOR_DATA: {
514 |
515 | if (enthalpy_temperature != nullptr) {
516 | enthalpy_temperature->publish_state((float) msg[0] / 2.0f - 20.0f);
517 | }
518 |
519 | break;
520 | }
521 | case RES_GET_VENTILATION_LEVEL: {
522 |
523 | ESP_LOGD(TAG, "Level %02x", msg[8]);
524 | ESP_LOGW(TAG, "Off ab %i - Off zu %i - Low ab %i - Low zu %i - Middle ab %i - Middle zu %i - High ab %i - High zu %i", msg[0], msg[3], msg[1], msg[4], msg[2], msg[5], msg[10], msg[11]);
525 |
526 | if (return_air_level != nullptr) {
527 | return_air_level->publish_state(msg[6]);
528 | }
529 | if (supply_air_level != nullptr) {
530 | supply_air_level->publish_state(msg[7]);
531 | }
532 |
533 | if (ventilation_level != nullptr) {
534 | ventilation_level->publish_state(msg[8] - 1);
535 | }
536 |
537 | // Fan Speed
538 | switch(msg[8]) {
539 | case 0x00:
540 | fan_mode = climate::CLIMATE_FAN_AUTO;
541 | mode = climate::CLIMATE_MODE_FAN_ONLY;
542 | green_led_->turn_on();
543 | red_led_->turn_off();
544 | break;
545 | case 0x01:
546 | fan_mode = climate::CLIMATE_FAN_OFF;
547 | mode = climate::CLIMATE_MODE_OFF;
548 | green_led_->turn_off();
549 | red_led_->turn_off();
550 | break;
551 | case 0x02:
552 | fan_mode = climate::CLIMATE_FAN_LOW;
553 | mode = climate::CLIMATE_MODE_FAN_ONLY;
554 | green_led_->turn_on();
555 | red_led_->turn_off();
556 | break;
557 | case 0x03:
558 | fan_mode = climate::CLIMATE_FAN_MEDIUM;
559 | mode = climate::CLIMATE_MODE_FAN_ONLY;
560 | green_led_->turn_on();
561 | red_led_->turn_on();
562 | break;
563 | case 0x04:
564 | fan_mode = climate::CLIMATE_FAN_HIGH;
565 | mode = climate::CLIMATE_MODE_FAN_ONLY;
566 | green_led_->turn_off();
567 | red_led_->turn_on();
568 | break;
569 | }
570 |
571 | publish_state();
572 |
573 | // Supply air fan active (1 = active / 0 = inactive)
574 | if (supply_fan_active != nullptr) {
575 | supply_fan_active->publish_state(msg[9] == 1);
576 | }
577 |
578 | // Record current speeds for resetting them if needed.
579 | if (msg[0]) ventilation_levels_[0] = msg[0];
580 | if (msg[3]) ventilation_levels_[1] = msg[3];
581 | if (msg[1]) ventilation_levels_[2] = msg[1];
582 | if (msg[4]) ventilation_levels_[3] = msg[4];
583 | if (msg[2]) ventilation_levels_[4] = msg[2];
584 | if (msg[5]) ventilation_levels_[5] = msg[5];
585 | if (msg[10]) ventilation_levels_[6] = msg[10];
586 | if (msg[11]) ventilation_levels_[7] = msg[11];
587 | break;
588 | }
589 | case RES_GET_FAULTS: {
590 | if (msg[8] != 0)
591 | blue_led_->turn_on();
592 | else
593 | blue_led_->turn_off();
594 |
595 | if (filter_status != nullptr) {
596 | uint8_t status = msg[8];
597 | filter_status->publish_state(status == 0 ? "Ok" : (status == 1 ? "Full" : "Unknown"));
598 | }
599 |
600 | if (filter_full != nullptr)
601 | filter_full->publish_state(msg[8] != 0);
602 | break;
603 | }
604 | case RES_GET_TEMPERATURES: {
605 |
606 | // comfort temperature
607 | target_temperature = (float) msg[0] / 2.0f - 20.0f;
608 | current_temperature = (float) msg[3] / 2.0f - 20.0f;
609 | publish_state();
610 |
611 | // T1 / outside air
612 | if (outside_air_temperature != nullptr && msg[5] & 0x01) {
613 | outside_air_temperature->publish_state((float) msg[1] / 2.0f - 20.0f);
614 | }
615 | // T2 / supply air
616 | if (supply_air_temperature != nullptr && msg[5] & 0x02) {
617 | supply_air_temperature->publish_state((float) msg[2] / 2.0f - 20.0f);
618 | }
619 | // T3 / exhaust air
620 | if (return_air_temperature != nullptr && msg[5] & 0x04) {
621 | return_air_temperature->publish_state((float) msg[3] / 2.0f - 20.0f);
622 | }
623 | // T4 / continued air
624 | if (exhaust_air_temperature != nullptr && msg[5] & 0x08) {
625 | exhaust_air_temperature->publish_state((float) msg[4] / 2.0f - 20.0f);
626 | }
627 | // EWT
628 | if (ewt_temperature != nullptr && msg[5] & 0x10) {
629 | ewt_temperature->publish_state((float) msg[6] / 2.0f - 20.0f);
630 | }
631 | // reheating
632 | if (reheating_temperature != nullptr && msg[5] & 0x20) {
633 | reheating_temperature->publish_state((float) msg[7] / 2.0f - 20.0f);
634 | }
635 | // kitchen hood
636 | if (kitchen_hood_temperature != nullptr && msg[5] & 0x40) {
637 | kitchen_hood_temperature->publish_state((float) msg[8] / 2.0f - 20.0f);
638 | }
639 |
640 | break;
641 | }
642 | case RES_GET_STATUS: {
643 | if (preheating_present != nullptr) {
644 | preheating_present->publish_state(msg[0]);
645 | }
646 |
647 | if (bypass_present != nullptr) {
648 | bypass_present->publish_state(msg[1]);
649 | }
650 |
651 | if (type != nullptr) {
652 | type->publish_state(msg[2] == 1 ? "Left" : (msg[2] == 2 ? "Right" : "Unknown"));
653 | }
654 |
655 | if (size != nullptr) {
656 | size->publish_state(msg[3] == 1 ? "Large" : (msg[3] == 2 ? "Small" : "Unknown"));
657 | }
658 |
659 | if (options_present != nullptr) {
660 | options_present->publish_state(msg[4]);
661 | }
662 |
663 | if (fireplace_present != nullptr) {
664 | fireplace_present->publish_state(msg[4] & 0x01);
665 | }
666 |
667 | if (kitchen_hood_present != nullptr) {
668 | kitchen_hood_present->publish_state(msg[4] & 0x02);
669 | }
670 |
671 | if (postheating_present != nullptr) {
672 | postheating_present->publish_state(msg[4] & 0x04);
673 | }
674 |
675 | if (postheating_pwm_mode_present != nullptr) {
676 | postheating_pwm_mode_present->publish_state(msg[4] & 0x40);
677 | }
678 |
679 | if (p10_active != nullptr) {
680 | p10_active->publish_state(msg[6] & 0x01);
681 | }
682 |
683 | if (p11_active != nullptr) {
684 | p11_active->publish_state(msg[6] & 0x02);
685 | }
686 |
687 | if (p12_active != nullptr) {
688 | p12_active->publish_state(msg[6] & 0x04);
689 | }
690 |
691 | if (p13_active != nullptr) {
692 | p13_active->publish_state(msg[6] & 0x08);
693 | }
694 |
695 | if (p14_active != nullptr) {
696 | p14_active->publish_state(msg[6] & 0x10);
697 | }
698 |
699 | if (p15_active != nullptr) {
700 | p15_active->publish_state(msg[6] & 0x20);
701 | }
702 |
703 | if (p16_active != nullptr) {
704 | p16_active->publish_state(msg[6] & 0x40);
705 | }
706 |
707 | if (p17_active != nullptr) {
708 | p17_active->publish_state(msg[6] & 0x80);
709 | }
710 |
711 | if (p18_active != nullptr) {
712 | p18_active->publish_state(msg[7] & 0x01);
713 | }
714 |
715 | if (p19_active != nullptr) {
716 | p19_active->publish_state(msg[7] & 0x02);
717 | }
718 |
719 | if (p90_active != nullptr) {
720 | p90_active->publish_state(msg[8] & 0x01);
721 | }
722 |
723 | if (p91_active != nullptr) {
724 | p91_active->publish_state(msg[8] & 0x02);
725 | }
726 |
727 | if (p92_active != nullptr) {
728 | p92_active->publish_state(msg[8] & 0x04);
729 | }
730 |
731 | if (p93_active != nullptr) {
732 | p93_active->publish_state(msg[8] & 0x08);
733 | }
734 |
735 | if (p94_active != nullptr) {
736 | p94_active->publish_state(msg[8] & 0x10);
737 | }
738 |
739 | if (p95_active != nullptr) {
740 | p95_active->publish_state(msg[8] & 0x20);
741 | }
742 |
743 | if (p96_active != nullptr) {
744 | p96_active->publish_state(msg[8] & 0x40);
745 | }
746 |
747 | if (p97_active != nullptr) {
748 | p97_active->publish_state(msg[8] & 0x80);
749 | }
750 |
751 | if (enthalpy_present != nullptr) {
752 | enthalpy_present->publish_state(msg[9]);
753 | }
754 |
755 | if (ewt_present != nullptr) {
756 | ewt_present->publish_state(msg[10]);
757 | }
758 | break;
759 | }
760 | case RES_GET_OPERATION_HOURS: {
761 | if (level0_hours != nullptr) {
762 | level0_hours->publish_state((msg[0] << 16) | (msg[1] << 8) | msg[2]);
763 | }
764 |
765 | if (level1_hours != nullptr) {
766 | level1_hours->publish_state((msg[3] << 16) | (msg[4] << 8) | msg[5]);
767 | }
768 |
769 | if (level2_hours != nullptr) {
770 | level2_hours->publish_state((msg[6] << 16) | (msg[7] << 8) | msg[8]);
771 | }
772 |
773 | if (level3_hours != nullptr) {
774 | level3_hours->publish_state((msg[17] << 16) | (msg[18] << 8) | msg[19]);
775 | }
776 |
777 | if (frost_protection_hours != nullptr) {
778 | frost_protection_hours->publish_state((msg[9] << 8) | msg[10]);
779 | }
780 |
781 | if (bypass_open_hours != nullptr) {
782 | bypass_open_hours->publish_state((msg[13] << 8) | msg[14]);
783 | }
784 |
785 | if (preheating_hours != nullptr) {
786 | preheating_hours->publish_state((msg[11] << 8) | msg[12]);
787 | }
788 |
789 | if (filter_hours != nullptr) {
790 | filter_hours->publish_state((msg[15] << 8) | msg[16]);
791 | }
792 | break;
793 | }
794 |
795 | case RES_GET_PREHEATING_STATUS: {
796 | if (preheating_valve != nullptr) {
797 | std::string name_preheating_valve;
798 | switch (msg[0]) {
799 | case 0:
800 | name_preheating_valve = "Closed";
801 | break;
802 |
803 | case 1:
804 | name_preheating_valve = "Open";
805 | break;
806 |
807 | default:
808 | name_preheating_valve = "Unknown";
809 | break;
810 | }
811 | preheating_valve->publish_state(name_preheating_valve);
812 | }
813 |
814 | if (frost_protection_active != nullptr) {
815 | frost_protection_active->publish_state(msg[1] != 0);
816 | }
817 |
818 | if (preheating_state != nullptr) {
819 | preheating_state->publish_state(msg[2] != 0);
820 | }
821 |
822 | if (frost_protection_minutes != nullptr) {
823 | frost_protection_minutes->publish_state((msg[3] << 8) | msg[4]);
824 | }
825 |
826 | if (frost_protection_level != nullptr) {
827 | std::string name_frost_protection_level;
828 | switch (msg[5]) {
829 | case 0:
830 | name_frost_protection_level = "GuaranteedProtection";
831 | break;
832 |
833 | case 1:
834 | name_frost_protection_level = "HighProtection";
835 | break;
836 |
837 | case 2:
838 | name_frost_protection_level = "NominalProtection";
839 | break;
840 |
841 | case 3:
842 | name_frost_protection_level = "Economy";
843 | break;
844 |
845 | default:
846 | name_frost_protection_level = "Unknown";
847 | break;
848 | }
849 | frost_protection_level->publish_state(name_frost_protection_level);
850 | }
851 | break;
852 | }
853 | case RES_GET_TIME_DELAY: {
854 | if (bathroom_switch_on_delay_minutes != nullptr) {
855 | bathroom_switch_on_delay_minutes->publish_state(msg[0]);
856 | }
857 |
858 | if (bathroom_switch_off_delay_minutes != nullptr) {
859 | bathroom_switch_off_delay_minutes->publish_state(msg[1]);
860 | }
861 |
862 | if (l1_switch_off_delay_minutes != nullptr) {
863 | l1_switch_off_delay_minutes->publish_state(msg[2]);
864 | }
865 |
866 | if (boost_ventilation_minutes != nullptr) {
867 | boost_ventilation_minutes->publish_state(msg[3]);
868 | }
869 |
870 | if (filter_warning_weeks != nullptr) {
871 | filter_warning_weeks->publish_state(msg[4]);
872 | }
873 |
874 | if (rf_high_time_short_minutes != nullptr) {
875 | rf_high_time_short_minutes->publish_state(msg[5]);
876 | }
877 |
878 | if (rf_high_time_long_minutes != nullptr) {
879 | rf_high_time_long_minutes->publish_state(msg[6]);
880 | }
881 |
882 | if (extractor_hood_switch_off_delay_minutes != nullptr) {
883 | extractor_hood_switch_off_delay_minutes->publish_state(msg[7]);
884 | }
885 |
886 | break;
887 | }
888 | }
889 | }
890 |
891 | void get_fan_status_() {
892 | if (intake_fan_speed != nullptr ||
893 | exhaust_fan_speed != nullptr ||
894 | intake_fan_speed_rpm != nullptr ||
895 | exhaust_fan_speed_rpm != nullptr) {
896 | ESP_LOGD(TAG, "getting fan status");
897 | write_command_(CMD_GET_FAN_STATUS, nullptr, 0);
898 | }
899 | }
900 |
901 | void get_valve_status_() {
902 | if (bypass_valve != nullptr ||
903 | bypass_valve_open != nullptr ||
904 | preheating_state != nullptr) {
905 | ESP_LOGD(TAG, "getting valve status");
906 | write_command_(CMD_GET_VALVE_STATUS, nullptr, 0);
907 | }
908 | }
909 |
910 | void get_error_status_() {
911 | if (filter_status != nullptr ||
912 | filter_full != nullptr) {
913 | ESP_LOGD(TAG, "getting error status");
914 | write_command_(CMD_GET_FAULTS, nullptr, 0);
915 | }
916 | }
917 |
918 | void get_bypass_control_status_() {
919 | if (bypass_factor != nullptr ||
920 | bypass_step != nullptr ||
921 | bypass_correction != nullptr ||
922 | summer_mode != nullptr) {
923 | ESP_LOGD(TAG, "getting bypass control");
924 | write_command_(CMD_GET_BYPASS_CONTROL_STATUS, nullptr, 0);
925 | }
926 | }
927 |
928 | void get_temperature_() {
929 | if (outside_air_temperature != nullptr ||
930 | supply_air_temperature != nullptr ||
931 | return_air_temperature != nullptr ||
932 | outside_air_temperature != nullptr) {
933 | ESP_LOGD(TAG, "getting temperature");
934 | write_command_(CMD_GET_TEMPERATURE_STATUS, nullptr, 0);
935 | }
936 | }
937 |
938 | void get_sensor_data_() {
939 | if (enthalpy_temperature != nullptr) {
940 | ESP_LOGD(TAG, "getting sensor data");
941 | write_command_(CMD_GET_SENSOR_DATA, nullptr, 0);
942 | }
943 | }
944 |
945 | void get_ventilation_level_() {
946 | ESP_LOGD(TAG, "getting ventilation level");
947 | write_command_(CMD_GET_VENTILATION_LEVEL, nullptr, 0);
948 | }
949 |
950 | void get_temperatures_() {
951 | ESP_LOGD(TAG, "getting temperatures");
952 | write_command_(CMD_GET_TEMPERATURES, nullptr, 0);
953 | }
954 |
955 | void get_operation_hours_() {
956 | ESP_LOGD(TAG, "getting operation hours");
957 | write_command_(CMD_GET_OPERATION_HOURS, nullptr, 0);
958 | }
959 |
960 | void get_preheating_status_() {
961 | ESP_LOGD(TAG, "getting preheating status");
962 | write_command_(CMD_GET_PREHEATING_STATUS, nullptr, 0);
963 | }
964 |
965 | void get_time_delay_() {
966 | ESP_LOGD(TAG, "getting time delay");
967 | write_command_(CMD_GET_TIME_DELAY, nullptr, 0);
968 | }
969 |
970 | uint8_t get_uint8_t_(uint8_t start_index) const {
971 | return data_[COMMAND_LEN_HEAD + start_index];
972 | }
973 |
974 | uint16_t get_uint16_(uint8_t start_index) const {
975 | return (uint16_t(data_[COMMAND_LEN_HEAD + start_index + 1] | data_[COMMAND_LEN_HEAD + start_index] << 8));
976 | }
977 |
978 | uint8_t data_[30];
979 | uint8_t data_index_{0};
980 | uint8_t proxy_data_[30];
981 | uint8_t proxy_data_index_{0};
982 | bool encountered_seven_{false};
983 | bool proxy_data_pending_{false};
984 |
985 | int8_t update_counter_{-4};
986 | const int8_t num_update_counter_elements_{9};
987 |
988 | uint8_t ventilation_levels_[8];
989 |
990 | uint8_t bootloader_version_[13]{0};
991 | uint8_t firmware_version_[13]{0};
992 | uint8_t connector_board_version_[14]{0};
993 | const char* name{0};
994 |
995 | uart::UARTDevice uart_proxy_;
996 | switch_::Switch* red_led_;
997 | switch_::Switch* green_led_;
998 | switch_::Switch* blue_led_;
999 |
1000 | public:
1001 | text_sensor::TextSensor *type{nullptr};
1002 | text_sensor::TextSensor *size{nullptr};
1003 | text_sensor::TextSensor *filter_status{nullptr};
1004 | binary_sensor::BinarySensor *filter_full{nullptr};
1005 | text_sensor::TextSensor *frost_protection_level{nullptr};
1006 | text_sensor::TextSensor *preheating_valve{nullptr};
1007 | sensor::Sensor *intake_fan_speed{nullptr};
1008 | sensor::Sensor *exhaust_fan_speed{nullptr};
1009 | sensor::Sensor *intake_fan_speed_rpm{nullptr};
1010 | sensor::Sensor *exhaust_fan_speed_rpm{nullptr};
1011 | sensor::Sensor *ventilation_level{nullptr};
1012 | sensor::Sensor *outside_air_temperature{nullptr};
1013 | sensor::Sensor *supply_air_temperature{nullptr};
1014 | sensor::Sensor *return_air_temperature{nullptr};
1015 | sensor::Sensor *exhaust_air_temperature{nullptr};
1016 | sensor::Sensor *enthalpy_temperature{nullptr};
1017 | sensor::Sensor *ewt_temperature{nullptr};
1018 | sensor::Sensor *reheating_temperature{nullptr};
1019 | sensor::Sensor *kitchen_hood_temperature{nullptr};
1020 | sensor::Sensor *return_air_level{nullptr};
1021 | sensor::Sensor *supply_air_level{nullptr};
1022 | sensor::Sensor *bypass_factor{nullptr};
1023 | sensor::Sensor *bypass_step{nullptr};
1024 | sensor::Sensor *bypass_correction{nullptr};
1025 | sensor::Sensor *bypass_open_hours{nullptr};
1026 | sensor::Sensor *motor_current_bypass{nullptr};
1027 | sensor::Sensor *motor_current_preheating{nullptr};
1028 | sensor::Sensor *preheating_hours{nullptr};
1029 | sensor::Sensor *level0_hours{nullptr};
1030 | sensor::Sensor *level1_hours{nullptr};
1031 | sensor::Sensor *level2_hours{nullptr};
1032 | sensor::Sensor *level3_hours{nullptr};
1033 | binary_sensor::BinarySensor *frost_protection_active{nullptr};
1034 | sensor::Sensor *frost_protection_hours{nullptr};
1035 | sensor::Sensor *frost_protection_minutes{nullptr};
1036 | sensor::Sensor *filter_hours{nullptr};
1037 | sensor::Sensor *bypass_valve{nullptr};
1038 | binary_sensor::BinarySensor *bypass_present{nullptr};
1039 | binary_sensor::BinarySensor *enthalpy_present{nullptr};
1040 | binary_sensor::BinarySensor *ewt_present{nullptr};
1041 | binary_sensor::BinarySensor *preheating_present{nullptr};
1042 | binary_sensor::BinarySensor *options_present{nullptr};
1043 | binary_sensor::BinarySensor *fireplace_present{nullptr};
1044 | binary_sensor::BinarySensor *kitchen_hood_present{nullptr};
1045 | binary_sensor::BinarySensor *postheating_present{nullptr};
1046 | binary_sensor::BinarySensor *postheating_pwm_mode_present{nullptr};
1047 | binary_sensor::BinarySensor *bypass_valve_open{nullptr};
1048 | binary_sensor::BinarySensor *preheating_state{nullptr};
1049 | binary_sensor::BinarySensor *summer_mode{nullptr};
1050 | binary_sensor::BinarySensor *supply_fan_active{nullptr};
1051 | binary_sensor::BinarySensor *p10_active{nullptr};
1052 | binary_sensor::BinarySensor *p11_active{nullptr};
1053 | binary_sensor::BinarySensor *p12_active{nullptr};
1054 | binary_sensor::BinarySensor *p13_active{nullptr};
1055 | binary_sensor::BinarySensor *p14_active{nullptr};
1056 | binary_sensor::BinarySensor *p15_active{nullptr};
1057 | binary_sensor::BinarySensor *p16_active{nullptr};
1058 | binary_sensor::BinarySensor *p17_active{nullptr};
1059 | binary_sensor::BinarySensor *p18_active{nullptr};
1060 | binary_sensor::BinarySensor *p19_active{nullptr};
1061 | binary_sensor::BinarySensor *p90_active{nullptr};
1062 | binary_sensor::BinarySensor *p91_active{nullptr};
1063 | binary_sensor::BinarySensor *p92_active{nullptr};
1064 | binary_sensor::BinarySensor *p93_active{nullptr};
1065 | binary_sensor::BinarySensor *p94_active{nullptr};
1066 | binary_sensor::BinarySensor *p95_active{nullptr};
1067 | binary_sensor::BinarySensor *p96_active{nullptr};
1068 | binary_sensor::BinarySensor *p97_active{nullptr};
1069 | sensor::Sensor *bathroom_switch_on_delay_minutes{nullptr};
1070 | sensor::Sensor *bathroom_switch_off_delay_minutes{nullptr};
1071 | sensor::Sensor *l1_switch_off_delay_minutes{nullptr};
1072 | sensor::Sensor *boost_ventilation_minutes{nullptr};
1073 | sensor::Sensor *filter_warning_weeks{nullptr};
1074 | sensor::Sensor *rf_high_time_short_minutes{nullptr};
1075 | sensor::Sensor *rf_high_time_long_minutes{nullptr};
1076 | sensor::Sensor *extractor_hood_switch_off_delay_minutes{nullptr};
1077 |
1078 | void set_type(text_sensor::TextSensor *type) { this->type = type; };
1079 | void set_size(text_sensor::TextSensor *size) { this->size = size; };
1080 | void set_intake_fan_speed(sensor::Sensor *intake_fan_speed) { this->intake_fan_speed = intake_fan_speed; };
1081 | void set_exhaust_fan_speed(sensor::Sensor *exhaust_fan_speed) { this->exhaust_fan_speed = exhaust_fan_speed; };
1082 | void set_intake_fan_speed_rpm(sensor::Sensor *intake_fan_speed_rpm) { this->intake_fan_speed_rpm = intake_fan_speed_rpm; };
1083 | void set_exhaust_fan_speed_rpm(sensor::Sensor *exhaust_fan_speed_rpm) { this->exhaust_fan_speed_rpm = exhaust_fan_speed_rpm; };
1084 | void set_ventilation_level(sensor::Sensor *ventilation_level) { this->ventilation_level = ventilation_level; };
1085 | void set_bypass_valve(sensor::Sensor *bypass_valve) { this->bypass_valve = bypass_valve; };
1086 | void set_bypass_present(binary_sensor::BinarySensor *bypass_present) { this->bypass_present = bypass_present; };
1087 | void set_enthalpy_present(binary_sensor::BinarySensor *enthalpy_present) { this->enthalpy_present = enthalpy_present; };
1088 | void set_ewt_present(binary_sensor::BinarySensor *ewt_present) { this->ewt_present = ewt_present; };
1089 | void set_preheating_present(binary_sensor::BinarySensor *preheating_present) { this->preheating_present = preheating_present; };
1090 | void set_options_present(binary_sensor::BinarySensor *options_present) { this->options_present = options_present; };
1091 | void set_fireplace_present(binary_sensor::BinarySensor *fireplace_present) { this->fireplace_present = fireplace_present; };
1092 | void set_kitchen_hood_present(binary_sensor::BinarySensor *kitchen_hood_present) { this->kitchen_hood_present = kitchen_hood_present; };
1093 | void set_postheating_present(binary_sensor::BinarySensor *postheating_present) { this->postheating_present = postheating_present; };
1094 | void set_postheating_pwm_mode_present(binary_sensor::BinarySensor *postheating_pwm_mode_present) { this->postheating_pwm_mode_present = postheating_pwm_mode_present; };
1095 | void set_bypass_valve_open(binary_sensor::BinarySensor *bypass_valve_open) { this->bypass_valve_open = bypass_valve_open; };
1096 | void set_preheating_state(binary_sensor::BinarySensor *preheating_state) { this->preheating_state = preheating_state; };
1097 | void set_outside_air_temperature(sensor::Sensor *outside_air_temperature) { this->outside_air_temperature = outside_air_temperature; };
1098 | void set_supply_air_temperature(sensor::Sensor *supply_air_temperature) { this->supply_air_temperature = supply_air_temperature; };
1099 | void set_return_air_temperature(sensor::Sensor *return_air_temperature) { this->return_air_temperature = return_air_temperature; };
1100 | void set_exhaust_air_temperature(sensor::Sensor *exhaust_air_temperature) { this->exhaust_air_temperature = exhaust_air_temperature; };
1101 | void set_enthalpy_temperature(sensor::Sensor *enthalpy_temperature) { this->enthalpy_temperature = enthalpy_temperature; };
1102 | void set_ewt_temperature(sensor::Sensor *ewt_temperature) { this->ewt_temperature = ewt_temperature; };
1103 | void set_reheating_temperature(sensor::Sensor *reheating_temperature) { this->reheating_temperature = reheating_temperature; };
1104 | void set_kitchen_hood_temperature(sensor::Sensor *kitchen_hood_temperature) { this->kitchen_hood_temperature = kitchen_hood_temperature; };
1105 | void set_return_air_level(sensor::Sensor *return_air_level) { this->return_air_level = return_air_level; };
1106 | void set_supply_air_level(sensor::Sensor *supply_air_level) { this->supply_air_level = supply_air_level; };
1107 | void set_supply_fan_active(binary_sensor::BinarySensor *supply_fan_active) { this->supply_fan_active = supply_fan_active; };
1108 | void set_filter_status(text_sensor::TextSensor *filter_status) { this->filter_status = filter_status; };
1109 | void set_filter_full(binary_sensor::BinarySensor *filter_full) { this->filter_full = filter_full; };
1110 | void set_bypass_factor(sensor::Sensor *bypass_factor) { this->bypass_factor = bypass_factor; };
1111 | void set_bypass_step(sensor::Sensor *bypass_step) { this->bypass_step = bypass_step; };
1112 | void set_bypass_correction(sensor::Sensor *bypass_correction) { this->bypass_correction = bypass_correction; };
1113 | void set_bypass_open_hours(sensor::Sensor *bypass_open_hours) { this->bypass_open_hours = bypass_open_hours; };
1114 | void set_motor_current_bypass(sensor::Sensor *motor_current_bypass) { this->motor_current_bypass = motor_current_bypass; };
1115 | void set_motor_current_preheating(sensor::Sensor *motor_current_preheating) { this->motor_current_preheating = motor_current_preheating; };
1116 | void set_preheating_hours(sensor::Sensor *preheating_hours) { this->preheating_hours = preheating_hours; };
1117 | void set_preheating_valve(text_sensor::TextSensor *preheating_valve) { this->preheating_valve = preheating_valve; };
1118 | void set_level0_hours(sensor::Sensor *level0_hours) { this->level0_hours = level0_hours; };
1119 | void set_level1_hours(sensor::Sensor *level1_hours) { this->level1_hours = level1_hours; };
1120 | void set_level2_hours(sensor::Sensor *level2_hours) { this->level2_hours = level2_hours; };
1121 | void set_level3_hours(sensor::Sensor *level3_hours) { this->level3_hours = level3_hours; };
1122 | void set_frost_protection_active(binary_sensor::BinarySensor *frost_protection_active) { this->frost_protection_active = frost_protection_active; };
1123 | void set_frost_protection_hours(sensor::Sensor *frost_protection_hours) { this->frost_protection_hours = frost_protection_hours; };
1124 | void set_frost_protection_minutes(sensor::Sensor *frost_protection_minutes) { this->frost_protection_minutes = frost_protection_minutes; };
1125 | void set_frost_protection_level(text_sensor::TextSensor *frost_protection_level) { this->frost_protection_level = frost_protection_level; };
1126 | void set_filter_hours(sensor::Sensor *filter_hours) { this->filter_hours = filter_hours; };
1127 | void set_summer_mode(binary_sensor::BinarySensor *summer_mode) { this->summer_mode = summer_mode; };
1128 | void set_p10_active(binary_sensor::BinarySensor *p10_active) { this->p10_active = p10_active; };
1129 | void set_p11_active(binary_sensor::BinarySensor *p11_active) { this->p11_active = p11_active; };
1130 | void set_p12_active(binary_sensor::BinarySensor *p12_active) { this->p12_active = p12_active; };
1131 | void set_p13_active(binary_sensor::BinarySensor *p13_active) { this->p13_active = p13_active; };
1132 | void set_p14_active(binary_sensor::BinarySensor *p14_active) { this->p14_active = p14_active; };
1133 | void set_p15_active(binary_sensor::BinarySensor *p15_active) { this->p15_active = p15_active; };
1134 | void set_p16_active(binary_sensor::BinarySensor *p16_active) { this->p16_active = p16_active; };
1135 | void set_p17_active(binary_sensor::BinarySensor *p17_active) { this->p17_active = p17_active; };
1136 | void set_p18_active(binary_sensor::BinarySensor *p18_active) { this->p18_active = p18_active; };
1137 | void set_p19_active(binary_sensor::BinarySensor *p19_active) { this->p19_active = p19_active; };
1138 | void set_p90_active(binary_sensor::BinarySensor *p90_active) { this->p90_active = p90_active; };
1139 | void set_p91_active(binary_sensor::BinarySensor *p91_active) { this->p91_active = p91_active; };
1140 | void set_p92_active(binary_sensor::BinarySensor *p92_active) { this->p92_active = p92_active; };
1141 | void set_p93_active(binary_sensor::BinarySensor *p93_active) { this->p93_active = p93_active; };
1142 | void set_p94_active(binary_sensor::BinarySensor *p94_active) { this->p94_active = p94_active; };
1143 | void set_p95_active(binary_sensor::BinarySensor *p95_active) { this->p95_active = p95_active; };
1144 | void set_p96_active(binary_sensor::BinarySensor *p96_active) { this->p96_active = p96_active; };
1145 | void set_p97_active(binary_sensor::BinarySensor *p97_active) { this->p97_active = p97_active; };
1146 | void set_bathroom_switch_on_delay_minutes(sensor::Sensor *bathroom_switch_on_delay_minutes) { this->bathroom_switch_on_delay_minutes = bathroom_switch_on_delay_minutes; };
1147 | void set_bathroom_switch_off_delay_minutes(sensor::Sensor *bathroom_switch_off_delay_minutes) { this->bathroom_switch_off_delay_minutes = bathroom_switch_off_delay_minutes; };
1148 | void set_l1_switch_off_delay_minutes(sensor::Sensor *l1_switch_off_delay_minutes) { this->l1_switch_off_delay_minutes = l1_switch_off_delay_minutes; };
1149 | void set_boost_ventilation_minutes(sensor::Sensor *boost_ventilation_minutes) { this->boost_ventilation_minutes = boost_ventilation_minutes; };
1150 | void set_filter_warning_weeks(sensor::Sensor *filter_warning_weeks) { this->filter_warning_weeks = filter_warning_weeks; };
1151 | void set_rf_high_time_short_minutes(sensor::Sensor *rf_high_time_short_minutes) { this->rf_high_time_short_minutes = rf_high_time_short_minutes; };
1152 | void set_rf_high_time_long_minutes(sensor::Sensor *rf_high_time_long_minutes) { this->rf_high_time_long_minutes = rf_high_time_long_minutes; };
1153 | void set_extractor_hood_switch_off_delay_minutes(sensor::Sensor *extractor_hood_switch_off_delay_minutes) { this->extractor_hood_switch_off_delay_minutes = extractor_hood_switch_off_delay_minutes; };
1154 | };
1155 |
1156 | } // namespace comfoair
1157 | } // namespace esphome
1158 |
--------------------------------------------------------------------------------
/components/comfoair/registers.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // =================================================
4 | // ===================== CORE ======================
5 | // =================================================
6 |
7 | #define COMMAND_PREFIX 0x07
8 | #define COMMAND_HEAD 0xF0
9 | #define COMMAND_LEN_HEAD 5
10 | #define COMMAND_TAIL 0x0F
11 | #define COMMAND_LEN_TAIL 3
12 | #define COMMAND_ACK 0xF3
13 | #define COMMAND_ID_ACK 1
14 | #define COMMAND_IDX_DATA 4
15 | #define COMMAND_IDX_MSG_ID 3
16 |
17 | // =================================================
18 | // ========== Bootloader (PC an ComfoAir) ==========
19 | // =================================================
20 |
21 | /*
22 | Data: -
23 |
24 | Response: -
25 | Confirmation of bootloader mode
26 | */
27 | #define CMD_SET_BOOTLOADER_MODE 0x65
28 | #define RES_SET_BOOTLOADER_MODE 0x66
29 |
30 | /*
31 | Data: 67 bytes
32 | Byte[0] = Data byte 1
33 | Byte[1..62] = ...
34 | Byte[63] = Data byte 64
35 | Byte[64] = Start address (high byte)
36 | Byte[65] = Start address
37 | Byte[66] = Start address (low byte)
38 |
39 | Response: 1 byte
40 | Byte[0] = status
41 | 0x01 = success
42 | 0x02 = Error
43 | 0x04 = Address out of range
44 | 0x08 = data block incomplete
45 | */
46 | #define CMD_WRITE_FLASH_BLOCK 0x6F
47 | #define RES_WRITE_FLASH_BLOCK 0x70
48 |
49 | /*
50 | Data: 3 bytes
51 | Byte[0] = Start address (high byte)
52 | Byte[1] = Start address
53 | Byte[2] = Start address (low byte)
54 |
55 | Response: 64 bytes
56 | Byte[0] = Data byte 1
57 | Byte[1..62] = ...
58 | Byte[63] = Data byte 64
59 | */
60 | #define CMD_READ_FLASH_BLOCK 0x71
61 | #define RES_READ_FLASH_BLOCK 0x72
62 |
63 | /*
64 | Data: -
65 |
66 | Response: -
67 | Confirmation of end of bootloader mode
68 | */
69 | #define CMD_EXIT_BOOTLOADER_MODE 0x73
70 | #define RES_EXIT_BOOTLOADER_MODE 0x74
71 |
72 | // =============================================================
73 | // ========== Command list (PC to ComfoAir) / General ==========
74 | // =============================================================
75 |
76 | /*
77 | Data: -
78 |
79 | Response: 13 bytes
80 | Byte[0] = Version Major
81 | Byte[1] = Version Minor
82 | Byte[2] = Beta
83 | Byte[3-12] = Devicename (ASCII String)
84 | */
85 | #define CMD_GET_BOOTLOADER_VERSION 0x67
86 | #define RES_GET_BOOTLOADER_VERSION 0x68
87 |
88 | /*
89 | Data: -
90 |
91 | Response: 13 bytes
92 | Byte[0] = Version Major
93 | Byte[1] = Version Minor
94 | Byte[2] = Beta
95 | Byte[3-12] = Devicename (ASCII String)
96 | */
97 | #define CMD_GET_FIRMWARE_VERSION 0x69
98 | #define RES_GET_FIRMWARE_VERSION 0x6A
99 |
100 | /*
101 | Data: -
102 |
103 | Response: 14 bytes
104 | Byte[0] = Version Major
105 | Byte[1] = Version Minor
106 | Byte[2-11] = Devicename (ASCII String)
107 | Byte[12] = Version CC-Ease
108 | Bit[7..4] Version Major
109 | Bit[3..0] = Version Minor
110 | Byte[13] = Version CC-Luxe
111 | Bit[7..4] Version Major
112 | Bit[3..0] = Version Minor
113 | */
114 | #define CMD_GET_CONNECTOR_BOARD_VERSION 0xA1
115 | #define RES_GET_CONNECTOR_BOARD_VERSION 0xA2
116 |
117 | /*
118 | Data: 1 byte
119 | Byte[0] = 0x00 = end
120 | 0x01 = PC only
121 | 0x03 = PC master
122 | 0x04 = PC log mode
123 |
124 | Response: 1 byte
125 | Byte[0] = 0x00 = Without connection
126 | 0x01 = PC only
127 | 0x02 = CC Ease only
128 | 0x03 = PC master
129 | 0x04 = PC log mode
130 | */
131 | #define CMD_SET_RS232_MODE 0x9B
132 | #define RES_SET_RS232_MODE 0x9C
133 |
134 | // ======================================================================
135 | // ========== Command list (PC to ComfoAir) / reading commands ==========
136 | // ======================================================================
137 |
138 | /*
139 | Data: -
140 |
141 | Response: 2 bytes
142 | Byte[0] = Step switch: (1 = active / 0 = inactive)
143 | 0x01 = L1
144 | 0x02 = L2
145 | Byte[1] = Switching inputs: (1 = active / 0 = inactive)
146 | 0x01 = bathroom switch
147 | 0x02 = kitchen hood switch
148 | 0x04 = External filter
149 | 0x08 = heat recovery (WTW)
150 | 0x10 = bathroom switch 2 (luxe)
151 | */
152 | #define CMD_GET_INPUTS 0x03
153 | #define RES_GET_INPUTS 0x04
154 |
155 | /*
156 | Data: -
157 |
158 | Response: 6 bytes
159 | Byte[0] = Supply air (%)
160 | Byte[1] = Exhaust air (%)
161 | Byte[2..3] = Supply air fan speed (rpm**)
162 | Byte[4..5] = Exhaust air fan speed (rpm**)
163 | */
164 | #define CMD_GET_FAN_STATUS 0x0B
165 | #define RES_GET_FAN_STATUS 0x0C
166 |
167 | /*
168 | Data: -
169 |
170 | Response: 4 bytes
171 | Byte[0] = Bypass (%) (0xFF = undefined)
172 | Byte[1] = Preheating (1 = Open / 0 = Closed / 2 = Unknown)
173 | Byte[2] = Bypass motor current (ADC raw data)
174 | Byte[3] = Preheating motor current (ADC raw data)
175 | */
176 | #define CMD_GET_VALVE_STATUS 0x0D
177 | #define RES_GET_VALVE_STATUS 0x0E
178 |
179 | /*
180 | Data: -
181 |
182 | Response: 4 bytes
183 | Byte[0] = T1 / outside air (°C*)
184 | Byte[1] = T2 / supply air (°C*)
185 | Byte[2] = T3 / exhaust air (in) (°C*)
186 | Byte[3] = T4 / exhaust air (out) (°C*)
187 | */
188 | #define CMD_GET_TEMPERATURE_STATUS 0x0F
189 | #define RES_GET_TEMPERATURE_STATUS 0x10
190 |
191 | /*
192 | Data: -
193 |
194 | Response: 1 byte
195 | Byte[0] = 0x00 = Nothing pressed
196 | 0xFF = Error
197 | */
198 | #define CMD_GET_BUTTON_STATUS 0x11
199 | #define RES_GET_BUTTON_STATUS 0x12
200 |
201 | /*
202 | Data: -
203 |
204 | Response: 4 bytes
205 | Byte[0] = Analog 1 (0..255 = 0..10V)
206 | Byte[1] = Analog 2 (0..255 = 0..10V)
207 | Byte[2] = Analog 3 (0..255 = 0..10V)
208 | Byte[3] = Analog 4 (0..255 = 0..10V)
209 | */
210 | #define CMD_GET_ANALOG_INPUTS 0x13
211 | #define RES_GET_ANALOG_INPUTS 0x14
212 |
213 | /*
214 | Data: -
215 |
216 | Response: 17 bytes
217 | Byte[0] = Enthalpy sensor temperature (°C*)
218 | Byte[1] = Enthalpy sensor humidity (%)
219 | Byte[2] = Analog 1 (%)
220 | Byte[3] = Analog 2 (%)
221 | Byte[4] = Enthalpy coefficient (%)
222 | Byte[5] = Enthalpy Timer (0..240 = 0..2880 Min)
223 | Byte[6] = 0x00
224 | Byte[7] = Analog 1 to desired (%)
225 | Byte[8] = Analog 1 from desired (%)
226 | Byte[9] = Analog 2 to desired (%)
227 | Byte[10] = Analog 2 from desired (%)
228 | Byte[11] = Analog 3 (%)
229 | Byte[12] = Analog 4 (%)
230 | Byte[13] = Analog 3 to desired (%)
231 | Byte[14] = Analog 3 from desired (%)
232 | Byte[15] = Analog 4 to desired (%)
233 | Byte[16] = Analog 4 from desired (%)
234 | */
235 | #define CMD_GET_SENSOR_DATA 0x97
236 | #define RES_GET_SENSOR_DATA 0x98
237 |
238 | /*
239 | Data: -
240 |
241 | Response: 19 bytes
242 | Byte[0] = Analogously present: (1 = present / 0 = absent)
243 | 0x01 = Analog 1
244 | 0x02 = Analog 2
245 | 0x04 = Analog 3
246 | 0x08 = Analog 4
247 | 0x10 = RF
248 | Byte[1] = Regulate / control analogously: (1 = regulate / 0 = control)
249 | 0x01 = Analog 1
250 | 0x02 = Analog 2
251 | 0x04 = Analog 3
252 | 0x08 = Analog 4
253 | 0x10 = RF
254 | Byte[2] = Analogue positive / negative: (1 = negative / 0 = positive)
255 | 0x01 = Analog 1
256 | 0x02 = Analog 2
257 | 0x04 = Analog 3
258 | 0x08 = Analog 4
259 | 0x10 = RF
260 | Byte[3] = Analog 1 Min. Setting (%)
261 | Byte[4] = Analog 1 Max. Setting (%)
262 | Byte[5] = Analog 1 setpoint (%)
263 | Byte[6] = Analogue 2 min. setting (%)
264 | Byte[7] = Analog 2 Max. Setting (%)
265 | Byte[8] = Analog 2 setpoint (%)
266 | Byte[9] = Analogue 3 min. setting (%)
267 | Byte[10] = Analog 3 Max. Setting (%)
268 | Byte[11] = Analog 3 setpoint (%)
269 | Byte[12] = Analogue 4 min. setting (%)
270 | Byte[13] = Analog 4 Max Setting (%)
271 | Byte[14] = Analog 4 setpoint (%)
272 | Byte[15] = Analog RF Min. Setting (%)
273 | Byte[16] = Analog RF Max Setting (%)
274 | Byte[17] = Analog RF setpoint (%)
275 | Byte[18] = Priority control (0 = analog inputs / 1 = weekly program)
276 | */
277 | #define CMD_GET_ANALOG_VALUES 0x9D
278 | #define RES_GET_ANALOG_VALUES 0x9E
279 |
280 | /*
281 | Data: -
282 |
283 | Response: 8 bytes
284 | Byte[0] = Bathroom switch switch-on delay (min)
285 | Byte[1] = Bathroom switch switch-off delay (min)
286 | Byte[2] = L1 switch-off delay (min)
287 | Byte[3] = Shock ventilation (min)
288 | Byte[4] = Filter counter (weeks)
289 | Byte[5] = RF high time short (min)
290 | Byte[6] = RF high time long (min)
291 | Byte[7] = Kitchen hood switch-off delay (min)
292 | */
293 | #define CMD_GET_TIME_DELAY 0xC9
294 | #define RES_GET_TIME_DELAY 0xCA
295 |
296 | /*
297 | Data: -
298 |
299 | Response: 14 bytes
300 | Byte[0] = Exhaust air absent (%)
301 | Byte[1] = Exhaust air low / level 1 (%)
302 | Byte[2] = Exhaust air medium / level 2 (%)
303 | Byte[3] = Supply air level absent (%)
304 | Byte[4] = Supply air low / level 1 (%)
305 | Byte[5] = Supply air medium / level 2 (%)
306 | Byte[6] = Current exhaust air (%)
307 | Byte[7] = Current supply air (%)
308 | Byte[8] = Current level (see command 0x00 0x99)
309 | Byte[9] = Supply air fan active (1 = active / 0 = inactive)
310 | Byte[10] = Exhaust air high / level 3 (%)
311 | Byte[11] = Supply air high / level 3 (%)
312 | Byte[12] = ..
313 | Byte[13] = ..
314 | */
315 | #define CMD_GET_VENTILATION_LEVEL 0xCD
316 | #define RES_GET_VENTILATION_LEVEL 0xCE
317 |
318 | /*
319 | Data: -
320 |
321 | Response: 9 bytes
322 | Byte[0] = Comfort temperature (°C*)
323 | Byte[1] = T1 / outside air (°C*)
324 | Byte[2] = T2 / supply air (°C*)
325 | Byte[3] = T3 / exhaust air (in) (°C*)
326 | Byte[4] = T4 / exhaust air (out) (°C*)
327 | Byte[5] = Sensor present: (1 = present / 0 = absent)
328 | 0x01 = T1 / outside air
329 | 0x02 = T2 / supply air
330 | 0x04 = T3 / exhaust air (in)
331 | 0x08 = T4 / exhaust air (out)
332 | 0x10 = EWT
333 | 0x20 = post-heating
334 | 0x40 = kitchen hood
335 | Byte[6] = Temperature EWT (°C*)
336 | Byte[7] = Temperature afterheating (°C*)
337 | Byte[8] = Temperature kitchen hood (°C*)
338 | */
339 | #define CMD_GET_TEMPERATURES 0xD1
340 | #define RES_GET_TEMPERATURES 0xD2
341 |
342 | /*
343 | Data: -
344 |
345 | Response: 11 bytes
346 | Byte[0] = Preheater present (1 = present / 0 = absent)
347 | Byte[1] = Bypass present (1 = present / 0 = absent)
348 | Byte[2] = Type (1 = left / 2 = right)
349 | Byte[3] = Size (1 = large / 2 = small)
350 | Byte[4] = Options: (1 = present / 0 = absent)
351 | 0x01 = fireplace
352 | 0x02 = kitchen hood
353 | 0x04 = post-heating
354 | 0x40 = Afterheating PWM mode
355 | 0x80 =
356 | Byte[5] = 0x00
357 | Byte[6] = Active status 1:
358 | 0x01 = P10
359 | :
360 | 0x80 = P17
361 | Byte[7] = Active status 2:
362 | 0x01 = P18
363 | 0x02 = P19
364 | Byte[8] = Active status 3:
365 | 0x01 = P90
366 | :
367 | 0x40 = P96
368 | Byte[9] = Enthalpy present (1 = present / 0 = absent / 2 = without Sensor)
369 | Byte[10] = EWT present (1 = regulated / 0 = absent / 2 = unregulated)
370 |
371 | */
372 | #define CMD_GET_STATUS 0xD5
373 | #define RES_GET_STATUS 0xD6
374 |
375 | /*
376 | Data: -
377 |
378 | Response: 17 bytes
379 | Byte[0] = Current error A:
380 | 0x01 = A1
381 | :
382 | 0x80 = A8
383 | Byte[1] = Current error E:
384 | 0x01 = E1
385 | :
386 | 0x80 = E8
387 | Byte[2] = Last mistake A
388 | 0x01 = A1
389 | :
390 | 0x80 = A8
391 | Byte[3] = Last mistake E
392 | 0x01 = E1
393 | :
394 | 0x80 = E8
395 | Byte[4] = Penultimate mistake A
396 | 0x01 = A1
397 | :
398 | 0x80 = A8
399 | Byte[5] = Penultimate error E
400 | 0x01 = E1
401 | :
402 | 0x80 = E8
403 | Byte[6] = Penultimate error A
404 | 0x01 = A1
405 | :
406 | 0x80 = A8
407 | Byte[7] = Penultimate error E
408 | 0x01 = E1
409 | :
410 | 0x80 = E8
411 | Byte[8] = 0x00 = Filter OK
412 | 0x01 = Filter full
413 | Byte[9] = Current error EA:
414 | 0x01 = EA1
415 | :
416 | 0x80 = EA8
417 | Byte[10] = Last error EA:
418 | 0x01 = EA1
419 | :
420 | 0x80 = EA8
421 | Byte[11] = Second to last error EA:
422 | 0x01 = EA1
423 | :
424 | 0x80 = EA8
425 | Byte[12] = Last but one error EA:
426 | 0x01 = EA1
427 | :
428 | 0x80 = EA8
429 | Byte[13] = Current error A (high):
430 | 0x01 = A9
431 | :
432 | 0x40 = A15
433 | 0x80 = A0
434 | Byte[14] = Last error A (high):
435 | 0x01 = A9
436 | :
437 | 0x40 = A15
438 | 0x80 = A0
439 | Byte[15] = Second to last error A (high):
440 | 0x01 = A9
441 | :
442 | 0x40 = A15
443 | 0x80 = A0
444 | Byte[16] = Last but one error A (high):
445 | 0x01 = A9
446 | :
447 | 0x40 = A15
448 | 0x80 = A0
449 | */
450 | #define CMD_GET_FAULTS 0xD9
451 | #define RES_GET_FAULTS 0xDA
452 |
453 | /*
454 | Data: -
455 |
456 | Response: 20 bytes
457 | Bytes[0-2] = Operating hours absent (h) (Byte[2] = Low Byte)
458 | Bytes[3-5] = Operating hours low / level 1 (h) (Byte[5] = Low Byte)
459 | Bytes[6-8] = Operating hours medium / level 2 (h) (Byte[8] = Low Byte)
460 | Bytes[9-10] = Operating hours of frost protection (h) (Byte[10] = Low Byte)
461 | Bytes[11-12] = Operating hours preheating (h) (Byte[12] = Low Byte)
462 | Bytes[13-14] = Operating hours bypass open (h) (Byte[14] = Low Byte)
463 | Bytes[15-16] = Filter operating hours (h) (Byte[16] = Low Byte)
464 | Bytes[17-19] = Operating hours high / level 3 (h) (Byte[19] = Low Byte)
465 | */
466 | #define CMD_GET_OPERATION_HOURS 0xDD
467 | #define RES_GET_OPERATION_HOURS 0xDE
468 |
469 | /*
470 | Data: -
471 |
472 | Response: 7 bytes
473 | Byte[0] = 0x00
474 | Byte[1] = 0x00
475 | Byte[2] = Bypass factor
476 | Byte[3] = Bypass stage
477 | Byte[4] = Bypass correction
478 | Byte[5] = 0x00
479 | Byte[6] = Summer mode (1 = yes / 0 = no (winter))
480 | */
481 | #define CMD_GET_BYPASS_CONTROL_STATUS 0xDF
482 | #define RES_GET_BYPASS_CONTROL_STATUS 0xE0
483 |
484 | /*
485 | Data: -
486 |
487 | Response: 6 bytes
488 | Byte[0] = Status valve (1 = open / 0 = closed / 2 = unknown)
489 | Byte[1] = Frost protection (1 = active / 0 = inactive)
490 | Byte[2] = Preheating (1 = active / 0 = inactive)
491 | Byte[3..4] = Frost minutes (min)
492 | Byte[5] = Frost protection (1 = extra safe / 4 = safe)
493 | */
494 | #define CMD_GET_PREHEATING_STATUS 0xE1
495 | #define RES_GET_PREHEATING_STATUS 0xE2
496 |
497 | /*
498 | Data: -
499 |
500 | Response: 7 bytes
501 | Byte[0] = RF address 4 (low byte)
502 | Byte[1] = RF address 3
503 | Byte[2] = RF address 2
504 | Byte[3] = RF address 1 (high byte)
505 | Byte[4] = RF ID
506 | Byte[5] = Module present
507 | Byte[6] = Self-learning mode active
508 | */
509 | #define CMD_GET_RF_STATUS 0xE5
510 | #define RES_GET_RF_STATUS 0xE6
511 |
512 | /*
513 | Data: -
514 |
515 | Response: 8 bytes
516 | Byte[0] = Oldest value (°C)
517 | Byte[1] =
518 | Byte[2] =
519 | Byte[3] =
520 | Byte[4] =
521 | Byte[5] =
522 | Byte[6] =
523 | Byte[7] = Latest value (°C)
524 | */
525 | #define CMD_GET_LAST_8_TIMES_PREHEATING 0xE9
526 | #define RES_GET_LAST_8_TIMES_PREHEATING 0xEA
527 |
528 | /*
529 | Data: -
530 |
531 | Response: 7 byets
532 | Byte[0] = EWT low (°C)
533 | Byte[1] = EWT high (°C)
534 | Byte[2] = EWT speed up (%)
535 | Byte[3] = Kitchen hood speed up (%)
536 | Byte[4] = Post-heating performance
537 | Byte[5] = Post-heating power I parameter
538 | Byte[6] = Reheating T desired (°C)
539 | */
540 | #define CMD_EWT_POST_HEATING 0xEB
541 | #define RES_EWT_POST_HEATING 0xEC
542 |
543 | // ====================================================================
544 | // ========== Command list (PC to ComfoAir) / write commands ==========
545 | // ====================================================================
546 |
547 | /*
548 | Data: 1 byte
549 | Byte[0] = 0x00 = Auto
550 | 0x01 = Absent
551 | 0x02 = low / level 1
552 | 0x03 = medium / level 2
553 | 0x04 = high / level 3
554 |
555 | Response: ACK
556 | */
557 | #define CMD_SET_LEVEL 0x99
558 | #define CMD_SET_LEVEL_LENGTH 1
559 | #define RES_SET_LEVEL COMMAND_ACK
560 |
561 | /*
562 | Data: 19 bytes
563 | Byte[0] = Analogously present: (1 = present / 0 = absent)
564 | 0x01 = Analog 1
565 | 0x02 = Analog 2
566 | 0x04 = Analog 3
567 | 0x08 = Analog 4
568 | 0x10 = RF
569 | Byte[1] = Regulate / control analogously: (1 = regulate / 0 = control)
570 | 0x01 = Analog 1
571 | 0x02 = Analog 2
572 | 0x04 = Analog 3
573 | 0x08 = Analog 4
574 | 0x10 = RF
575 | Byte[2] = Analogue positive / negative: (1 = negative / 0 = positive)
576 | 0x01 = Analog 1
577 | 0x02 = Analog 2
578 | 0x04 = Analog 3
579 | 0x08 = Analog 4
580 | 0x10 = RF
581 | Byte[3] = Analog 1 Min. Setting (%)
582 | Byte[4] = Analog 1 Max. Setting (%)
583 | Byte[5] = Analog 1 setpoint (%)
584 | Byte[6] = Analogue 2 min. setting (%)
585 | Byte[7] = Analog 2 Max. Setting (%)
586 | Byte[8] = Analog 2 setpoint (%)
587 | Byte[9] = Analogue 3 min. setting (%)
588 | Byte[10] = Analog 3 Max. Setting (%)
589 | Byte[11] = Analog 3 setpoint (%)
590 | Byte[12] = Analogue 4 min. setting (%)
591 | Byte[13] = Analog 4 Max Setting (%)
592 | Byte[14] = Analog 4 setpoint (%)
593 | Byte[15] = Analog RF Min. Setting (%)
594 | Byte[16] = Analog RF Max Setting (%)
595 | Byte[17] = Analog RF setpoint (%)
596 | Byte[18] = Priority control (0 = analog inputs / 1 = weekly program)
597 |
598 | Response: ACK
599 | */
600 | #define CMD_SET_ANALOG_VALUES 0x9F
601 | #define RES_SET_ANALOG_VALUES COMMAND_ACK
602 |
603 | /*
604 | Data: 8 bytes
605 | Byte[0] = Bathroom switch switch-on delay (min)
606 | Byte[1] = Bathroom switch switch-off delay (min)
607 | Byte[2] = L1 switch-off delay (min)
608 | Byte[3] = Shock ventilation (min)
609 | Byte[4] = Filter counter (weeks)
610 | Byte[5] = RF high time short (min)
611 | Byte[6] = RF high time long (min)
612 | Byte[7] = Kitchen hood switch-off delay (min)
613 |
614 | Response: ACK
615 | */
616 | #define CMD_SET_TIME_DELAY 0xCB
617 | #define RES_SET_TIME_DELAY COMMAND_ACK
618 |
619 | /*
620 | Data: 9 bytes
621 | Byte[0] = Exhaust air absent (%)
622 | Byte[1] = Exhaust air low / level 1 (%)
623 | Byte[2] = Exhaust air medium / level 2 (%)
624 | Byte[3] = Supply air level absent (%)
625 | Byte[4] = Supply air low / level 1 (%)
626 | Byte[5] = Supply air medium / level 2 (%)
627 | Byte[6] = Exhaust air high / level 3 (%)
628 | Byte[7] = Supply air high / level 3 (%)
629 | Byte[8] =
630 |
631 | Response: ACK
632 | */
633 | #define CMD_SET_VENTILATION_LEVEL 0xCF
634 | #define CMD_SET_VENTILATION_LEVEL_LENGTH 9
635 | #define RES_SET_VENTILATION_LEVEL COMMAND_ACK
636 |
637 | /*
638 | Data: 1 byte
639 | Byte[0] = Comfort temperature (°C*)
640 |
641 | Response: ACK
642 | */
643 | #define CMD_SET_COMFORT_TEMPERATURE 0xD3
644 | #define CMD_SET_COMFORT_TEMPERATURE_LENGTH 1
645 | #define RES_SET_COMFORT_TEMPERATURE COMMAND_ACK
646 |
647 | /*
648 | Data: 8 bytes
649 | Byte[0] = Preheater present (1 = present / 0 = absent)
650 | Byte[1] = Bypass present (1 = present / 0 = absent)
651 | Byte[2] = Type (1 = left / 2 = right)
652 | Byte[3] = Size (1 = large / 2 = small)
653 | Byte[4] = Options: (1 = present / 0 = absent)
654 | 0x01 = fireplace
655 | 0x02 = kitchen hood
656 | 0x04 = post-heating
657 | 0x40 = Afterheating PWM mode
658 | 0x80 =
659 | Byte[5] = 0x00
660 | Byte[6] = Enthalpy present (1 = present / 0 = absent / 2 = without Sensor)
661 | Byte[7] = EWT present (1 = regulated / 0 = absent / 2 = unregulated)
662 |
663 | Response: ACK
664 | */
665 | #define CMD_SET_STATUS 0xD7
666 | #define RES_SET_STATUS COMMAND_ACK
667 |
668 | /*
669 | Data: 4 bytes
670 | Byte[0] = Reset faults (1 = reset / 0 = -)
671 | Byte[1] = Reset settings (1 = reset / 0 = -)
672 | Byte[2] = Start self-test (1 = start / 0 = -)
673 | Byte[3] = Reset filter operating hours (1 = reset / 0 = -)
674 |
675 | Response: ACK
676 | */
677 | #define CMD_RESET_AND_SELF_TEST 0xDB
678 | #define CMD_RESET_AND_SELF_TEST_LENGTH 4
679 | #define RES_RESET_AND_SELF_TEST COMMAND_ACK
680 |
681 | /*
682 | Data: 5 bytes
683 | Byte[0] = EWT low (°C)
684 | Byte[1] = EWT high (°C)
685 | Byte[2] = EWT speed up (%)
686 | Byte[3] = Kitchen hood speed up (%)
687 | Byte[4] = Reheating T desired (°C)
688 |
689 | * Value sent is (temperature + 20) * 2
690 | ** Sent value is 1875000 / (RPM)
691 |
692 | Response: ACK
693 | */
694 | #define CMD_SET_EWT_POSTHEATING 0xED
695 | #define RES_SET_EWT_POSTHEATING COMMAND_ACK
696 |
697 | // ================================================
698 | // ========== Test mode (PC to ComfoAir) ==========
699 | // ================================================
700 |
701 | /*
702 | Data: -
703 |
704 | Response: -
705 | Confirmation test mode
706 | */
707 | #define CMD_SET_TEST_MODE 0x01
708 | #define RES_SET_TEST_MODE 0x02
709 |
710 | /*
711 | Data: 2 bytes
712 | Byte[0] = relay
713 | 0x01 = Preheating relay
714 | 0x02 = Triac preheating
715 | 0x04 = EWT supply
716 | 0x08 = EWT direction
717 | 0x10 = kitchen hood
718 | 0x20 = error
719 | Byte[1] = Return message
720 | 0x01 = Filter full LED
721 |
722 | Response: -
723 | */
724 | #define CMD_SET_OUTPUTS 0x05
725 | #define RES_SET_OUTPUTS []
726 |
727 | /*
728 | Data: 3 bytes
729 | Byte[0] = Supply air (%)
730 | Byte[1] = Exhaust air (%)
731 | Byte[2] = Post-heating (%)
732 |
733 | Response: -
734 | */
735 | #define CMD_SET_ANALOG_OUTPUTS 0x07
736 | #define RES_SET_ANALOG_OUTPUTS []
737 |
738 | /*
739 | Data: 2 bytes
740 | Byte[0] = Bypass (1 = open / 0 = closed / 3 = stop)
741 | Byte[1] = Preheating (1 = open / 0 = closed / 3 = stop)
742 |
743 | Response:
744 | */
745 | #define CMD_SET_FLAPS 0x09
746 | #define RES_SET_FLAPS []
747 |
748 | /*
749 | Data: -
750 |
751 | Response: -
752 | Confirmation end of test mode
753 | */
754 | #define CMD_EXIT_TEST_MODE 0x19
755 | #define RES_EXIT_TEST_MODE 0x1A
756 |
757 | // ========================================================
758 | // ========== Command list (CC-Ease to ComfoAir) ==========
759 | // ========================================================
760 |
761 | /*
762 | Data: -
763 |
764 | Response: -
765 |
766 | See ComfoAir command list on CC-Ease
767 | */
768 | #define CMD_GET_DATA 0x33
769 | #define RES_GET_DATA_1 0x38
770 | #define RES_GET_DATA_2 0x3E
771 | #define RES_GET_DATA_3 0x40
772 | #define RES_GET_DATA_4 0x98
773 | #define RES_GET_DATA_5 0x9C
774 | #define RES_GET_DATA_6 0xAA
775 | #define RES_GET_DATA_7 0xCE
776 | #define RES_GET_DATA_8 0xD2
777 | #define RES_GET_DATA_9 0xE0
778 | #define RES_GET_DATA_10 0xE2
779 | #define RES_GET_DATA_11 0xEC
780 |
781 | /*
782 | Data: 5 bytes
783 | Byte[0] = RTC day
784 | 0x00 = Saturday
785 | 0x01 = Sunday
786 | 0x02 = Monday
787 | 0x03 = Tuesday
788 | 0x04 = Wednesday
789 | 0x05 = Thursday
790 | 0x06 = Friday
791 | Byte[1] = RTC hour (0..23)
792 | Byte[2] = RTC minutes (0..59)
793 | Byte[3] = Temperature (°C*)
794 | Byte[4] = CC Ease version
795 | Bit 7..4 = Version Major
796 | Bit 3..0 = Version Minor
797 |
798 | * Value sent is (temperature + 20) * 2
799 |
800 | Response: -
801 | See ComfoAir command list on CC-Ease
802 |
803 | */
804 | #define CMD_GET_CC_EASE_PARAMETERS 0x35
805 | #define RES_GET_CC_EASE_PARAMETERS 0x3C
806 |
807 | /*
808 | Data: 7 bytes
809 | Byte[0] Fan (0..255 = 0..4080 milliseconds)
810 | Byte[1] Mode (0..255 = 0..4080 milliseconds)
811 | Byte[2] Clock (0..255 = 0..4080 milliseconds)
812 | Byte[3] Temperature (0..255 = 0..4080 milliseconds)
813 | Byte[4] Plus (0..255 = 0..4080 milliseconds)
814 | Byte[5] Minus (0..255 = 0..4080 milliseconds)
815 | Byte[6] Status bits
816 | 0x01 = Flashing on/off
817 |
818 | Response: -
819 | See ComfoAir command list on CC-Ease
820 | */
821 | #define CMD_CCEASE_BUTTON_STATUS 0x37
822 | #define RES_CCEASE_BUTTON_STATUS 0x3C
823 |
824 | /*
825 | Data: 16 bytes
826 | Byte[0] = Module type receiver
827 | Byte[1] = Module ID receiver
828 | Byte[2] = Module type transmitter
829 | Byte[3] = Module ID transmitter
830 | Byte[4] = Lifetime
831 | Byte[5] = Data type
832 | Byte[6] = Data byte 1
833 | Byte[7] = Data byte 2
834 | Byte[8] = Data byte 3
835 | Byte[9] = Data byte 4
836 | Byte[10] = Data byte 5
837 | Byte[11] = Data byte 6
838 | Byte[12] = Data byte 7
839 | Byte[13] = Data byte 8
840 | Byte[14] = Data byte 9
841 | Byte[15] = Data byte 10
842 |
843 | Response: -
844 | See ComfoAir command list on CC-Ease
845 | */
846 | #define CMD_GET_RF_COMMAND 0x39
847 | #define RES_GET_RF_COMMAND 0x40
848 |
849 | // ========================================================
850 | // ========== Command list (ComfoAir to CC-Ease) ==========
851 | // ========================================================
852 |
853 | /*
854 | Data: 5 bytes
855 | Byte[0] = RTC day
856 | 0x00 = Saturday
857 | 0x01 = Sunday
858 | 0x02 = Monday
859 | 0x03 = Tuesday
860 | 0x04 = Wednesday
861 | 0x05 = Thursday
862 | 0x06 = Friday
863 | Byte[1] = RTC hour (0..23)
864 | Byte[2] = RTC minutes (0..59)
865 | Byte[3] = Backlight timeout (Fixed at 30)
866 | Byte[4] = Backlight (fixed at 100%)
867 |
868 | Response:
869 | */
870 | #define CMD_SET_PARAMETER 0x38
871 | #define RES_SET_PARAMETER []
872 |
873 | /*
874 | Data: 10 bytes
875 | Byte[0] = (1 = on / 0 = off)
876 | 0x01 = Saturday
877 | 0x02 = Sunday
878 | 0x04 = Monday
879 | 0x08 = Tuesday
880 | 0x10 = Wednesday
881 | 0x20 = Thursday
882 | 0x40 = Friday
883 | 0x80 = colon
884 | Byte[1] = (1 = on / 0 = off)
885 | 0x01 = 1AEGED
886 | 0x02 = 1B
887 | 0x04 = 1C
888 | 0x08 = AUTO symbol
889 | 0x10 = MANUAL symbol
890 | 0x20 = FILTER icon
891 | 0x40 = Symbol I
892 | 0x80 = Symbol E
893 | Byte[2] = (1 = on / 0 = off)
894 | 0x01 = 2A
895 | 0x02 = 2B
896 | 0x04 = 2C
897 | 0x08 = 2D
898 | 0x10 = 2E
899 | 0x20 = 2F
900 | 0x40 = 2G
901 | 0x80 = FAN symbol
902 | Byte[3] = (1 = on / 0 = off)
903 | 0x01 = 3A
904 | 0x02 = 3B
905 | 0x04 = 3C
906 | 0x08 = 3DByte[1] =
907 | 0x10 = 3E
908 | 0x20 = 3F
909 | 0x40 = 3G
910 | 0x80 = kitchen hood symbol
911 | Byte[4] = (1 = on / 0 = off)
912 | 0x01 = 4A
913 | 0x02 = 4B
914 | 0x04 = 4C
915 | 0x08 = 4D
916 | 0x10 = 4E
917 | 0x20 = 4F
918 | 0x40 = 4G
919 | 0x80 = Preheating symbol
920 | Byte[5] = (1 = on / 0 = off)
921 | 0x01 = 5A
922 | 0x02 = 5B
923 | 0x04 = 5C
924 | 0x08 = 5D
925 | 0x10 = 5E
926 | 0x20 = 5F
927 | 0x40 = 5G
928 | 0x80 = Frost symbol
929 | Byte[6] = (1 = on / 0 = off)
930 | 0x01 = 6A
931 | 0x02 = 6B
932 | 0x04 = 6C
933 | 0x08 = 6D
934 | 0x10 = 6E
935 | 0x20 = 6F
936 | 0x40 = 6G
937 | 0x80 = Symbol EWT
938 | Byte[7] = (1 = on / 0 = off)
939 | 0x01 = 7A
940 | 0x02 = 7B
941 | 0x04 = 7C
942 | 0x08 = 7D
943 | 0x10 = 7E
944 | 0x20 = 7F
945 | 0x40 = 7G
946 | 0x80 = Reheating symbol
947 | Byte[8] = (1 = on / 0 = off)
948 | 0x01 = 8A
949 | 0x02 = 8B
950 | 0x04 = 8C
951 | 0x08 = 8D
952 | 0x10 = 8E
953 | 0x20 = 8F
954 | 0x40 = 8G
955 | 0x80 = point
956 | Byte[9] = (1 = on / 0 = off)
957 | 0x01 = Degree symbol
958 | 0x02 = Bypass symbol
959 | 0x04 = X1
960 | 0x08 = X2
961 | 0x10 = X3
962 | 0x20 = House symbol
963 | 0x40 = supply air symbol
964 | 0x80 = Exhaust air symbol
965 |
966 | Response: -
967 | */
968 | #define CMD_SET_DISPLAY 0x39
969 | #define RES_SET_DISPLAY []
970 |
971 | /*
972 | Data: 4 bytes
973 | Byte[0] = RF Address 4 (Low Byte)
974 | Byte[1] = RF Address 3
975 | Byte[2] = RF Address 2
976 | Byte[3] = RF Address 1 (High Byte)
977 |
978 | Response: -
979 | */
980 | #define CMD_SET_RF_ADDRESS 0x3E
981 | #define RES_SET_RF_ADDRESS []
982 |
983 | /*
984 | Data: 21 bytes
985 | Byte[0] = Module type receiver
986 | Byte[1] = Module ID receiver
987 | Byte[2] = Module type transmitter
988 | Byte[3] = Module ID transmitter
989 | Byte[4] = Lifetime
990 | Byte[5] = Date type
991 | Byte[6] = Data byte 1
992 | Byte[7] = Data byte 2
993 | Byte[8] = Data byte 3
994 | Byte[9] = Data byte 4
995 | Byte[10] = Data byte 5
996 | Byte[11] = Data byte 6
997 | Byte[12] = Data byte 7
998 | Byte[13] = Data byte 8
999 | Byte[14] = Data byte 9
1000 | Byte[15] = Data byte 10
1001 | Byte[16] = RF address 4 (low byte)
1002 | Byte[17] = RF address 3
1003 | Byte[18] = RF address 2
1004 | Byte[19] = RF address 1 (high byte)
1005 | Byte[20] = Control bits
1006 | 0x01 = Repeat previous package first
1007 | 0x02 = 250ms pause before sending
1008 | 0x04 = Received at sender address
1009 |
1010 | Response:
1011 | */
1012 | #define CMD_SEND_RF_COMMAND 0x40
1013 | #define RES_SEND_RF_COMMAND []
1014 |
--------------------------------------------------------------------------------
/doc/T568B.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julianpas/esphome-comfoair/ccc3a2d8a0f1197174a806afbe86b140a39d0e32/doc/T568B.png
--------------------------------------------------------------------------------
/doc/bom.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julianpas/esphome-comfoair/ccc3a2d8a0f1197174a806afbe86b140a39d0e32/doc/bom.jpg
--------------------------------------------------------------------------------
/doc/esp_comfoair.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julianpas/esphome-comfoair/ccc3a2d8a0f1197174a806afbe86b140a39d0e32/doc/esp_comfoair.pdf
--------------------------------------------------------------------------------
/doc/gen1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julianpas/esphome-comfoair/ccc3a2d8a0f1197174a806afbe86b140a39d0e32/doc/gen1.jpg
--------------------------------------------------------------------------------
/doc/gen2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julianpas/esphome-comfoair/ccc3a2d8a0f1197174a806afbe86b140a39d0e32/doc/gen2.jpg
--------------------------------------------------------------------------------
/doc/installed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julianpas/esphome-comfoair/ccc3a2d8a0f1197174a806afbe86b140a39d0e32/doc/installed.jpg
--------------------------------------------------------------------------------
/doc/schematic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julianpas/esphome-comfoair/ccc3a2d8a0f1197174a806afbe86b140a39d0e32/doc/schematic.png
--------------------------------------------------------------------------------
/simple_thermostat.yaml:
--------------------------------------------------------------------------------
1 | control:
2 | fan:
3 | auto: false
4 | high:
5 | icon: 'mdi:fan-speed-3'
6 | low:
7 | icon: 'mdi:fan-speed-1'
8 | medium:
9 | icon: 'mdi:fan-speed-2'
10 | 'off':
11 | name: 'off'
12 | decimals: 1
13 | entity: climate.put-yout-comfoair-name-here
14 | hide:
15 | temperature: true
16 | sensors:
17 | - entity: sensor.outside_air
18 | name: Outside Air
19 | unit: °C
20 | - entity: sensor.supply_air
21 | name: Supply Air
22 | unit: °C
23 | - entity: sensor.return_air
24 | name: Return Air
25 | unit: °C
26 | - entity: sensor.exhaust_air
27 | name: Exhaust Air
28 | unit: °C
29 | - entity: sensor.supply_air_level
30 | name: Supply Air Level
31 | unit: '%'
32 | - entity: sensor.fan_speed_supply
33 | name: Supply Speed
34 | unit: rpm
35 | - entity: sensor.return_air_level
36 | name: Return Air Level
37 | unit: '%'
38 | - entity: sensor.fan_speed_exhaust
39 | name: Exhaust Speed
40 | unit: rpm
41 | - entity: binary_sensor.preheating
42 | name: Preheating
43 | - entity: binary_sensor.bypass_valve
44 | name: Bypass Valve
45 | - entity: binary_sensor.filter_full
46 | name: Filter Full
47 | step_layout: row
48 | step_size: 0.5
49 | style: |
50 | ha-card {
51 | --st-font-size-xl: 14px;
52 | --st-font-size-m: 10px;
53 | --st-font-size-title: 20px;
54 | --st-font-size-sensors: 10px;
55 | --st-spacing: 2px;
56 | }
57 | type: 'custom:simple-thermostat'
58 |
--------------------------------------------------------------------------------