control lights over LAN with two SHAC

Discussion in 'C-Bus Wiser 2 Controller' started by samdas, Nov 23, 2021.

  1. samdas

    samdas

    Joined:
    Nov 9, 2021
    Messages:
    2
    Likes Received:
    0
    Hello everyone,

    Can someone help me how to send and received commands over LAN - WAN between two SHAC. I need to control lights between two buildings but i only have VPN between them and one SHAC on each building. Is it possible to have feedback ?

    Thanks in advance!!
     
    samdas, Nov 23, 2021
    #1
    1. Advertisements

  2. samdas

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    180
    Likes Received:
    26
    Location:
    New Zealand
    Anything is possible
    How many groups/what info do you need to pass between them?
    Are you intending to join the 2 cbus networks?
    Or just have some ga available at both locations
    and do you need to do this at a visualisation level or just at a cbus level
     
    Pie Boy, Nov 23, 2021
    #2
    samdas likes this.
    1. Advertisements

  3. samdas

    samdas

    Joined:
    Nov 9, 2021
    Messages:
    2
    Likes Received:
    0

    First goal is to be able to control some lights with feedback between the two buildings if I can merge the two networks even better. Optimal I would like to control everything from the SHAC.

    Thanks again for your time.
     
    samdas, Nov 23, 2021
    #3
  4. samdas

    lcrowhurst

    Joined:
    Dec 2, 2004
    Messages:
    239
    Likes Received:
    77
    Location:
    Sydney, NSW, Australia
    Add the below event script to the sending wiser


    -- add event script triggered by key word TO-WISER
    -- add keywork to groups you want to send to remote wiser
    -- Enable remote user on remote wiser
    -- enter ip address of wiser in wiser
    -- enter leave user a remote
    -- enter password for remote user

    http = require('socket.http')
    http.TIMEOUT = 5

    password = 'password'
    user = 'remote'
    wiser = '192.168.0.10'

    if (event.sender == 'cb') or (event.sender == 'us') then -- if event was from CBus or User Interface
    value = event.getvalue()
    network, application, group = event.dst:match("([%d,]+)/([%d,]+)/([%d,]+)") -- get triggering group details


    url = 'http://'..user..':'..password..'@'....cation..'&matchgrp='..group..'&value='..value
    response = http.request(url)

    log(response)
    log(network)
    log(application)
    log(group)
    log(event.sender)
    end
     
    lcrowhurst, Nov 23, 2021
    #4
    samdas likes this.
  5. samdas

    lcrowhurst

    Joined:
    Dec 2, 2004
    Messages:
    239
    Likes Received:
    77
    Location:
    Sydney, NSW, Australia
    For some reason the URL appears wrong. So I have attached the code in a file.
     

    Attached Files:

    lcrowhurst, Nov 25, 2021
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.