For people with Vistapool, Hidrolife, etc pool automation system, I found a (very dirty) way of integrating data into Home Assistant. I only wanted sensors for temperature and pH level, but you can modify it to get any other parameter.
First use this PHP script (thanks Chris) with your username/password to get your pool data. You can modify the script so the output is a simple json file with {"temp":12.3,"pH”:4.5}
in it. Just add this at the end of the script:
$fp = fopen('vistapool.json’, 'w+');
fwrite($fp, '{"temp":');
fwrite($fp, substr(($result["temp"]), 0, -3));
fwrite($fp, ',"ph":');
fwrite($fp, ($result["PH"]));
fwrite($fp, '}');
fclose($fp);
Then I created a batch file in Windows to execute the script every 15 minutes and copy (and subsequently replace) the file into the Hassio \www\vistapool\ folder.
:start
php vistapool.php
xcopy /y C:\Users\me\sensor\vistapool.json H:\www\vistapool\
timeout 900
goto start
Finally, create two file sensors to read the values from the file:
- platform: file
name: Pool Temp
file_path: /config/www/vistapool/vistapool.json
value_template: '{{ value_json.temp }}'
unit_of_measurement: '°C'
scan_interval: 900
- platform: file
name: Pool pH
file_path: /config/www/vistapool/vistapool.json
value_template: '{{ value_json.ph }}'
scan_interval: 900
And here you go:
The original PHP script can read all values and control all functions. That would be great to have, but if anybody can help with a simple login + get temp&ph Python script, everything could be done inside Home Assistant. Having to depend on another OS to execute the PHP script might not be very reliable.