mduran80 / daikin_madoka Goto Github PK
View Code? Open in Web Editor NEWHome Assistant custom component integration for the BRC1H thermostat (madoka)
License: MIT License
Home Assistant custom component integration for the BRC1H thermostat (madoka)
License: MIT License
Does not work on 2021.6 due to the new requirement to have a valid version key.
Hi!
I'm running Home Assistant OS in an ESXi virtual machine and I have a bluetooth USB dongle attached to it. I followed the instructions and managed to pair the thermostat successfully.
However, when trying to add the integration with the MAC address and the default parameters, it always fails saying that the device cannot be found. I tried unchecking the option to try and discover the device when adding, which makes it so that the integration is added, but then it never connects to the device.
The HA logs show this error:
Could not connect to device 94:0D:2D:47:4D:60: Could not find bluetooth device for the address 94:0D:2D:47:4D:60. Please follow the instructions on device pairing.
The thermostat card just says "unavailable".
When running bluetoothctl
in the terminal, I can see that the device is paired. I can even manually connect to it via the terminal.
Am I doing something wrong? For the integration, I git cloned the repo in the custom_components folder.
Since I upgraded to HassOS 9, connectivity to my Daikin devices is rock steady - entities used to become unavailable but now always stay connected. I thought it was a problem with my Bluetooth range (as it improved with an external Bluetooth device but not perfect).
What I notice though is that the status of the entities does not seem to update, unless I issue a command via HA, like turning the aircon on, or changing the temperature. If, for example, I turn the device on by hand, it doesn't show up in HA.
I'm on HA 2023.01.02, HassOS 9.5. What logs should I include to help diagnose the issue please?
Hi, thanks a lot for this great integration. Although it works, I face the following problem after some time:
homeassistant | 2023-03-17 15:39:52.067 ERROR (MainThread) [pymadoka.connection] [org.bluez.Error.Failed] br-connection-canceled
homeassistant | 2023-03-17 15:39:54.074 ERROR (MainThread) [pymadoka.connection] [org.bluez.Error.Failed] Operation already in progress
homeassistant | 2023-03-17 15:39:54.076 ERROR (MainThread) [pymadoka.connection] [org.bluez.Error.Failed] br-connection-canceled
homeassistant | 2023-03-17 15:39:56.084 ERROR (MainThread) [pymadoka.connection] [org.bluez.Error.Failed] Operation already in progress
my logs are flooded with these messages. If I restart home-assistant, then they go away and integration works again. Till the next time it starts doing the same.
Is this a bug or some other issue?
Hello :)
First thanks for your job, it's amazing.
I just change my hardware which runs home assistant (migration from raspberry pi3 to odroid N2+). I'm running the latest release of HA.
Since I migrated on this hardware, the daikin_madoka integration is not able to maintain connection during long time. Sometimes the module become unavailable and the only thing I have in the log is :
Source: loader.py:855
First occurred: 17:33:07 (2 occurrences)
Last logged: 17:39:21
Unexpected error importing daikin_madoka/cast.py
Unexpected error importing daikin_madoka/hardware.py
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 50, in _async_process_single_integration_platform_component
platform = integration.get_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 838, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 855, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.daikin_madoka-main.cast'
When I try to reboot, the home assistant can't boot properly because it's waiting for daikin_madoka integration. I have to disable-it, then hard reboot, enable-it again and soft reboot to retrieve all functionality.
Today it appeared twice. I'm not really understand what is happening.
If you need more information please ask.
Best regards,
Dorian
Hola, antes de nada darte la enhorabuena por el gran trabajo realizado.Lo tengo implementado en Raspberry Pi 3+ en la versión 2021.1.3. Tienes pensado añadirlo en HACS? Así resultaria más fácil realizar el seguimiento de las actualizaciones que realices.
Un saludo.
Would be great to have this one in the HACS shop
keep up the good word.
Hi,
Does the integration into the core integration is effective?
Great work :!!!
Im not able to pair nothing..... suddnley the thermostat disconnect me without pair
[bluetooth]# pair 50:61:F6:6E:BF:DB
Attempting to pair with 50:61:F6:6E:BF:DB
[CHG] Device 50:61:F6:6E:BF:DB Connected: yes
Request confirmation
[agent] Confirm passkey 894700 (yes/no): yes
[CHG] Device 50:61:F6:6E:BF:DB Connected: no
What to do ?
Thanks
Just testing the integration with my new Madoka thermostats. I managed to get it integrated. Great work!
Is there a way to read the temperature & humidity sensor data from the thermostat?
Hi, I'm Italian, and I'm using google translate. I hope I can make myself understood.
I have done all the steps. I have one thermostat for each floor, and I have them both paired with raspberry bluetooth.
When I insert both thermostats, they are both added as entities, but one of them is immediately unavailable. also, if I leave both, the other becomes unavailable after a few hours as well.
If, on the other hand, I only insert the one on the ground floor, everything works very well. Is there anything I can do to make both of them work??
it is possible to retrieve energy consumption information already present on the Daikin application ?
First, I want to thank you the amazing work: muchas gracias!
I have 1 Madoka unit working and running, but I need to integrate a couple of them. I know it will be really easy to do, and I guess I only have to insert both mac addresses in the first blank space. But I do not know how to separate both macs. I tried with "," ";" "-" and many more, with no success.
Can anybody help me?
Thanks!
Hi!
Thank you for the integration!
I can't connect from my Pi 4 (HassOS):
pair
looks okbluetoothctl
switches to BRC1H: from [bluetooth]
to BRC1H xx:yy:zz
Failed to pair: org.bluez.Error.AuthenticationCanceled
appearedCould you help please?
Logger: homeassistant.config_entries
Source: custom_components/daikin_madoka/init.py:66
Integration: Daikin Madoka
First occurred: 13:09:13 (1 occurrences)
Last logged: 13:09:13
Error setting up entry BRC1H for daikin_madoka
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/daikin_madoka/init.py", line 66, in async_setup_entry
await discover_devices(
File "/usr/local/lib/python3.10/site-packages/pymadoka/connection.py", line 56, in discover_devices
DISCOVERED_DEVICES_CACHE = await scanner.get_discovered_devices()
AttributeError: 'HaBleakScannerWrapper' object has no attribute 'get_discovered_devices'
Hi, since HaOS v7, if you restart the core, the madoka is not available, you must restart the host to recover
Hi, first of all I want to thank you!
I would like to mention that the madoka integration with docker image Home Assistant 2022.8 doesn't work.
At first sight running the "pip install pymadoka" command in the image fixes this.
I guess it has something to do with the new bluetooth integration from HA.
I downgraded back to HA 2022.7 and am looking into running this fine integration indepentent (docker) and linking it with HA by MQTT, but have yet to find the right information to do so.
Hi
Thanks for this integration.
I copied the folder to my custom_integrations folder. I paired the bluetooth device.
When I install the integration, the text was not showing well. Sometimes nothing was shown during the setup of the integration.
I filled in de the mac-address in a failed where I thought it should be. There was no label... Weird.
Now the integration is in my HA, but I don't have the entities and other stuff.
Do you know about this kind of problem?
Home Assistant 2023.3.1
Supervisor 2023.03.1
Operating System 9.5
Kind regards
Maarten.
Hi!
I'm trying to set up this component with Home Assistant. When I click on the integration to add it, I see a spinner that eventually fails with this message:
error: Config flow could not be loaded: Unknown error
Any tips on how to move forward? Is there a way I can bypass the config flow and write the configuration manually? If so, are there any docs I could look at?
These are the versions I'm running:
Core: 2024.1.5
Supervisor: 2023.12.1
Operating System: 11.4
Frontend: 20240104.0
Many thanks in advance!
Hello,
Thanks for your hard work ! Very very good!
My house got 3 floors, and i've got controllers on the three floors.
Because my NUC is far away from the other two, how is the best way to pair the devices and after pairing they continue working ?
Should i use a bluetooth HW control for each floor ? Or once they are paired the communication is not done via bluetooth ?
Best Regards and thanks in advanced
The latest Madoka App (Android) requires the controller firmware to be updated for full functionality.
Will the firmware update [1.11.0] break this integration?
Hello, I really appreciate your work, but I have a question. According to documentation I need to disconnect controller from Daikin app in order to connect it to HomeAssistant. When I connect it with HA would I still be able to connect to it from Daikin app? I need to have it integrated with Daikin app and I want to use HA integration as an add-on
Thank you very much!
Hi,
just downloaded and copied the folder under custom_components but I can't reach it under Integrations.
The bluetooth pairing procedure goes well (device successfully paired).
Can you help me in activating it?
Thanks
I've tried to connect to some devices using Shelly gen 2's Bluetooth Proxy feature, both in active and passive mode, but only local bluetooth devices can be scanned. Is this the case?
https://www.home-assistant.io/integrations/shelly/#bluetooth-support
Bluetooth Support
Shelly generation 2 devices running firmware 0.12 or later can act as a Bluetooth proxy for advertisements. Active or passive listening can be enabled in the options flow.
When installing the integration, and trying to connect to the bluetooth address it only worked by using caps
30:F9:4B:4C:18:6F
instead of 30:f9:4b:4c:18:6f
this should be indicated on the integration page or converted before using the string
Hi @mduran80 ,
What do you think about the possibility of using ESPHome bluetooth_proxy for communicating instead of a usb dongle?
I have 4 Daikin devices, but I can only integrate one. How do I integrate the others? In the terminal they are successfully paired with “pair ”. But not visible in the Daikin integration
HI, first of all thank you so much for this. Also related to this: mduran80/pymadoka#2
Since yesterday I have this madoka and like all of you immediately tried to hook it up to homeassistant. Actually it was smooth sailing, it worked at my first try with the latest home assistant on docker and built-in bluetooth of my server just by following the steps and ofcourse not to forget the addition dbus in docker-compose.
Now I have a couple of findings in which I hope someone can help me.
When I increase the temperature in homeassistant of the cooling by 1, the madoka shows the increase and it works. However when I decrease the temperature in homeassistant of the cooling by 1, the madoka INcreases instead of DEcreases. This means I can never lower the temperature.
I don’t have a separate temperature sensor, I just have 1 “climate.airconditioning_mac”. Is that correct?
Hopefully someone can help with the temperature set, because than it will be very useful to me.
Thank you in advance.
EDIT:
Hi,
Rather than a BT stick attached to the HA machine I use the ESPHome BT proxy.
Anyone know how to do the pairing in this situation?
If I use the terminal and the bluetoothctl there is no local controller, so 'list' does not show a controller.
scan on/off always show no default controller available.
How to do the pairing in the case of using a ESPHome proxy?
Thanks, Trant
Thanks @mduran80 for this custom integration. You have simplified my life. A port on ESPhome would be great, but is to much for my programming knowledge. The Advantage is that you can place a cheap ESP32 to reach the Madoka device.
The real issue is: adding a polling of the status of the devices. Why? You can change the status in Home Assistant and someone operate a change locally on the Madoka. Home Assistant see the change only on reboot.
It would be nice to have the ability to configure a polling interval in the integration, for example 5 minutes to update the status of the Madoka in HA.
There is a workaround with a service?
Home Assistant 2022.10.1
Supervisor 2022.09.1
Operating System 9.0
Frontend 20221006.0 - latest
What are the ticks are for?
What is the number 5 at the bottom for?
Tried turning ticks on and off and entering only one mac address in lower case, upper case, and in quotes ('') but nothing works.
Tried disabling HA bluetooth integration also.
Hello, i need to pair 15 devices but its a very hard and complex to do..... i tried to add with comma all the mac address but do not working..... i can pair manually via shell command trough bluetoothctl...... but not via integration UI.
If i pair via shell there's a way to add the mac address manually somewhere into the HA db or via a simplest way and reload the inegration?
Thanks
I've done the pairing several times before but it seems that now I'm unable to pair after upgrading the latest HAS Operating System.
The error I keep getting when doing a pair on pi3 = Failed to pair: org.bluez.Error.AuthenticationFailed
It worked like a charm before on other pi3's.
Hi,
Using the latest version of the integration, with a device successfully paired, I get this error in HA logs:
No backend with an available connection slot that can reach address xxx was found
The thermostat shows as "unavailable" in HA. The message appears a lot in the logs. I tried removing the integration and the devices, re-pairing it, re-installing the extension, but the outcome is the same.
HA version: 2022.12.5
Hi,
The daikin_madoka integration work fine with HA 2022.8.2 but trows the error noted below:
connected = await self.client.is_connected()
/usr/local/lib/python3.10/site-packages/pymadoka/connection.py:163: FutureWarning: is_connected has been changed to a property. Calling it as an async method will be removed in a future version
DISCOVERED_DEVICES_CACHE = await scanner.get_discovered_devices()
/usr/local/lib/python3.10/site-packages/pymadoka/connection.py:56: FutureWarning: This method will be removed in a future version of Bleak. Use the discovered_devices
property instead.
Upgrading to HA 2022.9.4 the integration doesn't connect to the device anymore.
Maybe repairing fixes this, but I did not have the time yet to try.
Update: Even repairing the device doesn't work
Since the last version of home assistant, the following error appears periodically:
Logger: pymadoka.connection
Source: /usr/local/lib/python3.8/site-packages/pymadoka/connection.py:176
First occurred: 14:49:36 (5984 occurrences)
Last logged: 18:17:59This service is already present in this BleakGATTServiceCollection!
Log:
...
2021-04-20 18:26:15 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:17 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:19 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:22 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:24 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:26 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:28 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:30 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:32 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:34 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:36 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:38 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:40 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:42 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:44 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:47 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:49 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:51 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:53 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:55 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:57 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:26:59 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
2021-04-20 18:27:01 ERROR (MainThread) [pymadoka.connection] This service is already present in this BleakGATTServiceCollection!
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.