Skip to content

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

Open

Description

@rudyvan

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

Activity

  1. kratochvil01 commented on Jun 13, 2024

    @kratochvil01
    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?

  2. rudyvan commented on Jun 13, 2024

    @rudyvan
    Author

    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.

  3. added this to the v3.1 milestone on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions