Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Broadlink] Initial contribution #16273

Open
wants to merge 214 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 165 commits
Commits
Show all changes
214 commits
Select commit Hold shift + click to select a range
ee60cd1
Initial import of the broadlink binding for openhab 4.2
AntonJansen Jan 13, 2024
53517db
Cleaned up the binding information files to confirm to coding guideli…
AntonJansen Jan 13, 2024
3acad3f
Added missing artifact to the bom pom.xml such that the CI hopefully …
AntonJansen Jan 14, 2024
5ec10d7
Updated the copyright notice from 2023 to 2024. Happy new year!
AntonJansen Jan 14, 2024
d5dc281
Fixed:
AntonJansen Jan 14, 2024
9c8b29d
Fixed an issue with a new RM Pro 4 not working. Changes include:
AntonJansen Jan 23, 2024
839a384
Created a distinction between a RM 4 Mini and RM 4 Pro.
AntonJansen Jan 25, 2024
afdb598
Add forgotten files for introduction to new RM 4 Mini and Pro distinc…
AntonJansen Jan 25, 2024
8e8bd11
Fixed missing copyright header
AntonJansen Jan 25, 2024
e85a786
Added missing author.
AntonJansen Jan 25, 2024
4d5cf72
Added missing @nonbydefault for new class
AntonJansen Jan 25, 2024
ef48ae1
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 27, 2024
84ffb73
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 27, 2024
63a7dc1
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 27, 2024
9ccaa98
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 27, 2024
1b4a8ab
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 27, 2024
58036a6
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 27, 2024
4bf1958
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 27, 2024
2c7c464
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 27, 2024
4493fb0
Busy creating a new structure for the rm pro types.
AntonJansen Jan 27, 2024
af65950
Fixed SAT errors.
AntonJansen Jan 27, 2024
37974e0
Cleaned up unnecessary log entries.
AntonJansen Jan 27, 2024
51e2572
Added PMD supression for error prone issues with mock logger in tests.
AntonJansen Jan 27, 2024
5f84de0
Added the ability to set the name of a IR/RF command to learn as a pr…
AntonJansen Jan 27, 2024
fc94c4e
Added missed new rmpro-config.
AntonJansen Jan 27, 2024
acb209c
use hypen for things
AntonJansen Jan 28, 2024
789d768
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 28, 2024
aedf310
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Jan 28, 2024
23bdc5a
Fixed naming convention issues and added more explanation to logging …
AntonJansen Jan 28, 2024
bc26a9d
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Jan 28, 2024
8975853
Removed legacy files not being used by the binding anymore.
AntonJansen Jan 28, 2024
ec76bbe
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jan 28, 2024
98404df
Cleaned up all the logger.warn() entries to conform to the defined
AntonJansen Jan 28, 2024
b5f9c5a
Did some more logging clean-up.
AntonJansen Jan 28, 2024
59fb96c
Moving constants to right package, cleaning up the other files
AntonJansen Jan 28, 2024
514663d
Moving the handlers to a package under internal.
AntonJansen Jan 28, 2024
d5d78a3
Moved the thing configuration to internal.
AntonJansen Jan 28, 2024
fe04872
Updated the internationalization file.
AntonJansen Jan 30, 2024
3c0c5fd
Busy creating a new structure for the rm pro types.
AntonJansen Jan 27, 2024
1985afe
Added the ability to set the name of a IR/RF command to learn as a pr…
AntonJansen Jan 27, 2024
326846e
Added missed new rmpro-config.
AntonJansen Jan 27, 2024
1cb9287
Merge branch 'rm4pros' of github.com:AntonJansen/openhab-addons into …
AntonJansen Jan 31, 2024
5cf28f0
Fixed logging message using wrong format.
AntonJansen Jan 31, 2024
564afb1
Refactored the storing of properties.
AntonJansen Jan 31, 2024
593fb7a
Managed to get a first rough version of the RF to work! A lot of clea…
AntonJansen Feb 11, 2024
485fa08
Partially updated documentation. Fixed issue with save / refresh not …
AntonJansen Feb 11, 2024
325651a
Fixed a concurrency problem with the file watcher. Update documentation
AntonJansen Feb 11, 2024
22cf2c1
Updated documentation and made the RF channel clearly communicate to …
AntonJansen Feb 16, 2024
18ca6b2
Created a first version for the handling of RF commands that
AntonJansen Feb 17, 2024
8627a65
Fixed an issue in the documentation.
AntonJansen Feb 17, 2024
fc23f4f
Merge branch 'openhab:main' into rm4pros
AntonJansen Mar 18, 2024
ceafc49
Merge branch 'openhab:main' into broadlink-binding-4.2.x
AntonJansen Mar 18, 2024
a7fede2
This commit removes the hability to rename mapping files. This is do…
Mar 19, 2024
7a822a9
Add a logo of broadlink
AntonJansen Mar 19, 2024
1124cc9
This commit introduces the StorageService libraries into the code, an…
Mar 20, 2024
8202eee
Modified normalized map files standard file name.
Mar 21, 2024
b797368
Updated Documentation
Mar 25, 2024
24588a3
Modified the BroadlinkMappingService to use OpenHAB StorageService
Mar 25, 2024
6d686e5
changed fixed filenames so they look prettier
Mar 25, 2024
bffcdcb
Re-Add the capability to change file name
Mar 25, 2024
075e174
Added string ClassLoader to getStorage function calls
Mar 25, 2024
7e16a7f
Corrected conversion script
Mar 25, 2024
55b82de
Removed the broadlink logo, as it should become part of the documenta…
AntonJansen Mar 26, 2024
7382905
Introduce StorageService into test units
Mar 31, 2024
9c5fec7
-Finished including Storagecervice Libraries in Broadlink Mapping Tests
Apr 2, 2024
5176ef2
More compaile warning fixes from the test code
Apr 2, 2024
b21af2c
Remove Unnecessary variables and libraries from BroadlinkMappingService
Apr 3, 2024
76cfd04
Added options on the learn channel to modify and delete commands for …
Apr 3, 2024
4276728
Updated Documentation
Apr 4, 2024
b66dc4e
Improved Interface channel descriptions
Apr 4, 2024
4c92eba
Removed unused code
Apr 4, 2024
06842c0
Modified Learning code to account for the fact that modify and read f…
Apr 4, 2024
8623bca
Resolve TodoCommentCheck on line 64
Apr 4, 2024
a946508
Resolve ConstantNameCheck on lines 33, 34, 36
Apr 4, 2024
a967c99
Resolve SimplifyBooleanExpressions on lines 148, 166, 192, 240
Apr 4, 2024
c155756
Merge pull request #2 from rlarranaga/rm4pros_StorageService
AntonJansen Apr 4, 2024
ff0cb54
- Removed the ability to set the name of the IR/RF code files.
AntonJansen Apr 5, 2024
95a9ab0
Update the Alpha version for people to download to be in sync with
AntonJansen Apr 5, 2024
ecf1e83
Fixed Tests
Apr 5, 2024
f7bad37
-Merged IR and RF functions into 1 set
Apr 5, 2024
d474c8b
Fixes a Bug that loaded IR commands into RF list
Apr 6, 2024
3e177f7
Added some information in the Docs
Apr 6, 2024
fc4304c
Fixed Styling
Apr 6, 2024
a0276c1
-Removed unnecessary variables
Apr 6, 2024
f39d280
-Fixed Bug where Commands for RF were being loaded from the IR Storage
Apr 6, 2024
726ab0c
Fixed bug mixing up the update of the IR and RF channels.
AntonJansen Apr 6, 2024
f3781a1
Merge branch 'openhab:main' into rm4pros
rlarranaga Apr 6, 2024
0a48a44
Fixed Bug in tests
Apr 11, 2024
5471f06
Implemented automatic refresh of command descriptions for all channel…
Apr 11, 2024
2eefba3
Fixed Bug in Automatic command reloading
Apr 11, 2024
df271c1
-Unified naming convention for IR and RF Learn, check, modify and del…
Apr 11, 2024
bb0410a
Merge branch 'commanddescription_reload' into rm4pros and started cle…
AntonJansen Apr 14, 2024
ddd170a
- Fixed a bug with the wrong channel being used to provide feedback t…
AntonJansen Apr 15, 2024
ca43b9d
Refactored the IR adding and modification commands. Cleaned up some
AntonJansen Apr 16, 2024
c95859e
Update the alpha jar file.
AntonJansen Apr 16, 2024
bb194c0
Made the flow in the documentation more user friendly by moving the s…
AntonJansen Apr 16, 2024
890f85e
Merge branch 'rm4pros' into broadlink-binding-4.2.x
AntonJansen Apr 16, 2024
79b6f7d
Removed the snapshot jar.
AntonJansen Apr 16, 2024
435d543
Merge branch 'openhab:main' into rm4pros
AntonJansen Jun 2, 2024
aebfed3
Busy renaming RM2 to the RM Pro, as this is the name people are famil…
AntonJansen Jun 2, 2024
a611aad
Moved RF functionality to base class, so RM Pro can also use it.
AntonJansen Jun 6, 2024
d63ac89
Changed naming of channel ids and types to conform to the code style …
AntonJansen Jun 6, 2024
b5e5f61
Fixed the search & replacement damage on power and nightlight.
AntonJansen Jun 6, 2024
5d400aa
New alpha release with rf support for RM pro models.
AntonJansen Jun 6, 2024
1cbc396
Merge branch 'rm4pros' into broadlink-binding-4.2.x
AntonJansen Jun 7, 2024
5a782c9
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Jul 6, 2024
bd43a21
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Jul 6, 2024
d7ade38
Renaming rmpro to rm-pro.
AntonJansen Jul 6, 2024
9135f89
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Jul 6, 2024
fa212a5
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Jul 6, 2024
adb9490
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Jul 6, 2024
b93b969
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Jul 6, 2024
3ee37cf
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Jul 6, 2024
03f1e37
Busy renaming the channels for the mp types.
AntonJansen Jul 6, 2024
104eb8c
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Jul 6, 2024
9e77a13
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Jul 6, 2024
98ef014
Removed unnecessary null supression.
AntonJansen Jul 7, 2024
e0bd614
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Jul 7, 2024
c93fe9e
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Jul 7, 2024
315f17b
Fixed OpenHAB => openHAB.
AntonJansen Jul 7, 2024
2ecda12
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Jul 7, 2024
1a266a4
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Jul 7, 2024
b638449
Added text explaining that the map file information is needed for mig…
AntonJansen Jul 7, 2024
6003f64
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 7, 2024
81183e0
Added documentation of the socket listener interface.
AntonJansen Jul 7, 2024
a37a5a9
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 7, 2024
cf7a46b
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 7, 2024
aa19951
Refactoring based on Isiepel feedback.
AntonJansen Jul 7, 2024
653093e
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Jul 7, 2024
d1c5393
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 7, 2024
9f6f50b
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 7, 2024
a786447
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 7, 2024
080d487
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 7, 2024
06777b0
Introduced enum type to make the distinction between IR and RF codes.
AntonJansen Jul 7, 2024
d5fbcab
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Jul 7, 2024
4588499
Fixed missing method implementation of abstract discovery service.
AntonJansen Jul 7, 2024
5301297
Replaced complex stringtype arrays with enums.
AntonJansen Jul 8, 2024
2361adb
Merge branch 'openhab:main' into broadlink-binding-4.2.x
AntonJansen Jul 8, 2024
364533a
Updated binding to 4.3.0 version
AntonJansen Jul 8, 2024
ba33d63
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 9, 2024
dcd55fc
Added a check to ensure a hostname or static mac address is defined f…
AntonJansen Jul 9, 2024
64f2dca
Fixed communication error messaging.
AntonJansen Jul 9, 2024
1a39880
Added javadoc to public methods.
AntonJansen Jul 15, 2024
283e077
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 15, 2024
7c1a66e
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 15, 2024
fdbf404
Added javadoc to the public methods being provided in the Utils class.
AntonJansen Jul 16, 2024
b590641
Removed the binding.xml, which is no longer required.
AntonJansen Jul 16, 2024
f5c49b0
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 17, 2024
73f55a2
Adding constants and missing javadoc.
AntonJansen Jul 17, 2024
667e2cf
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Jul 17, 2024
3622b48
Reverted improvement, as it did not work.
AntonJansen Jul 17, 2024
db24029
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Jul 17, 2024
dd60942
Removed null supressions using local variables and added configuratio…
AntonJansen Jul 28, 2024
ffcea49
Cleaned up some more null supressions.
AntonJansen Jul 28, 2024
61e0ed1
Replaced the power-on type with the default openHAB system.power chan…
AntonJansen Jul 28, 2024
d85d0ca
Added some more standard types.
AntonJansen Jul 28, 2024
9ff07a8
Removed the custom energy type, as we now can leverage
AntonJansen Sep 9, 2024
c4ca584
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 10, 2024
5bb2b96
Added an exception to handle authentication issues.
AntonJansen Sep 10, 2024
21f893a
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 10, 2024
f0a0bd8
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Sep 10, 2024
760e2d5
Fixed the following small elements:
AntonJansen Sep 10, 2024
f2938b5
Removed unused device type.
AntonJansen Sep 11, 2024
063b218
Cleaned up device documentation and removed unsupported devices from …
AntonJansen Sep 11, 2024
ba43b80
Refactored the way the item status is being set. The design is now mo…
AntonJansen Sep 17, 2024
c899bde
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
0aba5f9
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
7ee1ee0
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
07cdcf1
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
55800ec
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
180a6e6
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
c496a77
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
29cf844
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
cf182bb
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
ac7d85d
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
119edaf
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
0cccf2c
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
4efd6c1
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
c4694ee
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
a9ad1b7
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
3953d27
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
48a9b35
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
3a16699
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
93962cb
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
20d799f
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Sep 19, 2024
f4547a6
Fixed some typo's that caused compilation issues.
AntonJansen Sep 19, 2024
3e95c48
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Sep 19, 2024
f569f69
Fixed some more compilation issues.
AntonJansen Sep 19, 2024
c44cc22
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Sep 19, 2024
66bc175
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Sep 19, 2024
5550fc0
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Sep 19, 2024
026bade
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Sep 19, 2024
03e6e27
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Sep 19, 2024
be928a8
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Sep 19, 2024
da01a8c
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Sep 19, 2024
03e520c
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
080f5b2
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Sep 19, 2024
682ea5a
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
c34afb1
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Sep 19, 2024
2d70dbb
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Sep 19, 2024
27eabd4
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Sep 19, 2024
2656a86
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Sep 19, 2024
9aae95b
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
cf44d29
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Sep 19, 2024
ff929b5
Apply suggestions from code review
AntonJansen Sep 19, 2024
de74127
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Sep 19, 2024
894fa1c
Update bundles/org.openhab.binding.broadlink/src/main/java/org/openha…
AntonJansen Sep 19, 2024
d94a4d4
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Sep 19, 2024
82f1dba
Update bundles/org.openhab.binding.broadlink/README.md
AntonJansen Sep 29, 2024
d41899a
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Sep 29, 2024
4eefd5f
Update bundles/org.openhab.binding.broadlink/src/main/resources/OH-IN…
AntonJansen Sep 29, 2024
664b6a3
Merge branch 'broadlink-binding-4.2.x' of github.com:AntonJansen/open…
AntonJansen Sep 29, 2024
2d4bbf9
Resolved all the comments received thus far and resolved all the merg…
AntonJansen Sep 29, 2024
0ebe83b
Updated the reference to Ricardo Larranaga.
AntonJansen Sep 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@
<artifactId>org.openhab.binding.bosesoundtouch</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.broadlink</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.broadlinkthermostat</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.broadlink/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This content is produced and maintained by the openHAB project.

* Project home: https://www.openhab.org

== Declared Project Licenses

This program and the accompanying materials are made available under the terms
of the Eclipse Public License 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0/.

== Source Code

https://github.com/openhab/openhab-addons
189 changes: 189 additions & 0 deletions bundles/org.openhab.binding.broadlink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# Broadlink Binding

This binding supports a range of home networking devices made by (and occasionally OEM licensed from) [Broadlink](https://www.ibroadlink.com/).

## Supported Things

| Thing ID | Description |
|------------|-------------------------------------------------------------------------------|
| a1 | Broadlink A1 multi sensor |
| mp1 | Broadlink MP1 WiFi Smart Power Strip (4 sockets) |
| mp1-1k3s2u | Broadlink MP1 1K3S2U WiFi Smart Power Strip (3 sockets, 2 USB) |
| mp2 | Broadlink MP2 WiFi Smart Power Strip (3 sockets, 3 USB) |
| sp1 | Broadlink SP1 WiFi Smart Socket |
| sp2 | Broadlink SP2 WiFi Smart Socket with night light |
| sp2s | OEM SP2 Mini WiFi Smart Socket with night light |
| sp3 | Broadlink SP3/Mini WiFi Smart Socket with night light |
| sp3s | Broadlink SP3s WiFi Smart Socket with Power Meter |
| rm-pro | Broadline RM Pro WiFi IR/RF Transmitter with temperature sensor |
| rm3 | Broadlink RM3/Mini WiFi IR Transmitter |
| rm3q | Broadlink RM3 WiFi IR Transmitter with Firmware v44057 |
| rm4pro | Broadlink RM4 Pro WiFi RF/IR Transmitter with temperature and humidity sensors|
| rm4mini | Broadlink RM4 mini WiFi IR Transmitter |

## Discovery

Devices in the above list that are set up and working in the Broadlink mobile app should be discoverable by initiating a discovery from the openHAB UI.

> The `Lock Device` setting must be switched off for your device via the Broadlink app to be discoverable in openHAB.

## Thing Configuration

| Name | Type | Default | description |
|---------------------|---------|---------------|-----------------------------------------------------------------------------------|
| ipAddress | String | | Sets the IP address of the Broadlink device |
| staticIp | Boolean | true | Enabled if your broadlink device has a Static IP set |
| port | Integer | 80 | The network port for the device |
| macAddress | String | | The device's MAC Address |
| pollingInterval | Integer | 30 | The interval in seconds for polling the status of the device |
| nameOfCommandToLearn| String | DEVICE_ON | The name of the IR or RF command to learn when using the learn command channel |
| ignoreFailedUpdates | Boolean | false | If enabled, failed status requests won't put the device `OFFLINE` |
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved

## Channels

| Channel | Supported Devices | Type | Description |
|-------------------|--------------------------|----------------------|-------------------------------------------------|
| power-on | MP2, all SPx | Switch | Power on/off for switches/strips |
| night-light | SP3 | Switch | Night light on/off |
| temperature | A1, RM Pro, RM4 | Number:Temperature | Temperature |
| humidity | A1, RM4 | Number:Dimensionless | Air humidity percentage |
| noise | A1 | String | Noise level: `QUIET`/`NORMAL`/`NOISY`/`EXTREME` |
| light | A1 | String | Light level: `DARK`/`DIM`/`NORMAL`/`BRIGHT` |
| air | A1 | String | Air quality: `PERFECT`/`GOOD`/`NORMAL`/`BAD` |
| power-on-s1 | MP1, MP1_1k3s2u | Switch | Socket 1 power |
| power-on-s2 | MP1, MP1_1k3s2u | Switch | Socket 2 power |
| power-on-s3 | MP1, v_1k3s2u | Switch | Socket 3 power |
| power-on-s4 | MP1 | Switch | Socket 4 power |
| power-on-usb | MP1_1k3s2u | Switch | USB power |
| power-consumption | MP2, SP2s,SP3s | Number:Power | Power consumption |
| command | all RMx | String | IR Command code to transmit |
| learning-control | all RMx | String | Learn mode command channel (see below) |


AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
## Learning Remote Codes

To obtain the command codes, you can get this binding to put your Broadlink RMx device into "learn mode" and then ask it for the code it learnt.
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
Here are the steps:

0. In the openHAB web UI, navigate to your RMx Thing
1. Set the *Name of IR/RF command to learn* property to the name of the command you want the device to learn
2. Click on its *Channels* tab
3. For IR find the *Remote Learning Control* channel and create an Item for it, for RF use the *Remote RF Learning Control* channel instead.(Only needed the first time)
4. Click the item, and click the rectangular area that is marked NULL
5. In the pop-up menu that appears, select *Learn IR command* for IR or *Learn RF command* for RF
6. *The LED on your RM device will illuminate solidly*
7. Point your IR/RF remote control at your RM device and keep pressing the button you'd like to learn. For RF, this can take 10-30 seconds
8. *The LED on your RM device will extinguish once it has identified the command*
9. If the command has been identified succesfully, the channel will have changed it name to "Learn command" or *RF command learnt*
10. If no succes, the channel will be named "NULL". Inspect the `openhab.log` file on your openHAB server for any issues
11. Check and save the IR/RF command by clicking the item once more and select "Check and save command".
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
12. Keep pressing the remote control with the command to check and save
12. If succesfull, the channel will change name to the command saved
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
13. If no succes, the channel be named "NULL", restart from step 3.
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved

### Modify or Delete Remote Codes

The binding is also capable of modifying a previously stored code, and to delete a previously stored code.

To modify a previously stored code, the procedure is the same as the one shown above, except that in step 4, the option to choose is *Modify IR command* or *Modify RF Command*

*Please note that the "Learn command" will not modify a previously existent code, and the "Modify" command will not create a new command.
This is done to avoid accidentally overwriting commands*

In order to delete a previously stored code, the procedure is as follows:

0. In the openHAB web UI, navigate to your RMx Thing
1. Set the *Name of IR/RF command to learn* property to the name of the command you want the device to learn
2. Click on its *Channels* tab
3. For IR find the *Remote Learning Control* channel and create an Item for it, for RF use the *Remote RF Learning Control* channel instead (Only needed the first time).
4. Click the item, and click the rectangular area that is marked NULL
5. In the pop-up menu that appears, select *Delete IR command* for IR or *Delete RF command* for RF

*VERY IMPORTANT NOTE: Unlike the previous binding, writing the codes into the files is handled by openHAB. While it is possible to create a file externally, copy it in the proper location and use it as a remote codes database (As it is done in the case of Remote codes file migration) IT IS STRONGLY DISCOURAGED to modify the file while the binding is acive. Please make sure the binding is stopped before you modify a remote codes file manually. Also, have the following things in mind:*
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved

*-openHAB does not interpret a missing code file as empty. It will assume the file is corrupt and try to read from one of the backups, which can lead to confusion. if you want to empty your code file, create an empty file with a set of culry brackets, one per line*

*-Remember if you manipulate the code file manually, remember to provide the proper location, and the proper ownership and permissions (Location is `$OPENHAB_USERDATA`, and permissions are `-rw-r--r-- 1 openhab openhab*

## Full Example

Items file example; `sockets.items`:

```
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
Switch BroadlinkSP3 "Christmas Lights" [ "Lighting" ] { channel="broadlink:sp3:34-ea-34-22-44-66:power-on" }
```

## Migrating legacy map file

Up to openHAB version 3.3, there was a previous version of this binding that was not part of the openHAB distribution.
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
It stored the IR/RF commands in a different place and a different format.
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
If you want to mirgrate from those versions to this version of the binding, please read this section.

The Broadlink RM family of devices can transmit IR codes. The pro models add RF codes.
The map file contains a list of IR/RF command codes to send via the device.

IR codes are store in `$OPENHAB_USERDATA/jsondb/broadlink_ir.json` and for the RM Pro series of devices the RF codes are store in `$OPENHAB_USERDATA/jsondb/broadlink_rf.json`

In previous versions of this binding, the file used the [Java Properties File format](https://en.wikipedia.org/wiki/.properties) and was stored in the `<OPENHAB_CONF>/transform` folder.
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
By default, the file name was `broadlink.map` for the IR codes, but could be changed using the `mapFile` setting.
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
In similar fashion, the RM pro models stored the RF codes in the `broadlinkrf.map` file.
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved

Here is a map file example of the previous file format:

```
TV_POWER=26008c0092961039103a1039101510151014101510151039103a10391015101411141015101510141139101510141114101510151014103a10141139103911391037123a10391000060092961039103911391014111410151015101411391039103a101411141015101510141015103911141015101510141015101510391015103911391039103a1039103911000d05000000000000000000000000
heatpump_off=2600760069380D0C0D0C0D290D0C0D290D0C0D0C0D0C0D290D290D0C0D0C0D0C0D290D290D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D290D0C0D0C0D0C0D0C0D0C0D0C0D0C0D290D0C0D0C0D0C0D0C0D290D0C0D0C0D0C0D0C0D0C0D0C0D290D0C0D290D290D290D290D290D290E0002900000
```
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved

The above codes are power on/off for Samsung TVs and Power Off for a Fujitsu heat pump.
To send either code, the string `TV_POWER` or `heatpump_off` must be sent to the `command` channel for the device.
For RF, the `rfcommand` channel is used.
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved

Storage of codes is handled by openHAB. The map files are stored in the $OPENHAB_USERDATA/jsondb directory.
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
As an advantage, the files are now backed up by openHAB, which is more practical for migrations, data robustness, etc. having the storage of the codes handled by openHAB also provides uniformity in where the files are stored.

With the change of the storage mechanism, the files are also changing format, and codes are now stored in json.
As an example, a file with the commands shown in the previous example would look like this:
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved

```
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
{
"TV_POWER": {
"value": "26008c0092961039103a1039101510151014101510151039103a10391015101411141015101510141139101510141114101510151014103a10141139103911391037123a10391000060092961039103911391014111410151015101411391039103a101411141015101510141015103911141015101510141015101510391015103911391039103a1039103911000d05000000000000000000000000"
},
"heatpump_off": {
"value": "2600760069380D0C0D0C0D290D0C0D290D0C0D0C0D0C0D290D290D0C0D0C0D0C0D290D290D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D0C0D290D0C0D0C0D0C0D0C0D0C0D0C0D0C0D290D0C0D0C0D0C0D0C0D290D0C0D0C0D0C0D0C0D0C0D0C0D290D0C0D290D290D290D290D290D290E0002900000"
}
}
```

The code shown below is a Python script that can be used to convert from the old format to the new one:

```
AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
import csv
import json
import sys
import argparse

parser=argparse.ArgumentParser(description= "Broadlink converter argument parser")
parser.add_argument('-i','--input_filename', help='Input File Name', required=True)
parser.add_argument('-o','--output_filename', help='Output File Name')
args=parser.parse_args()

result={}
with open(args.input_filename,'r') as f:
red=csv.reader(f, delimiter='=')
for d in red:
result[d[0]] = { "class": "java.lang.String" , "value":d[1]}
if args.output_filename:
with open(args.output_filename, 'w', encoding='utf-8') as f:
json.dump(result, f, ensure_ascii=False, indent=2)
else:
print(json.dumps(result,indent=2))
```


AntonJansen marked this conversation as resolved.
Show resolved Hide resolved
## Credits

- [Cato Sognen](https://community.openhab.org/u/cato_sognen)
- [JAD](http://www.javadecompilers.com/jad) (Java Decompiler)
- [Ricardo] (ricardol)
25 changes: 25 additions & 0 deletions bundles/org.openhab.binding.broadlink/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.broadlink</artifactId>

<name>openHAB Add-ons :: Bundles :: Broadlink Binding</name>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.broadlink-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-broadlink" description="Broadlink Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.broadlink/${project.version}</bundle>
</feature>
</features>
Loading