Closed Chreece closed 1 year ago
How about increase the sleep ms from 500 to 1500? I test the example with esp32s and esp32c3.(2.0.8sdk)
I'm using Firebeetle32 (ESP32-Wroom-32E) The encryption example doesn't work, even for one sensor :(
I'm using Firebeetle32 (ESP32-Wroom-32E) The encryption example doesn't work, even for one sensor :(
Use a shorter device name? ”DIY”
Yes that did it! Even with one sensor though using only 3 letters is kinda a limitation... I will look into it. My thought adding multisensors are that the user should add them all together ( bthome.addMeasurement)) and the .cpp should count the lenght and "chop" the pakets, sending them seperately. The only input from user, should be the name, bind key and the sensors / states. That's my goal... Will work on that when I have some spare time... Thank you a lot for your hard work!!!
With one sensor the example works perfect, adding more than one, even with a bigger delay (3000) doesn't make any change in HA
With one sensor the example works perfect, adding more than one, even with a bigger delay (3000) doesn't make any change in HA
My homeassisant will add more than one sensor, it takes some time.And I just delay 500ms in my demo project. Or you can try this way below:
Sensor1 bthome.resetMeasurement(); bthome.addMeasurement... bthome.buildPaket... bthome.start(); delay... bthome.stop();
Sensor2 bthome.resetMeasurement(); bthome.addMeasurement... bthome.buildPaket... bthome.start(); delay... bthome.stop();
Yes that did it! Even with one sensor though using only 3 letters is kinda a limitation... I will look into it. My thought adding multisensors are that the user should add them all together ( bthome.addMeasurement)) and the .cpp should count the lenght and "chop" the pakets, sending them seperately. The only input from user, should be the name, bind key and the sensors / states. That's my goal... Will work on that when I have some spare time... Thank you a lot for your hard work!!!
I prefer to chop the packet manually cause I use the PT_SLEEP(pt, 500) macro from #include "protothreads.h" to make the thread non-block in the loop.
If the .cpp could chop the packet auto, we should find the proper way to avoid using the delay funtion.
do you have any BTHome related errors in ha?
do you have any BTHome related errors in ha?
No. It works well with my hass.
I think I have solved it with another way.
I have also found a way to send a String for BIND_KEY I'm waiting for your code first
That works much better! I will add now the change to the Bind key to be passed as String, making it more user-friendly
You can test it if you want. My opinion is still that the user shouldn't care about counting the bytes, should just send the values of the sensors and the code should take care of the rest (cropping the pakets and send them so that everything always works) My thought making this example was to be as less complicated and user friendly as it could... I will give it a try to solve this
Thank you once more, you are a great help on this project, most of the code couldn't be here without you!
It would be nice if the code could deal with the data length and chop the adv packet itself. I hope that the bindkey could support not only string but also the char or byte array.
By the way, can your ha display all the sensor entities with the new code?
The example works only for the first two sensors (illuminance, pressure), the rest doesn't get recognised in HA.