-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use pyISY to access node valye #391
Comments
The command line is really just for testing, it's not really any sort of interface. If you want to actually perform tasks with the module, you can start by copying This can be moved to whatever part of your program you choose. The most important part is providing the connection info and then initializing the connection before trying to connect to anything. The docs for this module are hit-or-miss--I was never able to fully update them from Version 1 to Version 3, so some detail is out of date. As far as testing: I tested on a fresh virtual environment and all I ran was the following and it connected: python3 -m venv pyisy-test # Creates a new virtual enviornment for a clean set of dependencies
cd pyisy-test && source bin/activate # Activate the virtual env.
python3 -m pip install pyisy # install PyISY
python3 -m pyisy http://polisy.local:8080 admin "password" Two gotchas: double check that your port number is correct and put your password in quotes if it has any special characters in it. Finally, I would recommend before you get too deep into this that you check out https://github.com/shbatm/pyisyox instead. That is going to ultimately be the replacement for this module and it has better support for Node Servers built in. Again |
Thank you very much for taking time and helpning me. I do not have polisy but eisy and now have to use polyglot 3. You wrote "start by copying main.py and adding in what you want to do around line 70 -- that will essentially connect to the ISY, initialize, and leave you with a variable isy that has the node information you want to manage. This can be moved to whatever part of your program you choose. The most important part is providing the connection info and then initializing the connection before trying to connect to anything" Do I understand correctly that I can copy the first 70 lines from main_.py to my first executable file to establish connection and then write the rest of the code or main_.py has to be unchanged and left in pyisy folder and the rest of the code to use the ISY variable in a nodeserver can be in other files. |
My HarmonyHub and ELK node server both use PyISY, and ELK uses the one built into PG3x. |
Thank you jimboca. I found the references in ELK controller.py but this is too complex for my knowledge level. It would take me a month to analyze it. I found your examples at https://github.com/jimboca/PyISYExamples much easier to understand but even with that clear examples I cannot make them to work for me. I started with your test.py substitting my credentials and switch address. When i tried to run this from command line I get error I suspected that I have change PyISY to pyisy
and it stays as that when I change PyISY to isy = pyisy.ISY(ADDR, PORT, USER, PASS, False, "1.1", logger) and I am stack |
I hope this is appropriate to ask this question.
My goal is simple. I want find a value of the node from a nodeserver already installed.
I know pyisi can do it, but I did not figure out how to do it and I spent a week reading and testing.
The quickstart.rst says to instal pyisy
pip3 install pyisy
After that I check with pip list and pyisy is installed.
The quick guide says that once it is installed run python3 -m pyisy http://your-isy-url:80 username password.
This does not work for me. I got error that there is missing my.py.
I figure out that I need to have installed all the files from this repository.
I installed it in developer mode and then when I run the command python3 -m pyisy http://your-isy-url:80 username password. from within the folder where it is installed it works like a charm. It lists in my terminal all the values from all my nodes. It will continue to do until I exit but when it is running I cannot run from the terminal any commands. When I exit it stops.
I thought that once the pyisy is installed I would be able to access directly any node using address directly.
I copied a code from connection.py (addedd my credentials) to connect to my ISY than added the code example from quickstart.rst - changing address to address of my switch
NODE = '22 5C EB 1'
node = isy.nodes[NODE]
await node.turn_off()
sleep(5)
await node.turn_on()
It does not work
The errors are showing that something is missing. I add the code to import the misisng code from other files in this repository and then another code is missing. There are so many dependencies that it seems endless and that the whole pyISY nodeserved has to run.
Obviously I do not know how to do it.
Any help or suggestions.
The text was updated successfully, but these errors were encountered: