Skip to content
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

zigpy-cli - socket interface #7

Closed
mdeweerd opened this issue Dec 20, 2021 · 7 comments
Closed

zigpy-cli - socket interface #7

mdeweerd opened this issue Dec 20, 2021 · 7 comments

Comments

@mdeweerd
Copy link

Just a suggestion - add a daemon mode with a socket interface.

The socket interface would accept the same commands as the CLI but without addint the call to zigpy or the radio setting.

So the daemon could be started like this:

zigpy radio znp /dev/ttyUSB0 daemon --host 127.0.0.4 --port 3400

And then connections can be made to port 3400 to send commands, using telnet, netcat or whatever.

Example:

telnet 127.0.0.4 3400

Then inside the telnet session:

network info

The parsing of the commands would remain the same as on the cli, but then the tool would have a broader range of uses and the zigpy session can keep on running without requiring reinitialisation, potentially reporting incoming messages as well.

@puddly
Copy link
Contributor

puddly commented Feb 14, 2022

You may be interested in @dmulcahey's https://github.com/zigpy/zha-websocket-server/ (and ZHA WS itself https://github.com/dmulcahey/home-assistant/tree/dm/zha-ws) as a basis for such a tool. Its command line client currently is just thin frontend for sending JSON but building an alternative CLI with asyncio-native python-prompt-toolkit seems very doable in the future.

Once the low-level network information PRs are done, adding backup/restore to ZHA WS (and things from https://github.com/mdeweerd/zha-toolkit/!) will be very easy.

@dmulcahey
Copy link

@mdeweerd any interest in working on this with us? It may eventually replace ZHA entirely.

@mdeweerd
Copy link
Author

I am really busy on quite a few projects. I can easily put in some brain power, but not too much coding. I have put some effort into the project to help it go forward, and because I can use some of it.

@Hedda
Copy link

Hedda commented Feb 22, 2023

You may be interested in @dmulcahey's https://github.com/zigpy/zha-websocket-server/ (and ZHA WS itself https://github.com/dmulcahey/home-assistant/tree/dm/zha-ws) as a basis for such a tool. Its command line client currently is just thin frontend for sending JSON but building an alternative CLI with asyncio-native python-prompt-toolkit seems very doable in the future.

Once the low-level network information PRs are done, adding backup/restore to ZHA WS (and things from https://github.com/mdeweerd/zha-toolkit/!) will be very easy.

Noticed PR home-assistant/core#88564 with work on HA's ZHA network settings API and that reminded me of question about the websocket server project, so wondering what the current planned roadmap/status is for zha-websocket-server and ZHA WS itself?

@Hedda
Copy link

Hedda commented Mar 23, 2023

You may be interested in @dmulcahey's https://github.com/zigpy/zha-websocket-server/ (and ZHA WS itself https://github.com/dmulcahey/home-assistant/tree/dm/zha-ws) as a basis for such a tool. Its command line client currently is just thin frontend for sending JSON but building an alternative CLI with asyncio-native python-prompt-toolkit seems very doable in the future.
Once the low-level network information PRs are done, adding backup/restore to ZHA WS (and things from https://github.com/mdeweerd/zha-toolkit/!) will be very easy.

Noticed PR home-assistant/core#88564 with work on HA's ZHA network settings API and that reminded me of question about the websocket server project, so wondering what the current planned roadmap/status is for zha-websocket-server and ZHA WS itself?

Bump this question now that home-assistant/core#88564 (ZHA network settings API) has been merged into Home Assistant core.

@mdeweerd
Copy link
Author

@Hedda Thanks for keeping this Issue up-to-date.

This is for sure a nice addition to ZHA, however my suggestion was really related to Zigpy itself when it is launched independently from ZHA.

@mdeweerd
Copy link
Author

Closing this - not very recent, not the main usage of the cli I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants