├── .github
└── workflows
│ └── platformio.yml
├── .gitignore
├── LICENSE.md
├── Mitsubishi2mqtt.json
├── README.md
├── images
├── Grafana-screenshot.png
├── config_page.png
├── control_page.png
├── initial_setup.png
└── main_page.png
├── platformio.ini
└── src
└── mitsubishi2mqtt
├── config.h
├── html_common.h
├── html_init.h
├── html_menu.h
├── html_metrics.h
├── html_pages.h
├── javascript_common.h
├── languages
├── da-DA.h
├── de-DE.h
├── en-GB.h
├── es-ES.h
├── fr-FR.h
├── it-IT.h
├── ja-JP.h
└── zh-CN.h
└── mitsubishi2mqtt.ino
/.github/workflows/platformio.yml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | pull_request:
4 | schedule:
5 | - cron: "0 2 * * *"
6 |
7 | jobs:
8 | build:
9 | runs-on: ubuntu-latest
10 |
11 | steps:
12 | - uses: actions/checkout@v4
13 | - uses: actions/cache@v4
14 | with:
15 | path: |
16 | ~/.cache/pip
17 | ~/.platformio/.cache
18 | key: ${{ runner.os }}-pio
19 | - uses: actions/setup-python@v4
20 | with:
21 | python-version: '3.9'
22 | - name: Install PlatformIO Core
23 | run: pip install --upgrade platformio
24 |
25 | - name: Build Generic8266(ESP-01)
26 | run: |
27 | pio run -e ESP8266-ESP01
28 | mv .pio/build/ESP8266-ESP01/firmware.bin mitsubishi2MQTT_ESP8266-ESP01.bin
29 |
30 | - name: Build WEMOS_D1_Mini
31 | run: |
32 | pio run -e WEMOS_D1_Mini
33 | mv .pio/build/WEMOS_D1_Mini/firmware.bin mitsubishi2MQTT_WEMOS_D1_Mini.bin
34 |
35 | - name: Build ESP32DEV
36 | run: |
37 | pio run -e ESP32DEV
38 | mv .pio/build/ESP32DEV/firmware.bin mitsubishi2MQTT_ESP32DEV.bin
39 |
40 | - name: Upload esp8266 artifacts
41 | uses: actions/upload-artifact@v4
42 | with:
43 | name: mitsubishi2MQTT_ESP8266-ESP01.bin
44 | path: mitsubishi2MQTT_ESP8266-ESP01.bin
45 |
46 | - name: Upload esp32dev artifacts
47 | uses: actions/upload-artifact@v4
48 | with:
49 | name: mitsubishi2MQTT_ESP32DEV.bin
50 | path: mitsubishi2MQTT_ESP32DEV.bin
51 |
52 | - name: Upload WEMOS_D1_Mini artifacts
53 | uses: actions/upload-artifact@v4
54 | with:
55 | name: mitsubishi2MQTT_WEMOS_D1_Mini.bin
56 | path: mitsubishi2MQTT_WEMOS_D1_Mini.bin
57 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .vscode
3 | .pio*
4 | *.bin
5 | build/
6 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | # mitsubishi2mqtt - Mitsubishi Heat Pump to MQTT control for Home Assistant.
2 |
3 | GNU LESSER GENERAL PUBLIC LICENSE
4 | Version 2.1, February 1999
5 |
6 | Copyright (C) 1991, 1999 Free Software Foundation, Inc.
7 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
8 | Everyone is permitted to copy and distribute verbatim copies
9 | of this license document, but changing it is not allowed.
10 |
11 | [This is the first released version of the Lesser GPL. It also counts
12 | as the successor of the GNU Library Public License, version 2, hence
13 | the version number 2.1.]
14 |
15 | Preamble
16 |
17 | The licenses for most software are designed to take away your
18 | freedom to share and change it. By contrast, the GNU General Public
19 | Licenses are intended to guarantee your freedom to share and change
20 | free software--to make sure the software is free for all its users.
21 |
22 | This license, the Lesser General Public License, applies to some
23 | specially designated software packages--typically libraries--of the
24 | Free Software Foundation and other authors who decide to use it. You
25 | can use it too, but we suggest you first think carefully about whether
26 | this license or the ordinary General Public License is the better
27 | strategy to use in any particular case, based on the explanations below.
28 |
29 | When we speak of free software, we are referring to freedom of use,
30 | not price. Our General Public Licenses are designed to make sure that
31 | you have the freedom to distribute copies of free software (and charge
32 | for this service if you wish); that you receive source code or can get
33 | it if you want it; that you can change the software and use pieces of
34 | it in new free programs; and that you are informed that you can do
35 | these things.
36 |
37 | To protect your rights, we need to make restrictions that forbid
38 | distributors to deny you these rights or to ask you to surrender these
39 | rights. These restrictions translate to certain responsibilities for
40 | you if you distribute copies of the library or if you modify it.
41 |
42 | For example, if you distribute copies of the library, whether gratis
43 | or for a fee, you must give the recipients all the rights that we gave
44 | you. You must make sure that they, too, receive or can get the source
45 | code. If you link other code with the library, you must provide
46 | complete object files to the recipients, so that they can relink them
47 | with the library after making changes to the library and recompiling
48 | it. And you must show them these terms so they know their rights.
49 |
50 | We protect your rights with a two-step method: (1) we copyright the
51 | library, and (2) we offer you this license, which gives you legal
52 | permission to copy, distribute and/or modify the library.
53 |
54 | To protect each distributor, we want to make it very clear that
55 | there is no warranty for the free library. Also, if the library is
56 | modified by someone else and passed on, the recipients should know
57 | that what they have is not the original version, so that the original
58 | author's reputation will not be affected by problems that might be
59 | introduced by others.
60 |
61 | Finally, software patents pose a constant threat to the existence of
62 | any free program. We wish to make sure that a company cannot
63 | effectively restrict the users of a free program by obtaining a
64 | restrictive license from a patent holder. Therefore, we insist that
65 | any patent license obtained for a version of the library must be
66 | consistent with the full freedom of use specified in this license.
67 |
68 | Most GNU software, including some libraries, is covered by the
69 | ordinary GNU General Public License. This license, the GNU Lesser
70 | General Public License, applies to certain designated libraries, and
71 | is quite different from the ordinary General Public License. We use
72 | this license for certain libraries in order to permit linking those
73 | libraries into non-free programs.
74 |
75 | When a program is linked with a library, whether statically or using
76 | a shared library, the combination of the two is legally speaking a
77 | combined work, a derivative of the original library. The ordinary
78 | General Public License therefore permits such linking only if the
79 | entire combination fits its criteria of freedom. The Lesser General
80 | Public License permits more lax criteria for linking other code with
81 | the library.
82 |
83 | We call this license the "Lesser" General Public License because it
84 | does Less to protect the user's freedom than the ordinary General
85 | Public License. It also provides other free software developers Less
86 | of an advantage over competing non-free programs. These disadvantages
87 | are the reason we use the ordinary General Public License for many
88 | libraries. However, the Lesser license provides advantages in certain
89 | special circumstances.
90 |
91 | For example, on rare occasions, there may be a special need to
92 | encourage the widest possible use of a certain library, so that it becomes
93 | a de-facto standard. To achieve this, non-free programs must be
94 | allowed to use the library. A more frequent case is that a free
95 | library does the same job as widely used non-free libraries. In this
96 | case, there is little to gain by limiting the free library to free
97 | software only, so we use the Lesser General Public License.
98 |
99 | In other cases, permission to use a particular library in non-free
100 | programs enables a greater number of people to use a large body of
101 | free software. For example, permission to use the GNU C Library in
102 | non-free programs enables many more people to use the whole GNU
103 | operating system, as well as its variant, the GNU/Linux operating
104 | system.
105 |
106 | Although the Lesser General Public License is Less protective of the
107 | users' freedom, it does ensure that the user of a program that is
108 | linked with the Library has the freedom and the wherewithal to run
109 | that program using a modified version of the Library.
110 |
111 | The precise terms and conditions for copying, distribution and
112 | modification follow. Pay close attention to the difference between a
113 | "work based on the library" and a "work that uses the library". The
114 | former contains code derived from the library, whereas the latter must
115 | be combined with the library in order to run.
116 |
117 | GNU LESSER GENERAL PUBLIC LICENSE
118 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
119 |
120 | 0. This License Agreement applies to any software library or other
121 | program which contains a notice placed by the copyright holder or
122 | other authorized party saying it may be distributed under the terms of
123 | this Lesser General Public License (also called "this License").
124 | Each licensee is addressed as "you".
125 |
126 | A "library" means a collection of software functions and/or data
127 | prepared so as to be conveniently linked with application programs
128 | (which use some of those functions and data) to form executables.
129 |
130 | The "Library", below, refers to any such software library or work
131 | which has been distributed under these terms. A "work based on the
132 | Library" means either the Library or any derivative work under
133 | copyright law: that is to say, a work containing the Library or a
134 | portion of it, either verbatim or with modifications and/or translated
135 | straightforwardly into another language. (Hereinafter, translation is
136 | included without limitation in the term "modification".)
137 |
138 | "Source code" for a work means the preferred form of the work for
139 | making modifications to it. For a library, complete source code means
140 | all the source code for all modules it contains, plus any associated
141 | interface definition files, plus the scripts used to control compilation
142 | and installation of the library.
143 |
144 | Activities other than copying, distribution and modification are not
145 | covered by this License; they are outside its scope. The act of
146 | running a program using the Library is not restricted, and output from
147 | such a program is covered only if its contents constitute a work based
148 | on the Library (independent of the use of the Library in a tool for
149 | writing it). Whether that is true depends on what the Library does
150 | and what the program that uses the Library does.
151 |
152 | 1. You may copy and distribute verbatim copies of the Library's
153 | complete source code as you receive it, in any medium, provided that
154 | you conspicuously and appropriately publish on each copy an
155 | appropriate copyright notice and disclaimer of warranty; keep intact
156 | all the notices that refer to this License and to the absence of any
157 | warranty; and distribute a copy of this License along with the
158 | Library.
159 |
160 | You may charge a fee for the physical act of transferring a copy,
161 | and you may at your option offer warranty protection in exchange for a
162 | fee.
163 |
164 | 2. You may modify your copy or copies of the Library or any portion
165 | of it, thus forming a work based on the Library, and copy and
166 | distribute such modifications or work under the terms of Section 1
167 | above, provided that you also meet all of these conditions:
168 |
169 | a) The modified work must itself be a software library.
170 |
171 | b) You must cause the files modified to carry prominent notices
172 | stating that you changed the files and the date of any change.
173 |
174 | c) You must cause the whole of the work to be licensed at no
175 | charge to all third parties under the terms of this License.
176 |
177 | d) If a facility in the modified Library refers to a function or a
178 | table of data to be supplied by an application program that uses
179 | the facility, other than as an argument passed when the facility
180 | is invoked, then you must make a good faith effort to ensure that,
181 | in the event an application does not supply such function or
182 | table, the facility still operates, and performs whatever part of
183 | its purpose remains meaningful.
184 |
185 | (For example, a function in a library to compute square roots has
186 | a purpose that is entirely well-defined independent of the
187 | application. Therefore, Subsection 2d requires that any
188 | application-supplied function or table used by this function must
189 | be optional: if the application does not supply it, the square
190 | root function must still compute square roots.)
191 |
192 | These requirements apply to the modified work as a whole. If
193 | identifiable sections of that work are not derived from the Library,
194 | and can be reasonably considered independent and separate works in
195 | themselves, then this License, and its terms, do not apply to those
196 | sections when you distribute them as separate works. But when you
197 | distribute the same sections as part of a whole which is a work based
198 | on the Library, the distribution of the whole must be on the terms of
199 | this License, whose permissions for other licensees extend to the
200 | entire whole, and thus to each and every part regardless of who wrote
201 | it.
202 |
203 | Thus, it is not the intent of this section to claim rights or contest
204 | your rights to work written entirely by you; rather, the intent is to
205 | exercise the right to control the distribution of derivative or
206 | collective works based on the Library.
207 |
208 | In addition, mere aggregation of another work not based on the Library
209 | with the Library (or with a work based on the Library) on a volume of
210 | a storage or distribution medium does not bring the other work under
211 | the scope of this License.
212 |
213 | 3. You may opt to apply the terms of the ordinary GNU General Public
214 | License instead of this License to a given copy of the Library. To do
215 | this, you must alter all the notices that refer to this License, so
216 | that they refer to the ordinary GNU General Public License, version 2,
217 | instead of to this License. (If a newer version than version 2 of the
218 | ordinary GNU General Public License has appeared, then you can specify
219 | that version instead if you wish.) Do not make any other change in
220 | these notices.
221 |
222 | Once this change is made in a given copy, it is irreversible for
223 | that copy, so the ordinary GNU General Public License applies to all
224 | subsequent copies and derivative works made from that copy.
225 |
226 | This option is useful when you wish to copy part of the code of
227 | the Library into a program that is not a library.
228 |
229 | 4. You may copy and distribute the Library (or a portion or
230 | derivative of it, under Section 2) in object code or executable form
231 | under the terms of Sections 1 and 2 above provided that you accompany
232 | it with the complete corresponding machine-readable source code, which
233 | must be distributed under the terms of Sections 1 and 2 above on a
234 | medium customarily used for software interchange.
235 |
236 | If distribution of object code is made by offering access to copy
237 | from a designated place, then offering equivalent access to copy the
238 | source code from the same place satisfies the requirement to
239 | distribute the source code, even though third parties are not
240 | compelled to copy the source along with the object code.
241 |
242 | 5. A program that contains no derivative of any portion of the
243 | Library, but is designed to work with the Library by being compiled or
244 | linked with it, is called a "work that uses the Library". Such a
245 | work, in isolation, is not a derivative work of the Library, and
246 | therefore falls outside the scope of this License.
247 |
248 | However, linking a "work that uses the Library" with the Library
249 | creates an executable that is a derivative of the Library (because it
250 | contains portions of the Library), rather than a "work that uses the
251 | library". The executable is therefore covered by this License.
252 | Section 6 states terms for distribution of such executables.
253 |
254 | When a "work that uses the Library" uses material from a header file
255 | that is part of the Library, the object code for the work may be a
256 | derivative work of the Library even though the source code is not.
257 | Whether this is true is especially significant if the work can be
258 | linked without the Library, or if the work is itself a library. The
259 | threshold for this to be true is not precisely defined by law.
260 |
261 | If such an object file uses only numerical parameters, data
262 | structure layouts and accessors, and small macros and small inline
263 | functions (ten lines or less in length), then the use of the object
264 | file is unrestricted, regardless of whether it is legally a derivative
265 | work. (Executables containing this object code plus portions of the
266 | Library will still fall under Section 6.)
267 |
268 | Otherwise, if the work is a derivative of the Library, you may
269 | distribute the object code for the work under the terms of Section 6.
270 | Any executables containing that work also fall under Section 6,
271 | whether or not they are linked directly with the Library itself.
272 |
273 | 6. As an exception to the Sections above, you may also combine or
274 | link a "work that uses the Library" with the Library to produce a
275 | work containing portions of the Library, and distribute that work
276 | under terms of your choice, provided that the terms permit
277 | modification of the work for the customer's own use and reverse
278 | engineering for debugging such modifications.
279 |
280 | You must give prominent notice with each copy of the work that the
281 | Library is used in it and that the Library and its use are covered by
282 | this License. You must supply a copy of this License. If the work
283 | during execution displays copyright notices, you must include the
284 | copyright notice for the Library among them, as well as a reference
285 | directing the user to the copy of this License. Also, you must do one
286 | of these things:
287 |
288 | a) Accompany the work with the complete corresponding
289 | machine-readable source code for the Library including whatever
290 | changes were used in the work (which must be distributed under
291 | Sections 1 and 2 above); and, if the work is an executable linked
292 | with the Library, with the complete machine-readable "work that
293 | uses the Library", as object code and/or source code, so that the
294 | user can modify the Library and then relink to produce a modified
295 | executable containing the modified Library. (It is understood
296 | that the user who changes the contents of definitions files in the
297 | Library will not necessarily be able to recompile the application
298 | to use the modified definitions.)
299 |
300 | b) Use a suitable shared library mechanism for linking with the
301 | Library. A suitable mechanism is one that (1) uses at run time a
302 | copy of the library already present on the user's computer system,
303 | rather than copying library functions into the executable, and (2)
304 | will operate properly with a modified version of the library, if
305 | the user installs one, as long as the modified version is
306 | interface-compatible with the version that the work was made with.
307 |
308 | c) Accompany the work with a written offer, valid for at
309 | least three years, to give the same user the materials
310 | specified in Subsection 6a, above, for a charge no more
311 | than the cost of performing this distribution.
312 |
313 | d) If distribution of the work is made by offering access to copy
314 | from a designated place, offer equivalent access to copy the above
315 | specified materials from the same place.
316 |
317 | e) Verify that the user has already received a copy of these
318 | materials or that you have already sent this user a copy.
319 |
320 | For an executable, the required form of the "work that uses the
321 | Library" must include any data and utility programs needed for
322 | reproducing the executable from it. However, as a special exception,
323 | the materials to be distributed need not include anything that is
324 | normally distributed (in either source or binary form) with the major
325 | components (compiler, kernel, and so on) of the operating system on
326 | which the executable runs, unless that component itself accompanies
327 | the executable.
328 |
329 | It may happen that this requirement contradicts the license
330 | restrictions of other proprietary libraries that do not normally
331 | accompany the operating system. Such a contradiction means you cannot
332 | use both them and the Library together in an executable that you
333 | distribute.
334 |
335 | 7. You may place library facilities that are a work based on the
336 | Library side-by-side in a single library together with other library
337 | facilities not covered by this License, and distribute such a combined
338 | library, provided that the separate distribution of the work based on
339 | the Library and of the other library facilities is otherwise
340 | permitted, and provided that you do these two things:
341 |
342 | a) Accompany the combined library with a copy of the same work
343 | based on the Library, uncombined with any other library
344 | facilities. This must be distributed under the terms of the
345 | Sections above.
346 |
347 | b) Give prominent notice with the combined library of the fact
348 | that part of it is a work based on the Library, and explaining
349 | where to find the accompanying uncombined form of the same work.
350 |
351 | 8. You may not copy, modify, sublicense, link with, or distribute
352 | the Library except as expressly provided under this License. Any
353 | attempt otherwise to copy, modify, sublicense, link with, or
354 | distribute the Library is void, and will automatically terminate your
355 | rights under this License. However, parties who have received copies,
356 | or rights, from you under this License will not have their licenses
357 | terminated so long as such parties remain in full compliance.
358 |
359 | 9. You are not required to accept this License, since you have not
360 | signed it. However, nothing else grants you permission to modify or
361 | distribute the Library or its derivative works. These actions are
362 | prohibited by law if you do not accept this License. Therefore, by
363 | modifying or distributing the Library (or any work based on the
364 | Library), you indicate your acceptance of this License to do so, and
365 | all its terms and conditions for copying, distributing or modifying
366 | the Library or works based on it.
367 |
368 | 10. Each time you redistribute the Library (or any work based on the
369 | Library), the recipient automatically receives a license from the
370 | original licensor to copy, distribute, link with or modify the Library
371 | subject to these terms and conditions. You may not impose any further
372 | restrictions on the recipients' exercise of the rights granted herein.
373 | You are not responsible for enforcing compliance by third parties with
374 | this License.
375 |
376 | 11. If, as a consequence of a court judgment or allegation of patent
377 | infringement or for any other reason (not limited to patent issues),
378 | conditions are imposed on you (whether by court order, agreement or
379 | otherwise) that contradict the conditions of this License, they do not
380 | excuse you from the conditions of this License. If you cannot
381 | distribute so as to satisfy simultaneously your obligations under this
382 | License and any other pertinent obligations, then as a consequence you
383 | may not distribute the Library at all. For example, if a patent
384 | license would not permit royalty-free redistribution of the Library by
385 | all those who receive copies directly or indirectly through you, then
386 | the only way you could satisfy both it and this License would be to
387 | refrain entirely from distribution of the Library.
388 |
389 | If any portion of this section is held invalid or unenforceable under any
390 | particular circumstance, the balance of the section is intended to apply,
391 | and the section as a whole is intended to apply in other circumstances.
392 |
393 | It is not the purpose of this section to induce you to infringe any
394 | patents or other property right claims or to contest validity of any
395 | such claims; this section has the sole purpose of protecting the
396 | integrity of the free software distribution system which is
397 | implemented by public license practices. Many people have made
398 | generous contributions to the wide range of software distributed
399 | through that system in reliance on consistent application of that
400 | system; it is up to the author/donor to decide if he or she is willing
401 | to distribute software through any other system and a licensee cannot
402 | impose that choice.
403 |
404 | This section is intended to make thoroughly clear what is believed to
405 | be a consequence of the rest of this License.
406 |
407 | 12. If the distribution and/or use of the Library is restricted in
408 | certain countries either by patents or by copyrighted interfaces, the
409 | original copyright holder who places the Library under this License may add
410 | an explicit geographical distribution limitation excluding those countries,
411 | so that distribution is permitted only in or among countries not thus
412 | excluded. In such case, this License incorporates the limitation as if
413 | written in the body of this License.
414 |
415 | 13. The Free Software Foundation may publish revised and/or new
416 | versions of the Lesser General Public License from time to time.
417 | Such new versions will be similar in spirit to the present version,
418 | but may differ in detail to address new problems or concerns.
419 |
420 | Each version is given a distinguishing version number. If the Library
421 | specifies a version number of this License which applies to it and
422 | "any later version", you have the option of following the terms and
423 | conditions either of that version or of any later version published by
424 | the Free Software Foundation. If the Library does not specify a
425 | license version number, you may choose any version ever published by
426 | the Free Software Foundation.
427 |
428 | 14. If you wish to incorporate parts of the Library into other free
429 | programs whose distribution conditions are incompatible with these,
430 | write to the author to ask for permission. For software which is
431 | copyrighted by the Free Software Foundation, write to the Free
432 | Software Foundation; we sometimes make exceptions for this. Our
433 | decision will be guided by the two goals of preserving the free status
434 | of all derivatives of our free software and of promoting the sharing
435 | and reuse of software generally.
436 |
437 | NO WARRANTY
438 |
439 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
440 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
441 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
442 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
443 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
444 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
445 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
446 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
447 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
448 |
449 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
450 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
451 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
452 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
453 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
454 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
455 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
456 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
457 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
458 | DAMAGES.
459 |
460 | END OF TERMS AND CONDITIONS
461 |
462 | How to Apply These Terms to Your New Libraries
463 |
464 | If you develop a new library, and you want it to be of the greatest
465 | possible use to the public, we recommend making it free software that
466 | everyone can redistribute and change. You can do so by permitting
467 | redistribution under these terms (or, alternatively, under the terms of the
468 | ordinary General Public License).
469 |
470 | To apply these terms, attach the following notices to the library. It is
471 | safest to attach them to the start of each source file to most effectively
472 | convey the exclusion of warranty; and each file should have at least the
473 | "copyright" line and a pointer to where the full notice is found.
474 |
475 |
476 | Copyright (C)
477 |
478 | This library is free software; you can redistribute it and/or
479 | modify it under the terms of the GNU Lesser General Public
480 | License as published by the Free Software Foundation; either
481 | version 2.1 of the License, or (at your option) any later version.
482 |
483 | This library is distributed in the hope that it will be useful,
484 | but WITHOUT ANY WARRANTY; without even the implied warranty of
485 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
486 | Lesser General Public License for more details.
487 |
488 | You should have received a copy of the GNU Lesser General Public
489 | License along with this library; if not, write to the Free Software
490 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
491 | USA
492 |
493 | Also add information on how to contact you by electronic and paper mail.
494 |
495 | You should also get your employer (if you work as a programmer) or your
496 | school, if any, to sign a "copyright disclaimer" for the library, if
497 | necessary. Here is a sample; alter the names:
498 |
499 | Yoyodyne, Inc., hereby disclaims all copyright interest in the
500 | library `Frob' (a library for tweaking knobs) written by James Random
501 | Hacker.
502 |
503 | , 1 April 1990
504 | Ty Coon, President of Vice
505 |
506 | That's all there is to it!
507 |
--------------------------------------------------------------------------------
/Mitsubishi2mqtt.json:
--------------------------------------------------------------------------------
1 | {
2 | "__inputs": [
3 | {
4 | "name": "DS_PROMETHEUS",
5 | "label": "Prometheus",
6 | "description": "",
7 | "type": "datasource",
8 | "pluginId": "prometheus",
9 | "pluginName": "Prometheus"
10 | }
11 | ],
12 | "__elements": {},
13 | "__requires": [
14 | {
15 | "type": "grafana",
16 | "id": "grafana",
17 | "name": "Grafana",
18 | "version": "10.1.1"
19 | },
20 | {
21 | "type": "datasource",
22 | "id": "prometheus",
23 | "name": "Prometheus",
24 | "version": "1.0.0"
25 | },
26 | {
27 | "type": "panel",
28 | "id": "stat",
29 | "name": "Stat",
30 | "version": ""
31 | },
32 | {
33 | "type": "panel",
34 | "id": "timeseries",
35 | "name": "Time series",
36 | "version": ""
37 | }
38 | ],
39 | "annotations": {
40 | "list": [
41 | {
42 | "builtIn": 1,
43 | "datasource": {
44 | "type": "grafana",
45 | "uid": "-- Grafana --"
46 | },
47 | "enable": true,
48 | "hide": true,
49 | "iconColor": "rgba(0, 211, 255, 1)",
50 | "name": "Annotations & Alerts",
51 | "type": "dashboard"
52 | }
53 | ]
54 | },
55 | "editable": true,
56 | "fiscalYearStartMonth": 0,
57 | "graphTooltip": 0,
58 | "id": null,
59 | "links": [],
60 | "liveNow": false,
61 | "panels": [
62 | {
63 | "datasource": {
64 | "type": "prometheus",
65 | "uid": "${DS_PROMETHEUS}"
66 | },
67 | "fieldConfig": {
68 | "defaults": {
69 | "color": {
70 | "mode": "thresholds"
71 | },
72 | "mappings": [],
73 | "thresholds": {
74 | "mode": "absolute",
75 | "steps": [
76 | {
77 | "color": "green",
78 | "value": null
79 | },
80 | {
81 | "color": "red",
82 | "value": 80
83 | }
84 | ]
85 | }
86 | },
87 | "overrides": []
88 | },
89 | "gridPos": {
90 | "h": 3,
91 | "w": 2,
92 | "x": 0,
93 | "y": 0
94 | },
95 | "id": 6,
96 | "options": {
97 | "colorMode": "value",
98 | "graphMode": "none",
99 | "justifyMode": "auto",
100 | "orientation": "auto",
101 | "reduceOptions": {
102 | "calcs": [
103 | "lastNotNull"
104 | ],
105 | "fields": "",
106 | "values": false
107 | },
108 | "textMode": "name"
109 | },
110 | "pluginVersion": "10.1.1",
111 | "targets": [
112 | {
113 | "datasource": {
114 | "type": "prometheus",
115 | "uid": "${DS_PROMETHEUS}"
116 | },
117 | "disableTextWrap": false,
118 | "editorMode": "code",
119 | "expr": "mitsubishi2mqtt_version",
120 | "format": "time_series",
121 | "fullMetaSearch": false,
122 | "includeNullMetadata": true,
123 | "instant": false,
124 | "legendFormat": "{{version}}",
125 | "range": true,
126 | "refId": "A",
127 | "useBackend": false
128 | }
129 | ],
130 | "title": "Version",
131 | "type": "stat"
132 | },
133 | {
134 | "datasource": {
135 | "type": "prometheus",
136 | "uid": "${DS_PROMETHEUS}"
137 | },
138 | "fieldConfig": {
139 | "defaults": {
140 | "color": {
141 | "mode": "thresholds"
142 | },
143 | "mappings": [
144 | {
145 | "options": {
146 | "0": {
147 | "index": 0,
148 | "text": "Off"
149 | },
150 | "1": {
151 | "index": 1,
152 | "text": "On"
153 | }
154 | },
155 | "type": "value"
156 | }
157 | ],
158 | "thresholds": {
159 | "mode": "absolute",
160 | "steps": [
161 | {
162 | "color": "green",
163 | "value": null
164 | },
165 | {
166 | "color": "red",
167 | "value": 1
168 | }
169 | ]
170 | }
171 | },
172 | "overrides": []
173 | },
174 | "gridPos": {
175 | "h": 3,
176 | "w": 2,
177 | "x": 2,
178 | "y": 0
179 | },
180 | "id": 3,
181 | "options": {
182 | "colorMode": "value",
183 | "graphMode": "none",
184 | "justifyMode": "auto",
185 | "orientation": "auto",
186 | "reduceOptions": {
187 | "calcs": [
188 | "lastNotNull"
189 | ],
190 | "fields": "",
191 | "values": false
192 | },
193 | "textMode": "auto"
194 | },
195 | "pluginVersion": "10.1.1",
196 | "targets": [
197 | {
198 | "datasource": {
199 | "type": "prometheus",
200 | "uid": "${DS_PROMETHEUS}"
201 | },
202 | "disableTextWrap": false,
203 | "editorMode": "builder",
204 | "expr": "mitsubishi_power",
205 | "fullMetaSearch": false,
206 | "includeNullMetadata": true,
207 | "instant": false,
208 | "legendFormat": "__auto",
209 | "range": true,
210 | "refId": "A",
211 | "useBackend": false
212 | }
213 | ],
214 | "title": "Power",
215 | "type": "stat"
216 | },
217 | {
218 | "datasource": {
219 | "type": "prometheus",
220 | "uid": "${DS_PROMETHEUS}"
221 | },
222 | "fieldConfig": {
223 | "defaults": {
224 | "color": {
225 | "mode": "thresholds"
226 | },
227 | "mappings": [
228 | {
229 | "options": {
230 | "0": {
231 | "index": 6,
232 | "text": "Swing"
233 | },
234 | "1": {
235 | "index": 0,
236 | "text": "Position 1"
237 | },
238 | "2": {
239 | "index": 1,
240 | "text": "Position 2"
241 | },
242 | "3": {
243 | "index": 2,
244 | "text": "Position 3"
245 | },
246 | "4": {
247 | "index": 3,
248 | "text": "Position 4"
249 | },
250 | "5": {
251 | "index": 4,
252 | "text": "Position 5"
253 | },
254 | "6": {
255 | "index": 5,
256 | "text": "Position 6"
257 | }
258 | },
259 | "type": "value"
260 | }
261 | ],
262 | "thresholds": {
263 | "mode": "absolute",
264 | "steps": [
265 | {
266 | "color": "green",
267 | "value": null
268 | },
269 | {
270 | "color": "red",
271 | "value": 80
272 | }
273 | ]
274 | }
275 | },
276 | "overrides": []
277 | },
278 | "gridPos": {
279 | "h": 3,
280 | "w": 2,
281 | "x": 4,
282 | "y": 0
283 | },
284 | "id": 9,
285 | "options": {
286 | "colorMode": "value",
287 | "graphMode": "none",
288 | "justifyMode": "auto",
289 | "orientation": "auto",
290 | "reduceOptions": {
291 | "calcs": [
292 | "lastNotNull"
293 | ],
294 | "fields": "",
295 | "values": false
296 | },
297 | "textMode": "auto"
298 | },
299 | "pluginVersion": "10.1.1",
300 | "targets": [
301 | {
302 | "datasource": {
303 | "type": "prometheus",
304 | "uid": "${DS_PROMETHEUS}"
305 | },
306 | "disableTextWrap": false,
307 | "editorMode": "builder",
308 | "expr": "mitsubishi_widevane",
309 | "fullMetaSearch": false,
310 | "includeNullMetadata": true,
311 | "instant": false,
312 | "legendFormat": "__auto",
313 | "range": true,
314 | "refId": "A",
315 | "useBackend": false
316 | }
317 | ],
318 | "title": "WideVane",
319 | "type": "stat"
320 | },
321 | {
322 | "datasource": {
323 | "type": "prometheus",
324 | "uid": "${DS_PROMETHEUS}"
325 | },
326 | "fieldConfig": {
327 | "defaults": {
328 | "color": {
329 | "mode": "thresholds"
330 | },
331 | "mappings": [
332 | {
333 | "options": {
334 | "0": {
335 | "index": 6,
336 | "text": "Swing"
337 | },
338 | "1": {
339 | "index": 1,
340 | "text": "Position 1"
341 | },
342 | "2": {
343 | "index": 2,
344 | "text": "Position 2"
345 | },
346 | "3": {
347 | "index": 3,
348 | "text": "Position 3"
349 | },
350 | "4": {
351 | "index": 4,
352 | "text": "Position 4"
353 | },
354 | "5": {
355 | "index": 5,
356 | "text": "Position 5"
357 | },
358 | "-1": {
359 | "index": 0,
360 | "text": "Auto"
361 | }
362 | },
363 | "type": "value"
364 | }
365 | ],
366 | "thresholds": {
367 | "mode": "absolute",
368 | "steps": [
369 | {
370 | "color": "green",
371 | "value": null
372 | },
373 | {
374 | "color": "red",
375 | "value": 80
376 | }
377 | ]
378 | }
379 | },
380 | "overrides": []
381 | },
382 | "gridPos": {
383 | "h": 3,
384 | "w": 2,
385 | "x": 6,
386 | "y": 0
387 | },
388 | "id": 8,
389 | "options": {
390 | "colorMode": "value",
391 | "graphMode": "none",
392 | "justifyMode": "auto",
393 | "orientation": "auto",
394 | "reduceOptions": {
395 | "calcs": [
396 | "lastNotNull"
397 | ],
398 | "fields": "",
399 | "values": false
400 | },
401 | "textMode": "auto"
402 | },
403 | "pluginVersion": "10.1.1",
404 | "targets": [
405 | {
406 | "datasource": {
407 | "type": "prometheus",
408 | "uid": "${DS_PROMETHEUS}"
409 | },
410 | "disableTextWrap": false,
411 | "editorMode": "builder",
412 | "expr": "mitsubishi_vane",
413 | "fullMetaSearch": false,
414 | "includeNullMetadata": true,
415 | "instant": false,
416 | "legendFormat": "__auto",
417 | "range": true,
418 | "refId": "A",
419 | "useBackend": false
420 | }
421 | ],
422 | "title": "Vane",
423 | "type": "stat"
424 | },
425 | {
426 | "datasource": {
427 | "type": "prometheus",
428 | "uid": "${DS_PROMETHEUS}"
429 | },
430 | "fieldConfig": {
431 | "defaults": {
432 | "color": {
433 | "mode": "thresholds"
434 | },
435 | "mappings": [
436 | {
437 | "options": {
438 | "0": {
439 | "index": 1,
440 | "text": "Quiet"
441 | },
442 | "1": {
443 | "index": 2,
444 | "text": "Speed 1"
445 | },
446 | "2": {
447 | "index": 3,
448 | "text": "Speed 2"
449 | },
450 | "3": {
451 | "index": 4,
452 | "text": "Speed 3"
453 | },
454 | "4": {
455 | "index": 5,
456 | "text": "Speed 4"
457 | },
458 | "-1": {
459 | "index": 0,
460 | "text": "Auto"
461 | }
462 | },
463 | "type": "value"
464 | }
465 | ],
466 | "thresholds": {
467 | "mode": "absolute",
468 | "steps": [
469 | {
470 | "color": "green",
471 | "value": null
472 | },
473 | {
474 | "color": "red",
475 | "value": 80
476 | }
477 | ]
478 | }
479 | },
480 | "overrides": []
481 | },
482 | "gridPos": {
483 | "h": 3,
484 | "w": 2,
485 | "x": 8,
486 | "y": 0
487 | },
488 | "id": 2,
489 | "options": {
490 | "colorMode": "value",
491 | "graphMode": "none",
492 | "justifyMode": "auto",
493 | "orientation": "auto",
494 | "reduceOptions": {
495 | "calcs": [
496 | "lastNotNull"
497 | ],
498 | "fields": "",
499 | "values": false
500 | },
501 | "textMode": "auto"
502 | },
503 | "pluginVersion": "10.1.1",
504 | "targets": [
505 | {
506 | "datasource": {
507 | "type": "prometheus",
508 | "uid": "${DS_PROMETHEUS}"
509 | },
510 | "disableTextWrap": false,
511 | "editorMode": "builder",
512 | "expr": "mitsubishi_fan_speed",
513 | "fullMetaSearch": false,
514 | "includeNullMetadata": true,
515 | "instant": false,
516 | "legendFormat": "__auto",
517 | "range": true,
518 | "refId": "A",
519 | "useBackend": false
520 | }
521 | ],
522 | "title": "Fan speed",
523 | "type": "stat"
524 | },
525 | {
526 | "datasource": {
527 | "type": "prometheus",
528 | "uid": "${DS_PROMETHEUS}"
529 | },
530 | "fieldConfig": {
531 | "defaults": {
532 | "color": {
533 | "mode": "thresholds"
534 | },
535 | "mappings": [
536 | {
537 | "options": {
538 | "0": {
539 | "index": 0,
540 | "text": "Idle"
541 | },
542 | "1": {
543 | "index": 1,
544 | "text": "Working"
545 | }
546 | },
547 | "type": "value"
548 | }
549 | ],
550 | "thresholds": {
551 | "mode": "absolute",
552 | "steps": [
553 | {
554 | "color": "green",
555 | "value": null
556 | },
557 | {
558 | "color": "red",
559 | "value": 1
560 | }
561 | ]
562 | }
563 | },
564 | "overrides": []
565 | },
566 | "gridPos": {
567 | "h": 3,
568 | "w": 2,
569 | "x": 10,
570 | "y": 0
571 | },
572 | "id": 11,
573 | "options": {
574 | "colorMode": "value",
575 | "graphMode": "none",
576 | "justifyMode": "auto",
577 | "orientation": "auto",
578 | "reduceOptions": {
579 | "calcs": [
580 | "lastNotNull"
581 | ],
582 | "fields": "",
583 | "values": false
584 | },
585 | "textMode": "auto"
586 | },
587 | "pluginVersion": "10.1.1",
588 | "targets": [
589 | {
590 | "datasource": {
591 | "type": "prometheus",
592 | "uid": "${DS_PROMETHEUS}"
593 | },
594 | "disableTextWrap": false,
595 | "editorMode": "builder",
596 | "expr": "mitsubishi_operating",
597 | "fullMetaSearch": false,
598 | "includeNullMetadata": true,
599 | "instant": false,
600 | "legendFormat": "__auto",
601 | "range": true,
602 | "refId": "A",
603 | "useBackend": false
604 | }
605 | ],
606 | "title": "Compressor status",
607 | "type": "stat"
608 | },
609 | {
610 | "datasource": {
611 | "type": "prometheus",
612 | "uid": "${DS_PROMETHEUS}"
613 | },
614 | "fieldConfig": {
615 | "defaults": {
616 | "color": {
617 | "mode": "thresholds"
618 | },
619 | "mappings": [
620 | {
621 | "options": {
622 | "0": {
623 | "index": 0,
624 | "text": "Off"
625 | },
626 | "1": {
627 | "index": 2,
628 | "text": "Cool"
629 | },
630 | "2": {
631 | "index": 3,
632 | "text": "Dry"
633 | },
634 | "3": {
635 | "index": 4,
636 | "text": "Heat"
637 | },
638 | "4": {
639 | "index": 5,
640 | "text": "Fan"
641 | },
642 | "-1": {
643 | "index": 1,
644 | "text": "Auto"
645 | }
646 | },
647 | "type": "value"
648 | }
649 | ],
650 | "thresholds": {
651 | "mode": "absolute",
652 | "steps": [
653 | {
654 | "color": "text",
655 | "value": null
656 | },
657 | {
658 | "color": "green",
659 | "value": -1
660 | },
661 | {
662 | "color": "blue",
663 | "value": 1
664 | },
665 | {
666 | "color": "#EF843C",
667 | "value": 2
668 | },
669 | {
670 | "color": "red",
671 | "value": 3
672 | },
673 | {
674 | "color": "#EAB839",
675 | "value": 4
676 | }
677 | ]
678 | }
679 | },
680 | "overrides": []
681 | },
682 | "gridPos": {
683 | "h": 3,
684 | "w": 2,
685 | "x": 12,
686 | "y": 0
687 | },
688 | "id": 10,
689 | "options": {
690 | "colorMode": "value",
691 | "graphMode": "none",
692 | "justifyMode": "auto",
693 | "orientation": "auto",
694 | "reduceOptions": {
695 | "calcs": [
696 | "lastNotNull"
697 | ],
698 | "fields": "",
699 | "values": false
700 | },
701 | "textMode": "auto"
702 | },
703 | "pluginVersion": "10.1.1",
704 | "targets": [
705 | {
706 | "datasource": {
707 | "type": "prometheus",
708 | "uid": "${DS_PROMETHEUS}"
709 | },
710 | "disableTextWrap": false,
711 | "editorMode": "builder",
712 | "expr": "mitsubishi_mode",
713 | "fullMetaSearch": false,
714 | "includeNullMetadata": true,
715 | "instant": false,
716 | "legendFormat": "__auto",
717 | "range": true,
718 | "refId": "A",
719 | "useBackend": false
720 | }
721 | ],
722 | "title": "Mode",
723 | "type": "stat"
724 | },
725 | {
726 | "datasource": {
727 | "type": "prometheus",
728 | "uid": "${DS_PROMETHEUS}"
729 | },
730 | "fieldConfig": {
731 | "defaults": {
732 | "color": {
733 | "mode": "palette-classic"
734 | },
735 | "decimals": 0,
736 | "mappings": [],
737 | "max": 31,
738 | "min": 16,
739 | "thresholds": {
740 | "mode": "absolute",
741 | "steps": [
742 | {
743 | "color": "green",
744 | "value": null
745 | }
746 | ]
747 | },
748 | "unit": "celsius"
749 | },
750 | "overrides": []
751 | },
752 | "gridPos": {
753 | "h": 3,
754 | "w": 2,
755 | "x": 14,
756 | "y": 0
757 | },
758 | "id": 7,
759 | "options": {
760 | "colorMode": "value",
761 | "graphMode": "none",
762 | "justifyMode": "auto",
763 | "orientation": "auto",
764 | "reduceOptions": {
765 | "calcs": [
766 | "lastNotNull"
767 | ],
768 | "fields": "",
769 | "values": false
770 | },
771 | "textMode": "auto"
772 | },
773 | "pluginVersion": "10.1.1",
774 | "targets": [
775 | {
776 | "datasource": {
777 | "type": "prometheus",
778 | "uid": "${DS_PROMETHEUS}"
779 | },
780 | "disableTextWrap": false,
781 | "editorMode": "builder",
782 | "expr": "mitsubishi_temperature_target_celsius",
783 | "fullMetaSearch": false,
784 | "includeNullMetadata": true,
785 | "instant": false,
786 | "legendFormat": "__auto",
787 | "range": true,
788 | "refId": "A",
789 | "useBackend": false
790 | }
791 | ],
792 | "title": "Target temperature",
793 | "type": "stat"
794 | },
795 | {
796 | "datasource": {
797 | "type": "prometheus",
798 | "uid": "${DS_PROMETHEUS}"
799 | },
800 | "fieldConfig": {
801 | "defaults": {
802 | "color": {
803 | "mode": "palette-classic"
804 | },
805 | "custom": {
806 | "axisCenteredZero": false,
807 | "axisColorMode": "text",
808 | "axisLabel": "",
809 | "axisPlacement": "auto",
810 | "barAlignment": 0,
811 | "drawStyle": "line",
812 | "fillOpacity": 0,
813 | "gradientMode": "none",
814 | "hideFrom": {
815 | "legend": false,
816 | "tooltip": false,
817 | "viz": false
818 | },
819 | "insertNulls": false,
820 | "lineInterpolation": "linear",
821 | "lineWidth": 1,
822 | "pointSize": 5,
823 | "scaleDistribution": {
824 | "type": "linear"
825 | },
826 | "showPoints": "auto",
827 | "spanNulls": false,
828 | "stacking": {
829 | "group": "A",
830 | "mode": "none"
831 | },
832 | "thresholdsStyle": {
833 | "mode": "off"
834 | }
835 | },
836 | "decimals": 0,
837 | "mappings": [],
838 | "thresholds": {
839 | "mode": "absolute",
840 | "steps": [
841 | {
842 | "color": "green",
843 | "value": null
844 | },
845 | {
846 | "color": "red",
847 | "value": 80
848 | }
849 | ]
850 | },
851 | "unit": "celsius"
852 | },
853 | "overrides": []
854 | },
855 | "gridPos": {
856 | "h": 8,
857 | "w": 24,
858 | "x": 0,
859 | "y": 3
860 | },
861 | "id": 4,
862 | "options": {
863 | "legend": {
864 | "calcs": [],
865 | "displayMode": "list",
866 | "placement": "bottom",
867 | "showLegend": false
868 | },
869 | "tooltip": {
870 | "mode": "single",
871 | "sort": "none"
872 | }
873 | },
874 | "targets": [
875 | {
876 | "datasource": {
877 | "type": "prometheus",
878 | "uid": "${DS_PROMETHEUS}"
879 | },
880 | "disableTextWrap": false,
881 | "editorMode": "builder",
882 | "expr": "mitsubishi_temperature_room_celsius",
883 | "fullMetaSearch": false,
884 | "includeNullMetadata": true,
885 | "instant": false,
886 | "legendFormat": "__auto",
887 | "range": true,
888 | "refId": "A",
889 | "useBackend": false
890 | }
891 | ],
892 | "title": "Room temperature",
893 | "type": "timeseries"
894 | },
895 | {
896 | "datasource": {
897 | "type": "prometheus",
898 | "uid": "${DS_PROMETHEUS}"
899 | },
900 | "fieldConfig": {
901 | "defaults": {
902 | "color": {
903 | "mode": "continuous-GrYlRd"
904 | },
905 | "custom": {
906 | "axisCenteredZero": false,
907 | "axisColorMode": "text",
908 | "axisLabel": "",
909 | "axisPlacement": "auto",
910 | "barAlignment": 0,
911 | "drawStyle": "line",
912 | "fillOpacity": 0,
913 | "gradientMode": "none",
914 | "hideFrom": {
915 | "legend": false,
916 | "tooltip": false,
917 | "viz": false
918 | },
919 | "insertNulls": false,
920 | "lineInterpolation": "linear",
921 | "lineWidth": 1,
922 | "pointSize": 5,
923 | "scaleDistribution": {
924 | "type": "linear"
925 | },
926 | "showPoints": "auto",
927 | "spanNulls": false,
928 | "stacking": {
929 | "group": "A",
930 | "mode": "none"
931 | },
932 | "thresholdsStyle": {
933 | "mode": "off"
934 | }
935 | },
936 | "mappings": [],
937 | "thresholds": {
938 | "mode": "absolute",
939 | "steps": [
940 | {
941 | "color": "green",
942 | "value": null
943 | },
944 | {
945 | "color": "red",
946 | "value": 80
947 | }
948 | ]
949 | }
950 | },
951 | "overrides": []
952 | },
953 | "gridPos": {
954 | "h": 10,
955 | "w": 24,
956 | "x": 0,
957 | "y": 11
958 | },
959 | "id": 1,
960 | "options": {
961 | "legend": {
962 | "calcs": [],
963 | "displayMode": "list",
964 | "placement": "bottom",
965 | "showLegend": false
966 | },
967 | "tooltip": {
968 | "mode": "single",
969 | "sort": "none"
970 | }
971 | },
972 | "targets": [
973 | {
974 | "datasource": {
975 | "type": "prometheus",
976 | "uid": "${DS_PROMETHEUS}"
977 | },
978 | "disableTextWrap": false,
979 | "editorMode": "builder",
980 | "expr": "mitsubishi_compressor_frequency",
981 | "fullMetaSearch": false,
982 | "includeNullMetadata": true,
983 | "instant": false,
984 | "legendFormat": "__auto",
985 | "range": true,
986 | "refId": "A",
987 | "useBackend": false
988 | }
989 | ],
990 | "title": "Compressor Frequency",
991 | "type": "timeseries"
992 | }
993 | ],
994 | "refresh": "30s",
995 | "schemaVersion": 38,
996 | "style": "dark",
997 | "tags": [],
998 | "templating": {
999 | "list": []
1000 | },
1001 | "time": {
1002 | "from": "now-6h",
1003 | "to": "now"
1004 | },
1005 | "timepicker": {},
1006 | "timezone": "",
1007 | "title": "Mitsubishi2mqtt",
1008 | "uid": "f69c218b-7b1e-4f70-9833-8759a0b8807a",
1009 | "version": 7,
1010 | "weekStart": ""
1011 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # mitsubishi2MQTT
2 | Use MQTT and ESP8266/ESP32 module to control Mitsubishi HVAC unit.
3 | It use SwiCago libraries: https://github.com/SwiCago/HeatPump
4 |
5 | ***
6 | Features:
7 | - Initial config: WIFI AP mode and web portal
8 | - Web interface for configuration, status and control, firmware upgrade
9 | - Homeassistant autodiscovery and control with MQTT
10 | - Control with MQTT
11 | - Multilanguages
12 |
13 | Screenshots:
14 |
15 | 
16 |
17 | 
18 |
19 | 
20 |
21 | ***
22 | How to use:
23 | - Step 1: flash the sketch with flash size include SPIFFS option.
24 | - Step 2: connect to device AP with name HVAC_XXXX (XXXX last 4 character MAC address)
25 | - Step 3: You should be automatically redirected to the web portal or go to 192.168.1.1
26 | - Step 4: set Wifi information, save & reboot. Fall back to AP mode if WiFi connection fails (AP password sets to default SSID name from step 2).
27 | - Step 5: find the device IP with last 4 character MAC address in your router
28 | - Step 6: (optional): Set MQTT information for use with Home Assistant
29 | - Step 7: (optional): Set Login password to prevent unwanted access in SETUP->ADVANCE->Login Password
30 |
31 | Nightly builds are available for select platforms via GitHub Actions. Go to [the platformio workflow](https://github.com/gysmo38/mitsubishi2MQTT/actions/workflows/platformio.yml), select the latest build, then check the **Artifacts** section.
32 |
33 | ***
34 | For nodered fans MQTT topic use cases
35 | - topic/power/set OFF
36 | - topic/mode/set AUTO HEAT COOL DRY FAN_ONLY OFF ON
37 | - topic/temp/set 16-31
38 | - topic/remote_temp/set also called "room_temp", the implementation defined in "HeatPump" seems not work in some models
39 | - topic/fan/set 1-4 AUTO QUIET
40 | - topic/vane/set 1-5 SWING AUTO
41 | - topic/wideVane/set << < | > >>
42 | - topic/settings
43 | - topic/state
44 | - topic/debug/packets
45 | - topic/debug/packets/set on off
46 | - topic/debug/logs
47 | - topic/debug/logs/set on off
48 | - topic/custom/send as example "fc 42 01 30 10 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7b " see https://github.com/SwiCago/HeatPump/blob/master/src/HeatPump.h
49 | - topic/system/set reboot
50 | ***
51 | # Grafana dashboard
52 | To use Grafana you need to have Prometheus and Grafana (v10 or newer) installed.
53 | Config for Prometheus:
54 | ``` - job_name: Mitsubishi2mqtt
55 | static_configs:
56 | - targets:
57 | - IP-TO-Mitsubishi2mqtt
58 | ```
59 | Then add Prometheus as a datasource in Grafana
60 | Grafana -> Connections -> Add new connection -> Prometheus -> ```Prometheus server URL: PROMETHEUS-IP:PORT```
61 |
62 | Then you can import the dashboard in Grafana -> Dashboards -> New -> Import and upload the file https://github.com/gysmo38/mitsubishi2MQTT/blob/master/Mitsubishi2mqtt.json
63 |
64 | 
65 |
66 | If you like my work and use it ;)
67 |
68 |
69 |
--------------------------------------------------------------------------------
/images/Grafana-screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gysmo38/mitsubishi2MQTT/c92ac8f27c6733048f23758243ef59a37851189d/images/Grafana-screenshot.png
--------------------------------------------------------------------------------
/images/config_page.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gysmo38/mitsubishi2MQTT/c92ac8f27c6733048f23758243ef59a37851189d/images/config_page.png
--------------------------------------------------------------------------------
/images/control_page.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gysmo38/mitsubishi2MQTT/c92ac8f27c6733048f23758243ef59a37851189d/images/control_page.png
--------------------------------------------------------------------------------
/images/initial_setup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gysmo38/mitsubishi2MQTT/c92ac8f27c6733048f23758243ef59a37851189d/images/initial_setup.png
--------------------------------------------------------------------------------
/images/main_page.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gysmo38/mitsubishi2MQTT/c92ac8f27c6733048f23758243ef59a37851189d/images/main_page.png
--------------------------------------------------------------------------------
/platformio.ini:
--------------------------------------------------------------------------------
1 | ; PlatformIO MITSUBISHI2MQTT Configuration File
2 | [platformio]
3 | src_dir = src/mitsubishi2mqtt
4 | default_envs =
5 |
6 | [env]
7 | lib_deps_ext =
8 | ArduinoJson @6.20.0
9 | PubSubClient @2.8
10 | https://github.com/SwiCago/HeatPump
11 | lib_deps =
12 | bblanchon/ArduinoJson @ ^6.21.3
13 | knolleary/PubSubClient @ ^2.8
14 | https://github.com/SwiCago/HeatPump
15 |
16 | [env:ESP8266-ESP01]
17 | board = esp01_1m
18 | platform = espressif8266
19 | framework = arduino
20 | monitor_speed = 115200
21 | board_build.ldscript = eagle.flash.1m64.ld
22 |
23 | [env:WEMOS_D1_Mini]
24 | platform = espressif8266
25 | board = d1_mini
26 | framework = arduino
27 | monitor_speed = 115200
28 | upload_speed = 460800
29 | ; Aligns flash layout to default Arduino IDE settings
30 | board_build.ldscript = eagle.flash.4m2m.ld
31 |
32 | [env:ESP32DEV]
33 | platform = espressif32
34 | board = esp32dev
35 | framework = arduino
36 | lib_deps = ${env.lib_deps_ext}
37 | build_flags = -D CORE_DEBUG_LEVEL=0
38 |
--------------------------------------------------------------------------------
/src/mitsubishi2mqtt/config.h:
--------------------------------------------------------------------------------
1 | /*
2 | mitsubishi2mqtt - Mitsubishi Heat Pump to MQTT control for Home Assistant.
3 | Copyright (c) 2022 gysmo38, dzungpv, shampeon, endeavour, jascdk, chrdavis, alekslyse. All right reserved.
4 | This library is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU Lesser General Public
6 | License as published by the Free Software Foundation; either
7 | version 2.1 of the License, or (at your option) any later version.
8 | This library is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | Lesser General Public License for more details.
12 | You should have received a copy of the GNU Lesser General Public
13 | License along with this library; if not, write to the Free Software
14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 | */
16 |
17 | /*#define MY_LANGUAGE fr-FR // define your language*/
18 |
19 | const PROGMEM char* m2mqtt_version = "2024.8.1";
20 |
21 | //Define global variables for files
22 | #ifdef ESP32
23 | const PROGMEM char* wifi_conf = "/wifi.json";
24 | const PROGMEM char* mqtt_conf = "/mqtt.json";
25 | const PROGMEM char* unit_conf = "/unit.json";
26 | const PROGMEM char* console_file = "/console.log";
27 | const PROGMEM char* others_conf = "/others.json";
28 | // pinouts
29 | const PROGMEM uint8_t blueLedPin = 2; // The ESP32 has an internal blue LED at D2 (GPIO 02)
30 | #else
31 | const PROGMEM char* wifi_conf = "wifi.json";
32 | const PROGMEM char* mqtt_conf = "mqtt.json";
33 | const PROGMEM char* unit_conf = "unit.json";
34 | const PROGMEM char* console_file = "console.log";
35 | const PROGMEM char* others_conf = "others.json";
36 | // pinouts
37 | const PROGMEM uint8_t blueLedPin = LED_BUILTIN; // Onboard LED = digital pin 2 "D4" (blue LED on WEMOS D1-Mini)
38 | #endif
39 | const PROGMEM uint8_t redLedPin = 0;
40 |
41 | // Define global variables for network
42 | const PROGMEM char* hostnamePrefix = "HVAC_";
43 | const PROGMEM uint32_t WIFI_RETRY_INTERVAL_MS = 300000;
44 | unsigned long wifi_timeout;
45 | bool wifi_config_exists;
46 | String hostname = "";
47 | String ap_ssid;
48 | String ap_pwd;
49 | String ota_pwd;
50 |
51 | // Define global variables for MQTT
52 | String mqtt_fn;
53 | String mqtt_server;
54 | String mqtt_port;
55 | String mqtt_username;
56 | String mqtt_password;
57 | String mqtt_topic = "mitsubishi2mqtt";
58 | String mqtt_client_id;
59 | const PROGMEM char* mqtt_payload_available = "online";
60 | const PROGMEM char* mqtt_payload_unavailable = "offline";
61 |
62 | //Define global variables for Others settings
63 | bool others_haa;
64 | String others_haa_topic;
65 |
66 | // Define global variables for HA topics
67 | String ha_system_set_topic;
68 | String ha_mode_set_topic;
69 | String ha_temp_set_topic;
70 | String ha_remote_temp_set_topic;
71 | String ha_fan_set_topic;
72 | String ha_vane_set_topic;
73 | String ha_wideVane_set_topic;
74 | String ha_settings_topic;
75 | String ha_state_topic;
76 | String ha_debug_pckts_topic;
77 | String ha_debug_pckts_set_topic;
78 | String ha_debug_logs_topic;
79 | String ha_debug_logs_set_topic;
80 | String ha_config_topic;
81 | String ha_discovery_topic;
82 | String ha_custom_packet;
83 | String ha_availability_topic;
84 | String hvac_name;
85 |
86 | //login
87 | String login_username = "admin";
88 | String login_password;
89 |
90 | // debug mode logs, when true, will send all debug messages to topic heatpump_debug_logs_topic
91 | // this can also be set by sending "on" to heatpump_debug_set_topic
92 | bool _debugModeLogs = false;
93 | // debug mode packets, when true, will send all packets received from the heatpump to topic heatpump_debug_packets_topic
94 | // this can also be set by sending "on" to heatpump_debug_set_topic
95 | bool _debugModePckts = false;
96 |
97 | // Customization
98 | uint8_t min_temp = 16; // Minimum temperature, in your selected unit, check value from heatpump remote control
99 | uint8_t max_temp = 31; // Maximum temperature, in your selected unit, check value from heatpump remote control
100 | String temp_step = "1"; // Temperature setting step, check value from heatpump remote control
101 |
102 | // sketch settings
103 | const PROGMEM uint32_t SEND_ROOM_TEMP_INTERVAL_MS = 30000; // 45 seconds (anything less may cause bouncing)
104 | const PROGMEM uint32_t CHECK_REMOTE_TEMP_INTERVAL_MS = 300000; //5 minutes
105 | const PROGMEM uint32_t MQTT_RETRY_INTERVAL_MS = 1000; // 1 second
106 | const PROGMEM uint32_t HP_RETRY_INTERVAL_MS = 1000; // 1 second
107 | const PROGMEM uint32_t HP_MAX_RETRIES = 10; // Double the interval between retries up to this many times, then keep retrying forever at that maximum interval.
108 | // Default values give a final retry interval of 1000ms * 2^10, which is 1024 seconds, about 17 minutes.
109 |
110 | // temp settings
111 | bool useFahrenheit = false;
112 | // support heat mode settings, some model do not support heat mode
113 | bool supportHeatMode = true;
114 |
--------------------------------------------------------------------------------
/src/mitsubishi2mqtt/html_common.h:
--------------------------------------------------------------------------------
1 | /*
2 | mitsubishi2mqtt - Mitsubishi Heat Pump to MQTT control for Home Assistant.
3 | Copyright (c) 2022 gysmo38, dzungpv, shampeon, endeavour, jascdk, chrdavis, alekslyse. All right reserved.
4 | This library is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU Lesser General Public
6 | License as published by the Free Software Foundation; either
7 | version 2.1 of the License, or (at your option) any later version.
8 | This library is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | Lesser General Public License for more details.
12 | You should have received a copy of the GNU Lesser General Public
13 | License along with this library; if not, write to the Free Software
14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 | */
16 | const char html_common_header[] PROGMEM = R"====(
17 |
18 |
19 |
20 |
21 |
22 | Mitsubishi2MQTT - _UNIT_NAME_
23 |
168 |
169 |
170 |
183 |
184 |
185 |
186 | )====";
187 |
--------------------------------------------------------------------------------
/src/mitsubishi2mqtt/html_init.h:
--------------------------------------------------------------------------------
1 | /*
2 | mitsubishi2mqtt - Mitsubishi Heat Pump to MQTT control for Home Assistant.
3 | Copyright (c) 2022 gysmo38, dzungpv, shampeon, endeavour, jascdk, chrdavis, alekslyse. All right reserved.
4 | This library is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU Lesser General Public
6 | License as published by the Free Software Foundation; either
7 | version 2.1 of the License, or (at your option) any later version.
8 | This library is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | Lesser General Public License for more details.
12 | You should have received a copy of the GNU Lesser General Public
13 | License along with this library; if not, write to the Free Software
14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 | */
16 |
17 | const char html_init_setup[] PROGMEM = R"====(
18 |
19 |
54 | )====";
55 |
--------------------------------------------------------------------------------
/src/mitsubishi2mqtt/html_menu.h:
--------------------------------------------------------------------------------
1 | /*
2 | mitsubishi2mqtt - Mitsubishi Heat Pump to MQTT control for Home Assistant.
3 | Copyright (c) 2022 gysmo38, dzungpv, shampeon, endeavour, jascdk, chrdavis, alekslyse. All right reserved.
4 | This library is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU Lesser General Public
6 | License as published by the Free Software Foundation; either
7 | version 2.1 of the License, or (at your option) any later version.
8 | This library is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | Lesser General Public License for more details.
12 | You should have received a copy of the GNU Lesser General Public
13 | License along with this library; if not, write to the Free Software
14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 | */
16 |
17 | const char html_menu_root[] PROGMEM = R"====(
18 |
89 |
90 | )====";
91 |
--------------------------------------------------------------------------------
/src/mitsubishi2mqtt/html_metrics.h:
--------------------------------------------------------------------------------
1 | /*
2 | mitsubishi2mqtt - Mitsubishi Heat Pump to MQTT control for Home Assistant.
3 | Copyright (c) 2022 gysmo38, dzungpv, shampeon, endeavour, jascdk, chrdavis, alekslyse. All right reserved.
4 | This library is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU Lesser General Public
6 | License as published by the Free Software Foundation; either
7 | version 2.1 of the License, or (at your option) any later version.
8 | This library is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | Lesser General Public License for more details.
12 | You should have received a copy of the GNU Lesser General Public
13 | License along with this library; if not, write to the Free Software
14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 | */
16 |
17 | const char html_metrics[] PROGMEM = R"====(
18 | # HELP mitsubishi2mqtt_version Mitsubishi2MQTT version
19 | # TYPE mitsubishi2mqtt_version gauge
20 | mitsubishi2mqtt_version{hostname="_UNIT_NAME_",version="_VERSION_"} 1
21 | # HELP mitsubishi_power Heat pump power setting
22 | # TYPE mitsubishi_power gauge
23 | mitsubishi_power{hostname="_UNIT_NAME_"} _POWER_
24 | # HELP mitsubishi_temperature_room_celsius Current room temperature
25 | # TYPE mitsubishi_temperature_room_celsius gauge
26 | mitsubishi_temperature_room_celsius{hostname="_UNIT_NAME_"} _ROOMTEMP_
27 | # HELP mitsubishi_temperature_target_celsius Target room temperature
28 | # TYPE mitsubishi_temperature_target_celsius gauge
29 | mitsubishi_temperature_target_celsius{hostname="_UNIT_NAME_"} _TEMP_
30 | # HELP mitsubishi_fan_speed Heat pump fan speed
31 | # TYPE mitsubishi_fan_speed gauge
32 | mitsubishi_fan_speed{hostname="_UNIT_NAME_"} _FAN_
33 | # HELP mitsubishi_vane Heat pump vane setting
34 | # TYPE mitsubishi_vane gauge
35 | mitsubishi_vane{hostname="_UNIT_NAME_"} _VANE_
36 | # HELP mitsubishi_widevane Heat pump wide vane setting
37 | # TYPE mitsubishi_widevane gauge
38 | mitsubishi_widevane{hostname="_UNIT_NAME_"} _WIDEVANE_
39 | # HELP mitsubishi_mode Heat pump operating mode
40 | # TYPE mitsubishi_mode gauge
41 | mitsubishi_mode{hostname="_UNIT_NAME_"} _MODE_
42 | # HELP mitsubishi_operating Heat pump operational status
43 | # TYPE mitsubishi_operating gauge
44 | mitsubishi_operating{hostname="_UNIT_NAME_"} _OPER_
45 | # HELP mitsubishi_compressor_frequency Heat pump compressor frequency
46 | # TYPE mitsubishi_compressor_frequency gauge
47 | mitsubishi_compressor_frequency{hostname="_UNIT_NAME_"} _COMPFREQ_
48 | )====";
49 |
--------------------------------------------------------------------------------
/src/mitsubishi2mqtt/html_pages.h:
--------------------------------------------------------------------------------
1 | /*
2 | mitsubishi2mqtt - Mitsubishi Heat Pump to MQTT control for Home Assistant.
3 | Copyright (c) 2022 gysmo38, dzungpv, shampeon, endeavour, jascdk, chrdavis, alekslyse. All right reserved.
4 | This library is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU Lesser General Public
6 | License as published by the Free Software Foundation; either
7 | version 2.1 of the License, or (at your option) any later version.
8 | This library is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | Lesser General Public License for more details.
12 | You should have received a copy of the GNU Lesser General Public
13 | License along with this library; if not, write to the Free Software
14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15 | */
16 |
17 |
18 | const char html_page_reboot[] PROGMEM =
19 | "