I was just about to change the id_prefix so it’s not the same as the name_prefix, when I noticed the ESP device got one measurement to HA. However, it was from the day before, so I couldn’t get the logging back. I think I was playing around with the enable button at the time, so perhaps that’s the solution to my problem.
From what I understand, when enabling the ble_client (setting the switch in HA to enabled), the measurement should show up within minutes. How did you setup the automation? I played around with this a bit yesterday, turning it on every hour for 30 minutes, or turning it on every 10 minutes for 5 minutes. Both without result.
Hi Peter, sorry for the delay, I had time today to tinker with ESPHome and had to learn some things before configuring the device. Luckily, it was easier than I expected. I’m using an M5Stack Atom Lite device, and the platform is supported by esphome. I’ll tag @JosePortillo in case he wants to take a look at data.
Here’s the log lines you asked for, I hope the fourth sensor regarding the salinity can be decoded:
INFO Starting log output from blueconnect-m5.axel.dom using esphome API
INFO Successfully connected to blueconnect-m5.axel.dom
[15:26:16][I][app:102]: ESPHome version 2023.5.5 compiled on Jun 4 2023, 15:25:35
[15:26:17][I][main:266]: Reading Blueconnect
[15:26:29][I][raw_hex:152]: 33.FC.08.75.07.80.03.CC.00.C4.0D.19 (12)
[15:26:29][I][temp:155]: 23.000000
[15:26:29][I][ph:160]: 7.599138
[15:26:29][I][orp:164]: 232.124359
[15:26:29][I][bat:168]: 25.000000
[15:26:29][I][ble_client:041]: [00:A0:50:A6:76:DC] Disabling BLE client.
[15:26:29][W][ble_text_sensor:040]: [Pool reading data] Disconnected!
[15:26:49][I][esp32_ble_client:064]: [0] [00:A0:50:A6:76:DC] 0x00 Attempting BLE connection
[15:26:49][I][ble_text_sensor:034]: [Pool reading data] Connected successfully!
[15:26:51][I][esp32_ble_client:196]: [0] [00:A0:50:A6:76:DC] Connected
[15:26:51][I][main:232]: Connected to Blueconnect
[15:26:53][I][main:266]: Reading Blueconnect
[15:27:37][I][raw_hex:152]: 33.F2.08.71.07.81.03.CC.00.C4.0D.1A (12)
[15:27:37][I][temp:155]: 22.900000
[15:27:37][I][ph:160]: 7.616379
[15:27:37][I][orp:164]: 232.383423
[15:27:37][I][bat:168]: 26.000000
[15:27:37][I][ble_client:041]: [00:A0:50:A6:76:DC] Disabling BLE client.
[15:27:37][W][ble_text_sensor:040]: [Pool reading data] Disconnected!
[15:50:37][I][esp32_ble_client:064]: [0] [00:A0:50:A6:76:DC] 0x00 Attempting BLE connection
[15:50:39][I][ble_text_sensor:034]: [Pool reading data] Connected successfully!
[15:50:42][I][esp32_ble_client:196]: [0] [00:A0:50:A6:76:DC] Connected
[15:50:42][I][main:232]: Connected to Blueconnect
[15:50:44][I][main:266]: Reading Blueconnect
[15:50:55][I][raw_hex:152]: 33.F2.08.4F.07.3C.03.CC.00.C4.0D.19 (12)
[15:50:55][I][temp:155]: 22.900000
[15:50:55][I][ph:160]: 7.762931
[15:50:55][I][orp:164]: 214.507767
[15:50:55][I][bat:168]: 25.000000
[15:50:55][I][ble_client:041]: [00:A0:50:A6:76:DC] Disabling BLE client.
[15:50:55][W][ble_text_sensor:040]: [Pool reading data] Disconnected!
Yes, that should be possible.
Make sure that the id and name are unique for both devices and that the HA sensors are also unique.
Then you can enable them 1 by 1 in HA
or
you could do that in the code at the end of text_sensor 1 and activate the second button after turning the first off. They should then go 1 by 1. I would add a small delay allowing the BLE to really disconnect.
Maybe the scan_parameters are needed here to control better timing. Not sure as with my hardware those are not needed, for 2 others they where needed.
I will see what comes out of the calculation using the one provided earlier in this thread. What does you app give for reading so there is a reference to calculate towards?
The formulas are in the source code of that page, but it’s not a simple formula, I don’t know if we can do that stuff in ESPHome…maybe in HA we could…
This is a linear equation with a 5% error range for the estimate (good enough if you ask me), the conductivity provided by the device seems in micro, so it has to be first divided by 1000 I guess.
I’ve been using that one since it was released. The problem is that it’s cloud-based, it gets the values from the blueriiot cloud service (didn’t look at the code deeply). From what I understand, it doesn’t reverse engineer the values, it gets them straight from the API. It works beautifully, but it’s cloud based so I prefer to read them locally, if possible.
I think you can add this option to the ble_client switch:
restore_mode: ALWAYS_OFF
Edit: This doesn’t seem to work with this particular switch, the restore_mode is already ALWAYS_OFF by default. This is probably just the way ble_client works, it tries to connect to the mac address after boot up.
Did a few test with the data and looked at the earlier calculations. Looks like the new firmware (indicated with the 33 instead of the 23 as first 2 digts) the dividing by 25 is now somewhere in the 75.xx to get the salinity straight out of the raw value.
Do you have 1 more reading with the salinity from the app where the salinity is not 2.7?
if its doable a few with different values would be great, 1 at time of low salinity and then maybe some at adding and somewhere in the middle. Dont need them straight away, if you could send them to me when you have them. Dont need the full log just the line with [raw_hex[ will do together with the salinity level from the app.
meanwhile is will work with the value you send me and see if the linear conversion delivers the same value as straight from the raw measurement. Will then update the ESP code to add the results in HA.
if its works for you starting with just the salinity from raw data, so you can test the conversion with your pool
my pool pump and chlorinator are broken, and I ordered new stuff but it’ll be here in a couple of weeks, so right now the pool is out of service. Luckily though, the salinity level has dropped significantly (1.4 g/l) now, so I am able to provide you the different value you asked (lower than last data I provided).
Here’s the log and the screenshot of the app. Once my pool will be ready again, I will be able to provide medium level data too.
INFO Successfully connected to espblueconnect.axel.dom
[03:32:46][I][main:235]: Connected to Blueconnect
[03:32:48][I][main:269]: Reading Blueconnect
[03:32:59][I][raw_hex:157]: 33.00.0A.44.07.80.02.75.01.B9.0D.1B (12)
[03:32:59][I][temp:160]: 25.600000
[03:32:59][I][ph:165]: 7.810345
[03:32:59][I][orp:169]: 165.803116
[03:33:00][I][bat:173]: 27.000000
Hi, Thank you for the great work integrating Blue Connect. I bought Blue Connect mainly beacuse esphome integration exist. I am new to Blue Connect and I have a question about its readings: I get big differences in readings so I wonder if this is normal. Please ckeck this picture. I did not added any chemicals yet still a big variations in readings for ORP. Ph is stabilised 7. 1 -
7.2
What does the APP say when you do the reading just after esphome gets the data back?
With no chemicals the orp should be like with alexdelprete (around 150 - 160)