Would love some help with reading the status of my Synaccess PDU outlets. I have been able to control the switches, but struggling with reading the status.
But how do I get the status portion, to get status it is one call that returns all outlets at once.
outlet_state: curl -X POST --user "user: password" 'http://192.168.0.100/cmd.cgi?$A5'
## RETURNED VALUE
$A0,11111 ##-> ALL ON
$A0,11110 ##-> ALL ON EXCEPT OUTLET 1, the order is reversed first digit is outlet 5, last is outlet 1
Any help would be appreciated… I did find a package integration that would possible work, but I’m running HAOS and I don’t think I can easily integrate it with venv, so creating my own interface seems like a less fraught task.
Changed the title to see if someone might take a peek and provide some feedback. Just need to figure out how to read a text string into a sensor based on the location of a 1 or 0 in the string response from the curl call. See above.
Taras… That was my intent, but I don’t have a clue of HOW to use it to parse the data. I have made the call and got the data returned, but how do I parse the location of the ‘0’ in the returned string to determine if an outlet is on or off. That is the question.
outlet_state: curl -X POST --user "user: password" 'http://192.168.0.100/cmd.cgi?$A5'
## RETURNED VALUE
$A0,11111 ##-> ALL ON
$A0,11110 ##-> ALL ON EXCEPT OUTLET 1, the order is reversed first digit is outlet 5, last is outlet 1
According to the documentation for Command line Switch, the value_template should report true/false to indicate on/off. Try it with the following template for Outlet 1.