Skip to content

Usage of Edge Lit #152

@tst-038

Description

@tst-038

Hi,

I am trying to figure out how to control the edge lit lights (VMBELO module), both feedback and always-on.

I have tried multiple things without any results, but it is hard to figure out how this all works without any docs.
Below for example is a little script I am using.

import asyncio
import logging

from velbusaio.controller import Velbus
from velbusaio.channels import EdgeLit
from velbusaio.messages.edge_set_color import CustomColorPriority


VELBUS_CONNECTION = "tls://192.168.2.150:27015"

VMBELO_ADDRESS = 0x06

BRIGHTNESS_LEVEL = 200  

FEEDBACK_COLOR_INDEX = 4


async def main():
    print(f"Attempting to connect to Velbus at: {VELBUS_CONNECTION}")
    controller = Velbus(VELBUS_CONNECTION)

    try:
        await controller.connect()
        await controller.scan()
        print("Successfully connected to the Velbus bus.")

        print("Waiting for module discovery...")
        await asyncio.sleep(2)

        edge_lit_channel: EdgeLit | None = None

        module = controller.get_module(VMBELO_ADDRESS)

        if not module:
            print(f"\nError: Module with address {hex(VMBELO_ADDRESS)} was not found.")
            return

        for channel in module.get_channels().values():
            if isinstance(channel, EdgeLit):
                edge_lit_channel = channel
                print(
                    f"Successfully found the EdgeLit channel: '{edge_lit_channel.get_name()}' on module {hex(VMBELO_ADDRESS)}")
                break

        if not edge_lit_channel:
            print(f"Error: Could not find an EdgeLit channel on module {hex(VMBELO_ADDRESS)}.")
            return

        await edge_lit_channel.set_color(20, priority=CustomColorPriority.HIGH_PRIORITY, blinking=True)
        await asyncio.sleep(5)

        await edge_lit_channel.reset_color( )
        await asyncio.sleep(3)


    except Exception as e:
        print(f"An error occurred: {e}")
        logging.basicConfig(level=logging.DEBUG)
    finally:
        print("Disconnecting from the Velbus bus.")
        await controller.stop()
        print("Disconnected.")


if __name__ == "__main__":
    asyncio.run(main())

Unfortunately the module doesn't react to anything, I have tried controlling my relays which works fine ...
Am I doing something wrong or is this not fully supported yet?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions