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

[Feature]: more comprehensive filter possibility with web_socket #163

Open
rudyvan opened this issue Jun 8, 2024 · 2 comments
Open

[Feature]: more comprehensive filter possibility with web_socket #163

rudyvan opened this issue Jun 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@rudyvan
Copy link

rudyvan commented Jun 8, 2024

Describe the feature

from the documentation, it is possible with web_socket to filter certain devices, but not certain circuits.

(extract)

def on_open(ws):
    print("WebSocket connection opened")
    msg = {"cmd": "filter", "devices": ["do", "ao"]}
    ws.send(json.dumps(msg))

Would it be possible to filter certain devices/circuits?

say:

    msg = {"cmd": "filter", "devices": {"do": ["1_01", "1_02"], "ao": ["1_01"]}}

Why?

It seems that i am getting a lot of 1_12 input changes, even when the input is made high.
On some cases i have 4 web_sockets on one unipi and i would like to limit trafic to the inputs/outputs that are in use and nothing from the others.

Use case

less network traffic for non used circuits

Alternatives Considered

No response

Additional context

No response

@cleveHEX cleveHEX added the enhancement New feature or request label Jun 9, 2024
@kratochvil01
Copy link
Contributor

This is a very useful feature. But I think it might be better to group devices and then add the ability to filter based on these groups.

For example create a Kitchen group with devices like lights, switches, thermometers. etc. And then set the WS filter only for this room. What do you think?

@rudyvan
Copy link
Author

rudyvan commented Jun 13, 2024

Any way of filtering a group of things is useful as unused inputs can occasionally generate a lot of traffic.
Today, when you use analog input 1_01, then sometimes the unused analog input 1_02 start to generate a lot of traffic oscillating between 0,01 and 0,0. Could be avoided with filtering.

So your suggestion of using a group of devices to filter is perfectly fine i think.
Other solution is to unfilter devices such as the ai,1_02 when they are not used in the application.

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

No branches or pull requests

3 participants