Closed RienduPre closed 6 months ago
Any comments on this, is it possible to help you?
@RienduPre sure, if you know a little bit of python (I know very little myself) you totally can help, adding a new sensor shouldn't be too hard. Besides, I don't have use the binary entries so it would be harder for me to test if it actually works.
If am I am correct, you are using pypoolstation. Looking into that code, I don't see references to sensor input. So that would make things harder to develop. Correct?
@straybiker I created pypoolstation, so we can make any change we need. The problem is that the API is not documented and I don't use the binary inputs or ORP sensor, so I don't know what field in the hundreds (literally, hundreds) of fields in the API's response to look for.
Then names are not very helpful either, these are for instance the ones I figured out that contain temperature, salt concentration, target ph and current ph:
It's mainly a matter of knowing where to look.
How do you get this list?
you can simply shortcut an binary input on the printboard and see if the value changes from 0 to 1
This is just one of the requests made to the api every few seconds when you check your pool in https://poolstation.net
This is just one of the requests made to the api every few seconds when you check your pool in https://poolstation.net
Ok but how do I execute such a request?
They are made automatically every few seconds to refresh the information on the page.
Forgive me my ignorence, but I still don't know how to do that adn generate the list you shown us in the screenshot
You can see them in the dev tools of the browser
What I found sofar is: THe status of the four relais:
I assume you mean the binary inputs, right? Because the relays have worked for a while now.
No I'm searching for the binary inputs right now
The inputs are just potential free inputs. I wired them so I can easily make the contact to test and check the api response. But it has to wait till next week.
I found them.
They are d1, d2, d3 and d4
0 = open, 1 = closed
I'm having trouble to setup a HA development environment on my M1 mac, so I'm unable to do some programming myself and my python knowledge is also very limited
I also like to have an indicator if the waterflow is OK.
It looks like this is the ac variable 1 = OK 0 is not OK
Let me handle the pypoolstation update first to expose the binary sensors and that waterflow one too. Hopefully tonight.
For setting up HA in an M1 mac, I'd suggest to use VSCode with the docker extension installed. As soon as you open the project it should detect that it has a dockerfile and ask if you want to reopen it in a container.
I've published a new version of the pypoolstation that also parses the state of the binary inputs and also their names, because they are configurable. Initially they are "D1", "D2", etc..., but in your very screenshot you've renamed one of them to "Test1". This can be useful to create the entities in home assistant with a more helpful name. I also parsed the waterflow, which can useful to create a binary sensor with device type "problem", which is a special type of sensor that when its state is ON home assistant will report it in the UI. I've created one for when my heat recuperator tells me that the filters need cleaning and I found it handy.
It's a bit late to make the changes to the integration, I'll try to find time tomorrow.
Update: It turns out this integration was quite outdated with modern idioms for home assistant, particularly on how number entities worked. tl;dr; Some behavior was deprecated and it would have stopped working in 2023.10. I first took care of updating and cleaning everything.
Now I think I can start adding more features. In the next few days....
I added the waterflow binary sensor. It can be either OK or Problem.
Binary sensors for the digital inputs will come next.
I've added support for the digital inputs, but for now they are just named digital_input_1
, digital_input_2
, etc...
Since poolstation allows to give them aliases, I need to investigate if I should try to give them the same names in home assistant.
Works great sofar👍 Thanks for your effort.
Hi, I am realy happy with the current integration you have created👏 I appreciate the work you put into it.
I use 2 binary sensors for the water level of my pool. I saw this feature is on your todo list and hope you can find time implement this. Having this functionality I can automate some events based on high or low water level.
Thanks in advance,
Rien