New binding for DAIKIN Madoka Controller (BLE)

I must admin I’m pretty out of ideas… Besides of hardware problem or software install failure (kernel)…
Do you have a simple CSR bluetooth dongle ? Something like 4 bucks on Aliexpress !

Yeah, I think I’ll need to check something like that. I’ll probably buy if I can’t find an old one.

WOW it looks amazing.
Which binding do I need to install in order to control my Daikin Madoka controllers?
Thank you

Hi Yaron,

Happy to assist a new Madoka user! :slight_smile:

So, I use a custom BlueZ bridge that I coded as well, as the one shipping with OH does not really work. Here is the JAR attached, you can just put it in your “addons”: Unique Download Link | WeTransfer

I am in the process of PR to merge this binding and replace the existing one, but its not effective yet.

Don’t hesitate should you need any help!

Ben

Thanks, what exactly should I put? The downloaded file is KAR and not JAR.

KAR is the JAR packaging for Apache Karaf, the OSGI server powering OpenHAB. Just copy this file in the {OH}/addons folder.

Then, proceed with the configuration like in the doc: DaikinMadoka - Bindings | openHAB

Thanks, I managed to install the jar, but didn’t manage to pair the devices (when I tried to pair, I never got the confirm pairing request)

So this part is the most tricky one. This is actually not due to the binding nor openhab, but just to the Linux Bluetooth Stack and the Madoka.

What is your platform ? Raspberry or a standard Linux PC ?

What I suggest:

  1. Turn OH off
  2. Do a full Madoka power recycle: you need to physically power off your AC system (not turn off the AC, but remove the power from switchboard
  3. Once the Madoka has boot, do not try to interact with your phone (Madoka does only support 1 communication simultaneously)
  4. Go in the Madoka menu, remove existing pairing (cross symbol), and put it in pairing mode
  5. At this stage, the Madoka is ready, and I suggest you use this tutorial:

Also keep in mind: the timing is important, to click simultaneously the “YES” button, and type yes in the terminal when the exchange key is proposed on each side.
The distance is important as well: dont be too far of the device (although after pairing it allows a better operating range).

Keep me posted.

As I said, it is working perfectly since May at home with 3 Madoka units !

I am using this Bluetooth adapter: https://fr.farnell.com/lm-technologies/lm1010-0971/adaptateur-bluetooth-antenne-v4/dp/2946818?CMP=i-bf9f-00001000

Thanks again.
I followed your instructions (on Raspberry), managed to pair my first device, but didn’t manage to control it from OH. Any idea what I did wrong?

More info:

[agent] Confirm passkey 000000 (yes/no): yes
[CHG] Device 00:00:00:00:00:02 Paired: yes
Pairing successful

Info (Trusted value is no):

[UE878 RF MODULE]# info 00:00:00:00:00:02
Device 00:00:00:00:00:02
Name: UE878 RF MODULE
Alias: UE878 RF MODULE
Paired: yes
Trusted: no
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb)
UUID: Vendor specific (2141e100-213a-11e6-b67b-9e71128cae77)
UUID: Vendor specific (2141e110-213a-11e6-b67b-9e71128cae77)
Modalias: usb:v06E7p7031d0110
ManufacturerData Key: 0x0093
ManufacturerData Value: 0xe0
ManufacturerData Value: 0x00

Things:
Bridge bluetooth:dbusbluez:hci0 [ address=“00:00:00:00:00:15” ]
Thing bluetooth:brc1h:hci0:salon (bluetooth:dbusbluez:hci0) [ address=“00:00:00:00:00:02” ]

Items:
Group g_climSalon “Salon” [ “Thermostat” ]
Switch climSalon_onOff “Climatisation Salon” (g_climSalon) { channel=“bluetooth:brc1h:hci0:salon:onOffStatus” }

Sitemap:
Switch item=climSalon_onOff

Binding version:

openhab> bundle:list | grep lue
335 x Active x 80 x 2.5.7.SNAPSHOT x org.openhab.binding.bluetooth.bluez

Logs:

2020-09-16 10:01:40.544 [ome.event.ItemCommandEvent] - Item ‘climSalon_onOff’ received command ON
2020-09-16 10:01:40.553 [nt.ItemStatePredictedEvent] - climSalon_onOff predicted to become NULL

Thats a good start :slight_smile:

Need more log, can you modify ${OH}/userdata/etc/org.ops4j.pax.logging.cfg and add those lines:

# Madoka file appender
log4j2.appender.madoka.type = RollingRandomAccessFile
log4j2.appender.madoka.name = MADOKA
log4j2.appender.madoka.fileName = ${openhab.logdir}/madoka.log
log4j2.appender.madoka.filePattern = ${openhab.logdir}/madoka.log.%i
log4j2.appender.madoka.immediateFlush = true
log4j2.appender.madoka.append = true
log4j2.appender.madoka.layout.type = PatternLayout
log4j2.appender.madoka.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.madoka.policies.type = Policies
log4j2.appender.madoka.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.madoka.policies.size.size = 16MB

log4j2.appender.bluetooth.type = RollingRandomAccessFile
log4j2.appender.bluetooth.name = BLUETOOTH
log4j2.appender.bluetooth.fileName = ${openhab.logdir}/bluetooth.log
log4j2.appender.bluetooth.filePattern = ${openhab.logdir}/bluetooth.log.%i
log4j2.appender.bluetooth.immediateFlush = true
log4j2.appender.bluetooth.append = true
log4j2.appender.bluetooth.layout.type = PatternLayout
log4j2.appender.bluetooth.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.bluetooth.policies.type = Policies
log4j2.appender.bluetooth.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.bluetooth.policies.size.size = 16MB

log4j2.logger.madoka.name = org.openhab.binding.bluetooth.daikinmadoka
log4j2.logger.madoka.level = DEBUG
log4j2.logger.madoka.additivity = false
log4j2.logger.madoka.appenderRefs = madoka
log4j2.logger.madoka.appenderRef.madoka.ref = MADOKA

log4j2.logger.bluetooth.name = org.openhab.binding.bluetooth
log4j2.logger.bluetooth.level = DEBUG
log4j2.logger.bluetooth.additivity = false
log4j2.logger.bluetooth.appenderRefs = bluetooth
log4j2.logger.bluetooth.appenderRef.bluetooth.ref = BLUETOOTH

After that, you will have 2 new files in ${OH}/userdata/logs, madoka.log and bluetooth.log. With some details logged from those file we might find what’s wrong!

Thanks,

I modified the files, but both log files are empty.

I think it is related to the binding file. When I put it as is (with the kar extension) in the {OH}/addons folder, nothing happens (with and without restart) - I don’t see it when I run bundle:list | grep lue.

I see the binding just when I change the extension to jar.

What exactly I should see when I run bundle:list | grep lue ?

I assume you have updated your addons.cfg ?

image

image

No, I didn’t update this file.
Do I need to install also the Bluetooth Binding from the paper UI (or any other binding)? How do I get the diakinmadoka binding?

Thanks

I personnaly don’t use the UI at all.

Daikin Madoka is now part of the official build. Depending on which OH version you use, it is part of the distrib and automatically gets installed once you declare it in addons.cfg.

I suggest you update your addons.cfg to add the 2 bindings you want to load. The MADOKA one will get downloaded, the bluetooth one will be loaded locally as you provided it in the addons folder.

Hi,

I think the problem is because I don’t have the diakinmadoka binding. When I added it to the addons.cfg file I got below error:
Failed installing ‘openhab-binding-bluetooth-daikinmadoka’

Capture1
Any ideas?
Thanks

Ah ! I see ! Your OpenHAB version is too old. The Madoka binding was included with 2.5.7 release.

image

You can do an upgrade, ${OH}/runtime/bin/upgrade 2.5.7

Edit: well you can actually upgrade to 2.5.8 instead of 2.5.7 !

Thanks again and sorry for being such a nudge…

I upgraded the OM to 2.5.8 there is a progress, but still it doesn’t work :frowning:

Now I see Madoka in the bundle list, but not in the feature list:
Capture1

When I modified the addons file I got the following error:

[ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing ‘openhab-binding-bluetooth-daikinmadoka’
binding=“zwave,astro,expire1,network,panasonictv1,darksky,sonyaudio,yamahareceiver,http1,weatherunderground,bluetooth,bluetooth-bluez,bluetooth-daikinmadoka”

In the papar-ui, I can see the Thermostat Thing, but not the Bridge. When I edit the Thermostat Thing, I can see that the Bridge is not associated to it:

Bridge bluetooth:dbusbluez:hci0 [ address=“00:00:00:00:00:15” ]
Thing bluetooth:brc1h:hci0:Amit4 (bluetooth:dbusbluez:hci0) [ address=“00:00:00:00:00:02” ]
Capture2

Any ideas (log files are empty)?

Thanks in advanced

That’s wierd. I have installed a 2.5.9-SNAPSHOT, and the Madoka binding is not in the feature list either.

@Kai @cpmeister , any idea why the Binding which was integrated in 2.5.7 release is not anymore avail in 2.5.8/2.5.9-SNAPSHOT ?

Not really sure, I can’t find any reason that it would no longer be available looking at the code…
If you can see the daikinmadoka thingtype then it must have been installed/running in the OH, presence on the feature list is irrelevant if you can see it in the UI already.

I am not sure if it related but when you try to create the Bridge in the paper-ui:
Capture2

some of the fields are missing (hci0 and address) :
Capture3