Blue Connect pool measurements

Can you post your code properly please? Instructions are here How to help us help you - or How to ask a good question

Thanks for the instructions. I have edited my original post.

Hi @HA_jr

I’m thinking of getting a blue connect to monitor my pool and I’m an avid HA user. Are you happy with the device?

Also, I saw on their website that they support IFTTT - https://riiotlabs.zendesk.com/hc/en-us/articles/360000305357-Is-Blue-compatible-with-IFTTT-

I wonder if this is an alternative to scraping the emails - you could make HA webhooks be updated by IFTTT possibly?

Thanks

Hi @danps

I am very happy with the Blue Connect Plus. It was quite easy to install. And it works perfect! I can truely recommend this product. I have made an integration with the salt chlorinator with help of Home Assistant, i.e., when ORP level gets low, the salt chlorinator starts automatically.

I have changed from email scraping to IFTTT. The drawback with email scraping was that every time I restart Home Assistant, it starts reading the old emails and it takes a while until status has been updated to the latest email. IFTTT integration works fine, but there is up to 1,5 hours delay from the Blue Connect measurement until it reaches IFTTT and Home Assistant. I suppose this is a problem on the Blue Connect side. It seems to go much faster from IFTTT to Home Assistant.

Thanks @HA_jr!

That’s exactly my plan with the chlorinator as well. I’ll use a Sonoff R2 to control the chlorination process based on readings from the Blue Connect. It’s a shame that the readings aren’t coming to IFTTT for quite a while but I suppose the chlorine level doesn’t change that quickly on a moderately-sized swimming pool. How often does the data update? Hourly maybe?

Thanks again

For anyone else with a Blue Connect, I did just get one as well, and I’m using IFTTT to POST JSON to a webhook which I then catch with an Automation in Home Assistant, and update an “Input Number” which in turn is the basis of my sensors. So my config looks like this…

First the input_numbers…

pool_temperature:
  name: Pool Temperature
  min: 0
  max: 100
  step: 0.1
  unit_of_measurement: '°C'
pool_ph:
  name: Pool pH
  min: 1
  max: 15
  step: 0.1
pool_orp:
  name: Pool ORP
  min: 0
  max: 2000
  step: 1
  unit_of_measurement: 'mV'
pool_salinity:
  name: Pool Salinity
  min: 0
  max: 10
  step: .001
  unit_of_measurement: 'ppt'
pool_conductivity:
  name: Pool Conductivity
  min: 0
  max: 10000
  step: 1

These are my sensors…

- platform: template
  sensors:
    pool_temperature:
      friendly_name: "Pool Temperature"
      unit_of_measurement: '°C'
      value_template: "{{ states('input_number.pool_temperature') }}"
    pool_ph:
      friendly_name: "Pool pH"
      value_template: "{{ states('input_number.pool_ph') }}"
    pool_orp:
      friendly_name: "Pool ORP"
      unit_of_measurement: 'mV'
      value_template: "{{ states('input_number.pool_orp') }}"
    pool_salinity:
      friendly_name: "Pool Salinity"
      unit_of_measurement: 'ppm'
      value_template: "{{ states('input_number.pool_salinity') | float * 1000 }}"
    pool_conductivity:
      friendly_name: "Pool Conductivity"
      value_template: "{{ states('input_number.pool_conductivity') }}"

And my automation…

- id: blue_connect_data_update
  alias: Blue Connect Data Update
  trigger:
  - platform: webhook
    webhook_id: blueconnect
  action:
  - service: input_number.set_value
    data_template:
      entity_id: input_number.pool_temperature
      value: '{{trigger.json.temperature | float}}'
  - service: input_number.set_value
    data_template:
      entity_id: input_number.pool_ph
      value: '{{trigger.json.ph | float}}'
  - service: input_number.set_value
    data_template:
      entity_id: input_number.pool_orp
      value: '{{trigger.json.orp | float}}'
  - service: input_number.set_value
    data_template:
      entity_id: input_number.pool_salinity
      value: '{{trigger.json.salinity | float}}'
  - service: input_number.set_value
    data_template:
      entity_id: input_number.pool_conductivity
      value: '{{trigger.json.conductivity | float}}'

And finally the JSON message body in IFTTT…

{"temperature":"{{TemperatureCelsius}}", "ph":"{{Ph}}", "orp":"{{Orp}}", "salinity":"{{Salinity}}", "conductivity":"{{Conductivity}}"}
1 Like

Thanks for sharing! Do you also experience delays of ~1 hrs before receiving blue connect measurements from IFTTT?

Yeah it seems to vary quite a bit…

I’ve been trying to use the automation to record what the delay is, but I don’t have the code quite right yet and haven’t had the time to fix it. This is what I’ve been experimenting with, bit didn’t work…

   - service: input_number.set_value
     data_template:
       entity_id: input_number.blue_connect_time_delay
       value: '{{((as_timestamp(utcnow())-as_timestamp(strptime("trigger.json.time","%d/%m/%Y
         %H:%M:%S")))/60)|float -600}}'

I’ve also noticed fewer than 20 readings per day. Did you notice the same?

Yes, I have more like 10-15 measurements per day. However, I have my pool on a timer 9 am - 9 pm, also registered in Blue Connect so I thought this was the reason. Is it also your experience that the delay is from Blue Connect to IFTTT, but not from IFTTT to HA?

Hi folks,

I’m looking at buying a second hand unit, looks like it could be a fit for me. I’m really only after stats.

How did efforts with integration go? Able to iron out frequency issues?

Does this unit require calibration or something at some point?

I have not spent more time looking into the delays. It works really well, but gives more like 10 readings per day and with delays up to an hour. For me that is not a big concern.

So just to update on the delay between a reading being taken and how soon it is showing in HA.
I have now changed how I handle the incoming data from IFTTT to use Node-Red instead of a HA automation, and as part of my flow I am recording the difference between the current time and the timestamp on the reading…

Having run it for more than 24hrs, I can now see that the delay is highly variable…

The quickest update took just 84s while the slowest was 1712s - almost half an hour!

I don’t know of a way to tell where any delays would come from as the data flow is this…

  1. Reading taken
  2. Is there any sigfox delay (I don’t know anything about how this network works)
  3. BlueConnect “cloud”
  4. IFTTT
  5. Nabu Casa (I think this just passes packets, so probably not this)
  6. HA (via Node Red)

All up, even at the slowest update delay, I don’t think 28 mins is that bad - the value with the greatest variance in a pool - the ORP doesn’t change that rapidly, so for me this delay is not an issue really. Still pretty happy with the BlueConnect and the data it gives me!

Hey guys - this worked like a charm! However - been trying to get the property “AnalysedAt” of the IFTTT integration for BlueConnect - to read when the measurement was done - anyone had success with this one? I’ve been trying both input_number and input_text…

Hi, my pool is still in vinterized mode but this is what I have in my configuration.yaml file:

input_datetime:
  bc_analysed_at:
    has_date: true
    has_time: true

sensor:
  - platform: template
    sensors:
      pool_analysed_at:
        friendly_name: 'Analyserad'
        icon_template: mdi:calendar-clock
        value_template: >-
          {{states.input_datetime.bc_analysed_at.attributes.timestamp|timestamp_custom("%Y-%m-%d %H:%M")}}

…and this is what I have in my automation.yaml

- alias: 'BC from IFTTT'
  trigger:
    platform: event
    event_type: ifttt_webhook_received
    event_data:
      action: bc_measurement
  action:
  - service: input_datetime.set_datetime
    entity_id: input_datetime.bc_analysed_at
    data_template:
      date: "{{strptime(trigger.event.data.analysed_at_iso8601,'%B %d, %Y at %I:%M%p').strftime('%Y-%m-%d')}}"
      time: "{{strptime(trigger.event.data.analysed_at_iso8601,'%B %d, %Y at %I:%M%p').strftime('%H:%M')}}"
...

Hopefully helpful for you to convert the IFTTT input to the correct format.

1 Like

hello everyone

This is my first message, a greeting of thanks to all this wonderful community.

I just started with this HA, although I’ve been reading for a while now I’m taking advantage of the confinement to start
I think that these steps you indicate are very complex, do you know if there is a plugin or a simpler method?

Thank you very much and greetings

Thanks - i’ll give it a go!

  • but from what i can gather from your port - you are using the “AnalysedAtIso8601” instead of “AnalysedAt” ingredient of the IFTTT webhook?

Hello
I have managed to connect the Blue Connect with IFTTT and it already sends the data well.
What I am not able to achieve is for IFTTT to send the data to HA or HA to capture that data.
Could you pass me the configuration that I have to put in cofiguration.yaml and if I have to do something else in HA?
I copied all the ones you have here in the thread but for some reason it does not detect my IFTTT.
Thank you so much for everything

Hi all. Thanks for this info.

I’m super keen to get it working.

I procured a Blue Connect yesterday. Happily taking sigfox and BT readings.

configuration.yaml and automations.yaml appear to be good.

IFTTT seems to load ok with the key.

I’m struggling with my skills and the IFTTT documentation:

My IFTTT looks nothing like the documentation screen shots.

Nor does my lovelace UI for Development > Services. Mine asks for the service name (ifttt.trigger) and Service Data (YAML, optional). Not the JSON in the documentation and @danps description above.

When I set up the webhooks service there is no UI that asks to complete a trigger field as shown in the documentation.

I’m not sure if there is a fundamental problem with my understanding of the solution (likely) or if the documentation hasn’t been updated for a fair while.

Any pointers greatly appreciated. Thanks

When you setup the IFTTT on HA, you get a webhook_id, something like http://your_ha_ip_address:8123/api/webhook/your_webhook_id

You need to add BlueConnect on IFTTT.

You create a webhook on IFTTT if a new measurement with these settings:
URL: http://your_ha_ip_address:8123/api/webhook/your_webhook_id
method: POST
content type : application/json
action: { "action": "my_action_name", "property":"{{property_value}}"}

On HA you have to consume it this way:

input_number:
  property:

automation:
 - alias: my alias
    trigger:
        platform: event
        event_type: ifttt_webhook_received
        event_data: 
          action: my_action_name
    condition: []
    action: 
      - service: input_number.set_value
        data_template:
          entity_id: input_number.property
          value: '{{ trigger.event.data.property }}'

Hi All,

Here is the updated Node-Red JSON for my inbound data flow…

[{"id":"a2345807.bbc9c8","type":"ha-webhook","z":"1bb50542.81126b","name":"BlueConnect Webhook","server":"a23a4d01.eeb32","outputs":1,"webhookId":"blue_connect","payloadLocation":"payload","payloadLocationType":"msg","headersLocation":"","headersLocationType":"none","x":180,"y":320,"wires":[["ebc5b5a.3c2a248"]]},{"id":"ebc5b5a.3c2a248","type":"switch","z":"1bb50542.81126b","name":"New Measure?","property":"payload.time","propertyType":"msg","rules":[{"t":"neq","v":"","vt":"prev"}],"checkall":"true","repair":false,"outputs":1,"x":400,"y":320,"wires":[["d2c85e6f.f164e","3770976e.784fb8","5f5d6f7f.8c305","dae8675e.10b038","747b5a26.135d64","b048c2c3.9025d","7d0176e9.094a18"]]},{"id":"d2c85e6f.f164e","type":"function","z":"1bb50542.81126b","name":"x1000","func":"var x=Number(msg.payload.salinity)\nmsg.payload.salinity=x*1000\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":360,"wires":[["f38fab54.5fe968"]]},{"id":"3770976e.784fb8","type":"change","z":"1bb50542.81126b","name":"Measure Delay","rules":[{"t":"set","p":"payload","pt":"msg","to":"(\t   $toMillis($now()) - $toMillis(\t       payload.time,\t       '[D01]/[M01]/[Y0001] [H01]:[m01]:[s01]' \t   )\t)/1000\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":480,"wires":[["a256dbf0.03bb48"]]},{"id":"6424dda6.4cc674","type":"ha-entity","z":"1bb50542.81126b","name":"Blue Connect Measurement Delay","server":"a23a4d01.eeb32","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Blue Connect Measurement Delay"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"s"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1020,"y":480,"wires":[[]]},{"id":"5f5d6f7f.8c305","type":"ha-entity","z":"1bb50542.81126b","name":"Temperature","server":"a23a4d01.eeb32","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"pool_temperature"},{"property":"device_class","value":"temperature"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"°C"}],"state":"payload.temperature","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"msg","inputOverride":"allow","x":790,"y":180,"wires":[[]]},{"id":"dae8675e.10b038","type":"ha-entity","z":"1bb50542.81126b","name":"pH","server":"a23a4d01.eeb32","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"pool_ph"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"pH"}],"state":"payload.ph","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":770,"y":240,"wires":[[]]},{"id":"747b5a26.135d64","type":"ha-entity","z":"1bb50542.81126b","name":"Orp","server":"a23a4d01.eeb32","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"pool_orp"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"mV"}],"state":"payload.orp","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":770,"y":300,"wires":[[]]},{"id":"f38fab54.5fe968","type":"ha-entity","z":"1bb50542.81126b","name":"Salinity","server":"a23a4d01.eeb32","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"pool_salinity"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"ppm"}],"state":"payload.salinity","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":780,"y":360,"wires":[[]]},{"id":"b048c2c3.9025d","type":"ha-entity","z":"1bb50542.81126b","name":"Conductivity","server":"a23a4d01.eeb32","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"pool_conductivity"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"mho"}],"state":"payload.conductivity","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":790,"y":420,"wires":[[]]},{"id":"2e3b8fff.7ed07","type":"ha-entity","z":"1bb50542.81126b","name":"Update Count","server":"a23a4d01.eeb32","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Blue Connect Update Count"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":800,"y":540,"wires":[[]]},{"id":"7d0176e9.094a18","type":"api-current-state","z":"1bb50542.81126b","name":"Count","server":"a23a4d01.eeb32","version":1,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.blue_connect_update_count","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":490,"y":540,"wires":[["b94912c.85ab7f"]]},{"id":"b94912c.85ab7f","type":"function","z":"1bb50542.81126b","name":"+1","func":"var x=Number(msg.payload)\nmsg.payload=x+1\nreturn msg;","outputs":1,"noerr":0,"x":630,"y":540,"wires":[["2e3b8fff.7ed07"]]},{"id":"88995690.f6b7b8","type":"inject","z":"1bb50542.81126b","name":"Reset Counter","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"00 00 * * *","once":false,"onceDelay":0.1,"x":160,"y":600,"wires":[["5230267f.9a7e68"]]},{"id":"a256dbf0.03bb48","type":"function","z":"1bb50542.81126b","name":"Single Decimal Place","func":"var x = Number(msg.payload)\n\nmsg.payload = x.toFixed(1)\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":480,"wires":[["6424dda6.4cc674"]]},{"id":"c22f216.ef67ae","type":"ha-entity","z":"1bb50542.81126b","name":"Yesterday Count","server":"a23a4d01.eeb32","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Blue Connect Updates Yesterday"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":480,"y":600,"wires":[["8215815e.5dfc2"]]},{"id":"5230267f.9a7e68","type":"api-current-state","z":"1bb50542.81126b","name":"Count","server":"a23a4d01.eeb32","version":1,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.blue_connect_update_count","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":330,"y":600,"wires":[["c22f216.ef67ae"]]},{"id":"8215815e.5dfc2","type":"change","z":"1bb50542.81126b","name":"Zero","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":600,"wires":[["2e3b8fff.7ed07"]]},{"id":"a23a4d01.eeb32","type":"server","z":"","name":"Home Assistant"}]

One thing we noticed when I was helping a friend set his up using my exported JSON, is that for the HA nodes, we needed to go in and change the server name from “Home Assistant” to “Home Assistant”!!
I’m assuming there is some hidden id in play, and the imported “Home Assistant” which was selected was not the correct one.
The flow now looks like this…


It depends on having not just the node red addon installed, but also the integration installed (via HACS) and configured. I no longer use the “input-numbers” as NR can now create sensors directly in HA which is great.
As a previous poster mentioned, after deploying this flow, you’ll need to go into HA config and find the webhook that has been created. I use Nabu Casa cloud for this inbound webhook so it’s auto-created, but you could also port-map your HA server from the outside world.
Hope that helps