EUROTronic CometBlue / Xavax Hama / Sygonix

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 :slight_smile: 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…

If this still doesn’t work please try to put:

time.sleep(1)

after

        self.connect()

in line 243.

Tried them both, still doesn’t work. Now I’m getting this more often


bluepy.btle.BTLEGattError: Bluetooth command failed (code: 3, error: Attribute can't be written)

My Cometblue is probably dying, it’s probably not your script that’s the issue. Thanks!

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 @neffs suggestion 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].

1 Like

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!

Hardcoding the handles was probably not the best idea. I just received a BLE100 which has the same issue.
I‘ll release a new version this week.

2 Likes

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?

a) https://eurotronic.org/produkte/bluetooth-heizkoerperthermostate/genius-ble-100/
Unfortunately it doesn’t support the manual mode. You can’t disable the schedule.
b) I use a raspberry pi, but it should work on all linux systems.

There should be a new version in HACS now. This fixes the handle issue.

1 Like

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.

1 Like

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 :unamused:

1 Like

A single zero?

I think it does not matter, if you use a single zero or 000000.

@Stooovie have you tried my adaption of neff’s integration or his new version yet to get your silvercrest comet blue working?

I’m still getting this (floxdeveloper version)

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.

OH! It started to work, Florian! Wow!

@Stooovie that’s great :partying_face:

1 Like

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

sensor.<THERMOSTAT NAME>_thermostat_temperature

But it doesn’t. Any tips? Thanks!

What do you want to use it for? In templates it should be available as state_attr('climate.xxxx', 'current_temperature')

1 Like

Just a badge for now, later for automations. Thanks!

EDIT: I’m such a noob, I can’t get even this to work. I have

  - platform: template
    sensors:
      template_obyvak:
        friendly_name: 'Temperature obyvak'
        value_template: "{{ state_attr ('climate.thermostat1_2', 'current_temperature') }}"

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 ?).)