Can’t get it to work even with the HACS component (I removed the original one beforehand). I do have the entity now, but it’s Unavailable and I’m getting “can’t read the data, is your PIN correct?”
The PIN works with the Europrog iPhone apps just fine. I’ve tried changing it, disabling BT on iPhone, changing it to 6-digit new PIN, removing batteries to reset the pin to 000000, no dice (of course I did change the config yaml and restarted HA each time).
Mac address is correct, the entity wouldn’t work at all with wrong address.
Sorry, it’s probably just not meant to be Maybe hardcoding the PIN could work.
I just pushed a change. Could you try the new version? The new version waits until the pin was successfully written. This was not necessary on my rpi3, but maybe the rpi4 is a little too fast…
I have noticed that when using the original iOS app to control the CB (EUROprog 2), sometimes I have to issue commands twice for them to take. Maybe that’s the culprit?
First of all: @neffs great work with your ha-cometblue integration. I tried to get my comet blues working with my smart home for ages. With your HACS integration, it’s really easy to integrate them into HASS.
@Stooovie maybe I can share a little bit of my experiences during the setup to get yours working. I had the exact same issue with the “can’t read the data, is your PIN correct?” and “Bluetooth command failed (code: 3, error: Attribute can’t be written)”.
I am using the german version of comet blue (THERMy Blue from Aldi) and their GATT characteristics differ. So I had to change the PASSWORD_HANDLE in @neffs integration from 0x47 to 0x48 and the TEMPERATURE_HANDLE from 0x3f to 0x3d. Additionally I had to remove the complete code of the STATES_HANDLE, including all methods and other variables related to states, because I don’t know yet, which handle I should use instead.
And I also tried @neffssuggestion to add a sleep, but this didn’t work for me either. Instead I used the 3rd parameter of the btle.Peripheral().writeCharacteristic method, which is withResponse. The moment I set it to True, everything worked, because it “awaits confirmation that the write was successful from the device”[Documentation].
Florian, that looks great, could you share your cometblue.py? I don’t know where to put the withResponse parameter. My variant is the Silvercrest one sold by Lidl. How did you arrive at those handle numbers? Thanks!
Hi neffs, a) what’s a BLE100?
b) I’m trying to move my hass.io from RaspPi3 to VM in Proxmox. Added a BT dongle to Proxmox PC & passed it through to VM. VM is finding the new BT device when booting hassio but is not showing any ‘Bluetooth Core’ loading later. I’ve seen some comments that it is not possible for hassio to use BT on anything other than on RaspPi. Are you/ others here using this component on Pi or other hardware?
I forked neffs repo so you can find the complete modified integration here:
For the handle numbers I used Torsten Tränkner’s Tutorial and additionally decompiled the EUROtronic’s Europrog 2 Android App to take a look into the GermanyUuids.
During the first day of using the ha-cometblue integration I noticed a really strange behaviour of my THERMy Blues: They reset their pin to 0 from 123456, which I had set in the app
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/cometblue/climate.py", line 185, in update
self._thermostat.update()
File "/config/custom_components/cometblue/cometblue.py", line 115, in update
data = self._conn.readCharacteristic(TEMPERATURE_HANDLE)
File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 530, in readCharacteristic
resp = self._getResp('rd')
File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 407, in _getResp
resp = self._waitResp(wantType + ['ntfy', 'ind'], timeout)
File "/usr/local/lib/python3.7/site-packages/bluepy/btle.py", line 362, in _waitResp
raise BTLEDisconnectError("Device disconnected", resp)
bluepy.btle.BTLEDisconnectError: Device disconnected
I really don’t want to waste any more of you guys’ time though.
How do I use the temperature readout? It is reported correctly in the thermostat widget. From what I found on this forum, HA should automatically create a sensor like this
but that doesn’t parse (Invalid config for [sensor.template]: expected dictionary for dictionary value @ data[‘sensors’]. Got None
extra keys not allowed @ data[‘template_obyvak’]. Got OrderedDict([(‘friendly_name’, ‘Temperature obyvak’), (‘value_template’, “{{ state_attr (‘climate.thermostat1_2’, ‘current_temperature’) }}”)]). (See ?, line ?).)