Hello @milanmeu ,
I’ll try to answer some of your questions.
I contacted them via their FAQ on the French site. They told me that Blueriiot Pool & Spa Assistant will end compatibility with IFTTT on April 22. Then they were going to try to make the thing last longer but that the IFTTT pricing conditions did not suit them.
I did reverse on the iPhone app and here is my flow. I check that the filtration is working and if so, I connect and retrieve the last measurements.
[{"id":"e28768f8.fb1468","type":"tab","label":"RiiotLabs","disabled":false,"info":""},{"id":"93bd29f9.079478","type":"http request","z":"e28768f8.fb1468","name":"Request Login","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://api.riiotlabs.com/prod/user/login","tls":"","persist":false,"proxy":"","authType":"","x":420,"y":280,"wires":[["10bbea77.af0426","4c197c58.b6d7e4"]]},{"id":"1686c8ec.1ff4d7","type":"function","z":"e28768f8.fb1468","name":"AWS Signature","func":"var aws4Module = global.get('aws4Module');\n\nvar opts = { \n host: 'api.riiotlabs.com',\n path: '/prod/swimming_pool?deleted=false',\n service: 'execute-api',\n region: 'eu-west-1'\n};\n\naws4Module.sign(opts, {\n accessKeyId: flow.get('access_key'),\n secretAccessKey: flow.get('secret_key'),\n sessionToken: flow.get('session_token')\n});\n\nmsg.headers = opts.headers;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":180,"y":400,"wires":[["1485414f.8a61df"]]},{"id":"48c2a67e.709258","type":"debug","z":"e28768f8.fb1468","name":"Debug Swimming Pool","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":660,"y":380,"wires":[]},{"id":"aec473dd.669f6","type":"comment","z":"e28768f8.fb1468","name":"2. On s'identifie sur l'API de RiiotLabs","info":"","x":190,"y":240,"wires":[]},{"id":"10bbea77.af0426","type":"function","z":"e28768f8.fb1468","name":"Save access_key, secret_key et session_token","func":"flow.set('access_key', msg.payload.credentials.access_key);\nflow.set('secret_key', msg.payload.credentials.secret_key);\nflow.set('session_token', msg.payload.credentials.session_token);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":720,"y":300,"wires":[["1686c8ec.1ff4d7"]]},{"id":"4c197c58.b6d7e4","type":"debug","z":"e28768f8.fb1468","name":"Debug Credentials","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.credentials","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":260,"wires":[]},{"id":"8e81189f.1240e8","type":"comment","z":"e28768f8.fb1468","name":"3. On récupère l'identifiant de la piscine","info":"","x":190,"y":360,"wires":[]},{"id":"1485414f.8a61df","type":"http request","z":"e28768f8.fb1468","name":"Request Swimming Pool","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.riiotlabs.com/prod/swimming_pool?deleted=false","tls":"","persist":false,"proxy":"","authType":"","x":410,"y":400,"wires":[["48c2a67e.709258","a4ff4396.e03f3"]]},{"id":"a4ff4396.e03f3","type":"function","z":"e28768f8.fb1468","name":"Save swimming_pool_id","func":"flow.set('swimming_pool_id', msg.payload.data[0].swimming_pool_id);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":420,"wires":[["b741599d.3e03b8"]]},{"id":"1f6c4977.8c2f57","type":"comment","z":"e28768f8.fb1468","name":"4. On récupère l'identifiant du Blue Connect","info":"","x":200,"y":480,"wires":[]},{"id":"b741599d.3e03b8","type":"function","z":"e28768f8.fb1468","name":"AWS Signature","func":"var aws4Module = global.get('aws4Module');\n\nvar opts = { \n host: 'api.riiotlabs.com',\n path: '/prod/swimming_pool/' + flow.get('swimming_pool_id') + '/blue',\n service: 'execute-api',\n region: 'eu-west-1'\n};\n\naws4Module.sign(opts, {\n accessKeyId: flow.get('access_key'),\n secretAccessKey: flow.get('secret_key'),\n sessionToken: flow.get('session_token')\n});\n\nmsg.headers = opts.headers;\nmsg.swimming_pool_id = flow.get('swimming_pool_id');\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":170,"y":520,"wires":[["4bf2e9af.3d1158"]]},{"id":"1d0f9da6.31ec92","type":"debug","z":"e28768f8.fb1468","name":"Debug Blue Device","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":620,"y":500,"wires":[]},{"id":"4bf2e9af.3d1158","type":"http request","z":"e28768f8.fb1468","name":"Request Blue Device","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.riiotlabs.com/prod/swimming_pool/{{{swimming_pool_id}}}/blue","tls":"","persist":false,"proxy":"","authType":"","x":390,"y":520,"wires":[["1d0f9da6.31ec92","43047113.5b874"]]},{"id":"43047113.5b874","type":"function","z":"e28768f8.fb1468","name":"Save blue_serial","func":"flow.set('blue_serial', msg.payload.data[0].blue_device.serial);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":540,"wires":[["df5da1bd.b208a"]]},{"id":"479b50e9.9a031","type":"comment","z":"e28768f8.fb1468","name":"5. On récupère les dernieres mesures","info":"","x":190,"y":600,"wires":[]},{"id":"df5da1bd.b208a","type":"function","z":"e28768f8.fb1468","name":"AWS Signature","func":"var aws4Module = global.get('aws4Module');\n\nvar opts = { \n host: 'api.riiotlabs.com',\n path: '/prod/swimming_pool/' + flow.get('swimming_pool_id') + '/blue/' + flow.get('blue_serial') + '/lastMeasurements?mode=blue_and_strip',\n service: 'execute-api',\n region: 'eu-west-1'\n};\n\naws4Module.sign(opts, {\n accessKeyId: flow.get('access_key'),\n secretAccessKey: flow.get('secret_key'),\n sessionToken: flow.get('session_token')\n});\n\nmsg.headers = opts.headers;\nmsg.swimming_pool_id = flow.get('swimming_pool_id');\nmsg.blue_serial = flow.get('blue_serial');\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":180,"y":640,"wires":[["cec4ed0a.4fbac"]]},{"id":"cec4ed0a.4fbac","type":"http request","z":"e28768f8.fb1468","name":"Request Last Measurements","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.riiotlabs.com/prod/swimming_pool/{{{swimming_pool_id}}}/blue/{{{blue_serial}}}/lastMeasurements?mode=blue_and_strip","tls":"","persist":false,"proxy":"","authType":"","x":420,"y":640,"wires":[["7f2c0cc1.9cdc94"]]},{"id":"793e9d88.e620b4","type":"debug","z":"e28768f8.fb1468","name":"Debug Measurements","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"blue_measure","targetType":"msg","statusVal":"","statusType":"auto","x":920,"y":640,"wires":[]},{"id":"a25c83f2.9cfd7","type":"comment","z":"e28768f8.fb1468","name":"6. On met à jour les données dans HA","info":"","x":190,"y":720,"wires":[]},{"id":"8aa34cb8.eb4a2","type":"inject","z":"e28768f8.fb1468","name":"Every hour","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":80,"wires":[["91333625.f07bf8"]]},{"id":"91333625.f07bf8","type":"api-current-state","z":"e28768f8.fb1468","name":"","server":"cfe85b65.cca4e8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.piscine_filtration","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":250,"y":120,"wires":[["6274ecf4.66c214"]]},{"id":"6274ecf4.66c214","type":"switch","z":"e28768f8.fb1468","name":"Is Power On ?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":520,"y":120,"wires":[["da5d0377.1a13b"],["d9f36f78.22f07"]]},{"id":"249ce9b0.91f896","type":"comment","z":"e28768f8.fb1468","name":"1. On vérifie que la piscine filtre depuis au moins 5 minutes","info":"","x":250,"y":40,"wires":[]},{"id":"45bbe207.61cc5c","type":"debug","z":"e28768f8.fb1468","name":"Debug State Filtration","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":920,"y":100,"wires":[]},{"id":"da5d0377.1a13b","type":"function","z":"e28768f8.fb1468","name":"Off Message","func":"msg.payload = \"La filtration de la piscine est éteinte.\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":100,"wires":[["45bbe207.61cc5c"]]},{"id":"d9f36f78.22f07","type":"function","z":"e28768f8.fb1468","name":"Compare Time","func":"// Date et heure de la mise en route\nvar chgDate = new Date(msg.data.last_changed);\nvar last_changed = chgDate.getTime()\n\n// Date actuelle\nvar nowDate = new Date();\nvar current_time = nowDate.getTime()\n\n// On retourne la différence en minutes\nmsg.payload = Math.floor((current_time-last_changed) / 1000 / 60);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":160,"wires":[["9c9f919e.4b5c9"]]},{"id":"9c9f919e.4b5c9","type":"switch","z":"e28768f8.fb1468","name":"More 5 min ?","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"5","vt":"str"},{"t":"gte","v":"5","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":160,"wires":[["faa3013c.dd18"],["592c5018.a7589"]]},{"id":"f8577f7a.7eee8","type":"debug","z":"e28768f8.fb1468","name":"Debug State Filtration","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":160,"wires":[]},{"id":"faa3013c.dd18","type":"function","z":"e28768f8.fb1468","name":"Less 5 min Message","func":"msg.payload = \"La filtration est allumé depuis moins de 5 minutes.\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":640,"y":160,"wires":[["f8577f7a.7eee8"]]},{"id":"592c5018.a7589","type":"function","z":"e28768f8.fb1468","name":"Identifiants RiiotLabs","func":"msg.payload = {\n \"email\": \"LOGIN\",\n \"password\": \"PASSWORD\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":200,"y":280,"wires":[["93bd29f9.079478"]]},{"id":"d7452b6d.6cdc58","type":"api-call-service","z":"e28768f8.fb1468","name":"Update Temperature","server":"cfe85b65.cca4e8","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.pool_temperature","data":"{\"value\":msg.blue_measure.temperature}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":640,"y":820,"wires":[[]]},{"id":"ae067e9d.393a4","type":"api-call-service","z":"e28768f8.fb1468","name":"Update pH","server":"cfe85b65.cca4e8","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.pool_ph","data":"{\"value\":msg.blue_measure.ph}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":860,"wires":[[]]},{"id":"7f2c0cc1.9cdc94","type":"function","z":"e28768f8.fb1468","name":"Format Blue Data","func":"msg.blue_measure = {\n last_measure: msg.payload.last_blue_measure_timestamp,\n temperature: msg.payload.data.filter(elm => elm.name == \"temperature\").pop().value,\n ph: msg.payload.data.filter(elm => elm.name == \"ph\").pop().value,\n orp: msg.payload.data.filter(elm => elm.name == \"orp\").pop().value,\n salinity: msg.payload.data.filter(elm => elm.name == \"salinity\").pop().value\n}\nmsg.payload = \"\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":640,"wires":[["793e9d88.e620b4","41b617dc.8bd2e8"]]},{"id":"41b617dc.8bd2e8","type":"api-current-state","z":"e28768f8.fb1468","name":"","server":"cfe85b65.cca4e8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.piscine_filtration","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"filtration","override_data":"msg","blockInputOverrides":false,"x":230,"y":760,"wires":[["d5530516.ad4af8"]]},{"id":"d5530516.ad4af8","type":"function","z":"e28768f8.fb1468","name":"Start 5min ?","func":"// Date et heure de la mise en route\nvar chgDate = new Date(msg.filtration.last_changed);\nvar start_filtration = chgDate.getTime()\n\n// Date et heure de la mesrue du Blue Connect\nvar measureDate = new Date(msg.blue_measure.last_measure);\nvar last_measure = measureDate.getTime()\n\n// On vérifie si la mesure à été prise 5 minutes aprés le démarrage de la filtration\nmsg.payload = (last_measure > (start_filtration + 5*60*1000))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":190,"y":820,"wires":[["4022e44f.6d671c"]]},{"id":"4022e44f.6d671c","type":"switch","z":"e28768f8.fb1468","name":"Measure after filtration start ?","property":"payload","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":880,"wires":[["247a3a94.925f26"],["d7452b6d.6cdc58","ae067e9d.393a4","b5dbfc28.7c2c","d21d3fbe.11a6e","6bcd23c8.b5911c"]]},{"id":"b5dbfc28.7c2c","type":"api-call-service","z":"e28768f8.fb1468","name":"Update ORP","server":"cfe85b65.cca4e8","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.pool_orp","data":"{\"value\":msg.blue_measure.orp}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":900,"wires":[[]]},{"id":"d21d3fbe.11a6e","type":"api-call-service","z":"e28768f8.fb1468","name":"Update Salinity","server":"cfe85b65.cca4e8","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.pool_salinity","data":"{\"value\":msg.blue_measure.salinity}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":620,"y":940,"wires":[[]]},{"id":"5fdb888b.438f18","type":"debug","z":"e28768f8.fb1468","name":"Debug Measurements","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":760,"wires":[]},{"id":"247a3a94.925f26","type":"function","z":"e28768f8.fb1468","name":"Before Filtration Message","func":"msg.payload = \"La mesure a été prise avant la mise en marche de la filtration.\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":650,"y":760,"wires":[["5fdb888b.438f18"]]},{"id":"6bcd23c8.b5911c","type":"api-call-service","z":"e28768f8.fb1468","name":"Update Analysed at","server":"cfe85b65.cca4e8","version":1,"debugenabled":false,"service_domain":"input_datetime","service":"set_datetime","entityId":"input_datetime.pool_analysed_at","data":"{\"datetime\":msg.blue_measure.last_measure}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":630,"y":980,"wires":[[]]},{"id":"cfe85b65.cca4e8","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
What they are proposing today is to make a POST request on the URL you want when a new measurement is made and pass the data in JSON. Only I’m a new HA user and I don’t know how to create this kind of URL yet.
I hope I partially answered your questions.