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

Thank you! #1

Open
danielkucera opened this issue Nov 2, 2019 · 8 comments
Open

Thank you! #1

danielkucera opened this issue Nov 2, 2019 · 8 comments

Comments

@danielkucera
Copy link

Thanks for this library. Are you using it with some automation?
I plan to use it with esphome.

And what do you mean by "changing memory partitioning"? How should be this done?

@MrKrabat
Copy link
Owner

MrKrabat commented Nov 2, 2019

The Arduino IDE has a setting for memory partitioning (depending on if the selected board supports it).
As the esp32 bluetooth library needs a lot of space, I needed to change the memory partition to make my program fit onto the esp32.
For more about this see here: https://robotzero.one/arduino-ide-partitions/

I use this library to integrate my thermostat into Google Home. For this I use gBridge as cloud backend and bridge between my esp32 and Google :)

Thanks for commenting, I hope you won't find too many bugs :)

@danielkucera
Copy link
Author

I have some initial version which compiles and connects: https://github.com/danielkucera/esphome/blob/cometblue/esphome/components/cometblue/cometblue.cpp
But I'm getting following error. Do you think it is related to memory?

[16:57:29][C][cometblue:030]: Setting up CometBlue client for 'B7:1E:5A:99:BF:21'...
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:32][E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[16:57:33][C][cometblue:038]: Connect to 'B7:1E:5A:99:BF:21' SUCCESS!
[16:57:33][D][climate:172]: 'Living Room AC' - Sending state:
[16:57:33][D][climate:175]:   Mode: OFF
[16:57:33][D][climate:186]:   Target Temperature: 0.00°C

@danielkucera
Copy link
Author

Ok, I take it back, problem was elsewhere, it works now :)

@danielkucera
Copy link
Author

Ok, another problem. When I run this code:

      Temperatures temp = dev->getTemperatures();
      temp.manual_temp = *call.get_target_temperature(); // target temperature in degree Celsius
      ESP_LOGCONFIG(TAG, "About to set target temperature for '%s' to %f", this->mac_.c_str(), temp.manual_temp);
      //TODO: fix 64deg currrent temp
      if (!dev->setTemperatures(temp)){
        ESP_LOGCONFIG(TAG, "Seting temperature failed!");
      }

suddenly I'm getting 64deg current temperature:

[23:23:21][D][climate:010]: 'Living Room Radiator' - Setting
[23:23:21][D][climate:017]:   Target Temperature: 23.00
[23:23:22][C][cometblue:035]: Connected to 'B7:1E:5A:99:BF:21' 'Comet Blue'
[23:23:22][C][cometblue:084]: About to set target temperature for 'B7:1E:5A:99:BF:21' to 23.000000
[23:23:22][C][cometblue:059]: Updating state of 'B7:1E:5A:99:BF:21'...
[23:23:23][C][cometblue:035]: Connected to 'B7:1E:5A:99:BF:21' 'Comet Blue'
[23:23:23][D][climate:172]: 'Living Room Radiator' - Sending state:
[23:23:23][D][climate:175]:   Mode: HEAT
[23:23:23][D][climate:177]:   Action: OFF
[23:23:23][D][climate:180]:   Current Temperature: 64.00°C
[23:23:23][D][climate:186]:   Target Temperature: 23.00°C

Does this happen to you too?

@danielkucera
Copy link
Author

Should not here:

uint8_t tempencoded[7] = {128, temp.manual_temp * 2, temp.target_temp_low * 2, temp.target_temp_high * 2, temp.offset_temp * 2, temp.window_open_detect, temp.window_open_minutes};

be -128?

https://github.com/im-0/cometblue/blob/4d9d65c2d53564148cfdc9fcf7409be246b4dad9/cometblue/device.py#L88

@MrKrabat
Copy link
Owner

MrKrabat commented Nov 14, 2019

I'm not sure, I never had this problem or testet for this. The current temperature should be set by the thermostat, regardless what value we set.
This value can only take up a single byte and byte(128) equals int(-128) in two's complement.

@danielkucera
Copy link
Author

Are you disconnecting and reconnecting after each API call?

@MrKrabat
Copy link
Owner

MrKrabat commented Dec 1, 2019

Yes, I disconnect after each call.
Don't want to drain too much battery, so I'm using my own temperature sensor with my esp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants