2 Way Comms with CNI's

Discussion in 'C-Bus Automation Controllers' started by Diggerz, Mar 3, 2023.

  1. Diggerz

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    Curious to know if anyone has attempted 2 way comms with a NAC/SHAC and CNI's.

    Its easy enough to send TCP commands TO a CNI with an event script.
    Its also not too difficult to receive and filter commands FROM a CNI with a script.

    Given the CNI only handles one TCP connection, the next step would be to work on a bi-directional script, but was wondering if anyone has had a go at it already?
     
    Last edited: Mar 3, 2023
    Diggerz, Mar 3, 2023
    #1
  2. Diggerz

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,526
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Not quite sure what you're trying to do here. Given the SHAC is already connected to Cbus, what are you trying to accomplish?
     
    Ashley, Mar 3, 2023
    #2
  3. Diggerz

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    The application is more for Large Project's with Multiple C-Bus networks. Essentially have a NAC / SHAC replace a schedule plus headend and make use of the existing CNI’s
     
    Last edited: Mar 3, 2023
    Diggerz, Mar 3, 2023
    #3
  4. Diggerz

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,526
    Likes Received:
    173
    Location:
    Adelaide, Australia
    You are heading down a rabbit hole there. :)

    I have written my own windows application that supports multiple PCI's and models all the networks as a single large network. It was a major undertaking using a serious programming language and took a couple of years to complete (actually I'm still going!). Doing that in Lua in an SHAC would be impossible. As I discovered, it's not something you can half do. If you really want the SHAC to control multiple networks, you will have to replace the PCI's with bridges off the main network.
     
    Ashley, Mar 3, 2023
    #4
  5. Diggerz

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    haha yeah i figured as much,

    i have a test setup with 2 c-bus networks at the moment. One is a test rig with a SHAC and a few devices, the other is my home network with a CNI. Both connected via Ethernet.

    Using one TCP script to receive, I’m able to connect to the CNI and map all the messages to groups/applications and objects within the SHAC

    Using another event based TCP script, I’m able to connect to the CNI and fire off commands.

    Now to nut out an approach to combine the two to send and receive. Has anyone created any bi-directional tcp scripts? Maybe splitting out some functions / user libraries may be the way to go?
     
    Diggerz, Mar 4, 2023
    #5
  6. Diggerz

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    I think ive got there with an event script and resident script
     
    Diggerz, Mar 4, 2023
    #6
  7. Diggerz

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    Success, i have 2 way comms working, I can send and receive apps/groups/levels bi-directionally.
    Just handling lighting commands for the moment, need to expand the data parsing and stress test, but so far im happy to have the shac acting as a headend and GUI for the 2 networks, one local and one remote CNI. I'd like to test connecting to a few more CNI's as well, replicating a larger c-bus Ethernet backbone setup more common on commercial projects.

    Is there any particular reason the new firmware’s have limited the object addressing structure?

    I have a NAC on firmware 1.13 and can no longer add networks or applications outside the typical c-bus range.
    In firmware version 1.6 the object ranges were less restricted, much like the KNX device its based on.

    Funnily enough, its possible to restore a project with ranges outside the norm to regain them.

    Only ask as currently im offsetting my network applications by the main group of the KNX object structure.
    By default the local network groups are objects 0/xxx/xxx (0/56/0) etc. and im currently mapping the CNI address to objects 1/xxx/xxx (1/56/0) etc. on the SHAC.

    I’ve used these ranges in the past for other dummy groups like widgets, time, date etc. with no issue so curious as to why they have now been restricted.

    Wonder if maybe Schneider have or had plans to implement a c-bus Ethernet protocol much like KNXnet/IP and Dynalite over Ethernet. I’m a little surprised they haven’t done so already actually, it would make life a lot easier on large projects if the NAC's could communicate over Ethernet with each other.
     
    Diggerz, Mar 5, 2023
    #7
  8. Diggerz

    Colin Moderator

    Joined:
    Aug 3, 2004
    Messages:
    120
    Likes Received:
    23
    Location:
    Australia
    The C-Bus Automation Controllers have implemented the C-Bus Application Assignment rules that have been Part of C-Bus for about 2 Decades, The Object Address you mention above is the address range of C-Bus it does not follow and never has followed a KNX object structure, but i understand how you may draw that conclusion, as the General Applications of C-Bus (commonly referred to as Lighting Applications) have the address structure of <Network Address>/<Application Address>/<GAV>, This is also true for Applications Address for Enable and Trigger Applications, However if you look at applications like Measurement, Error, Audio, Emergency and Exit lighting you will see that the address is much larger such as error and measurement, <Network Address>/<Application Address>/<Device ID Address>/<Channel Address>

    The Object addressing Follows the structure of the C-Bus Tag Map, And the Tag Map follows the Rules of C-Bus Product and Software. the Controllers have been playing a little catchup on this topic since 1.6,0 firmware, with more of the Address and Label rules being applied through the UI creation of objects being introduced in each firmware 1.9.0 , 1.11.0, 1.12.0 and 1.13.0 releases.

    The Applicable range of application addresses for general applications on C-Bus is 48 to 127, (this range was expanded from 48 to 95, about the time the Controllers were first launched, All other application addresses are reserved, Software (Toolkit when not running in legacy mode) Follow the same rules, so if you want to offset you mapping by application, for general purpose (lighting) style controls objects then you will want to select applications in the range 48 to 127.

    Also you may consider using User parameters with Integer value types, you have an address range of 65535 User parameters,
     
    Last edited: Mar 5, 2023
    Colin, Mar 5, 2023
    #8
  9. Diggerz

    Colin Moderator

    Joined:
    Aug 3, 2004
    Messages:
    120
    Likes Received:
    23
    Location:
    Australia
    The C-Bus Automation Controllers have been implementing a new Api to support new development and features to come to the product over time, This Api has been creeping in since 1.11.0 and is fairly much complete for object management in 1.13.0. There is still plenty more to come.

    The API is intended for providing greater support between new commissioning Software (Not Toolkit) and the Controllers to aid in a better experience in commissioning of the controllers and support the easy use of more advanced applications on C-Bus such as Error, Measurment, Emergency and Exit Lighting, and much more to come.

    The API offers CRUD for Tag Map and Object Creation, it also offers Control/monitoring of all object types in the controller. as of 1.13.0

    The API is not anything to do with putting C-Bus Over IP directly, but it does offer the possibilities to discover controllers on a network and identify the object details on the controllers and control them,

    The API is developed with internal use by Schneider Electric as its first priority, but it is freely available for developers make use of also. I will state that there is some chance of modifications to the API for object management in future releases, as we begin to develop the next applications and software to support it, but this is expected to be minor if at all necessary
     
    Colin, Mar 5, 2023
    #9
  10. Diggerz

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    Thanks Colin,

    Is it possible to call the existing c-bus bus decode functions at all?

    As the NAC / SHAC are already decoding the cbus messages on the local network it would be a great benefit to leverage them to parse the CNI commands.

    They would likely be much more efficient than anything I come up with as well.

    Is there any documentation available you could pass on for the API as well?
     
    Last edited: Mar 6, 2023
    Diggerz, Mar 6, 2023
    #10
  11. Diggerz

    Colin Moderator

    Joined:
    Aug 3, 2004
    Messages:
    120
    Likes Received:
    23
    Location:
    Australia
    Sorry No, I think its easier to just say No, without explanation, than to explain in great length why not.
     
    Colin, Mar 6, 2023
    #11
  12. Diggerz

    Colin Moderator

    Joined:
    Aug 3, 2004
    Messages:
    120
    Likes Received:
    23
    Location:
    Australia
    The Plan is to produce some Documentation to support developers on the use of the API, The API itself is Self-Documenting,

    without going into great detail, i Hope these first two pointers will get you started, I need a bit more time to do the formal stuff.


    Using any web browser, First authenticate with device on https://<NAC-SHAC-IP-Address>/api/swagger.json


    Then in a Second window open up this link to swagger tools. Swagger UI


    In the swagger path, enter the same path as you used to authenticate with the device https://<NAC-SHAC-IP-Address>/api/swagger.json and hit explore

    To test and trial the API you need to authorize the connection (see authorize button on pages)

    Under each item that you see supported, There is a data model with an example and a second option to show the data model which is going a long way to explain what is done,

    I welcome any feedback that you have that could help make the Documentation more helpful.

    A few notes

    the Controller requires a Tag Map definition for all objects, you can have a Tag Map entry without an associated object, but not the other way around.

    The TAG map represents the Address space in use by your C-Bus Project, Example, If you have on your local network (the one connected to the Controller) a Lighting Application GAV for the Kichen Light, Default Lighting applications 56, so say 0/56/1 , BY Having a entry in the Tag map, for Local Network 0, Application 56 (tag label is lighting), and Group Address Variable 1 (Tag Label is Kitchen Light) The Labels and Address for the Network Application and Address are now reserved, But you do not need to have a Object defined in the controller for this, if you have no interest to control or monitor the Kitchen Bench Light then you only need to know the address is reserved.

    Thus if you try to create an Object at address 0/56/1 that Object will take on the labels defined in the TAG, if you modify the labels while creating the object you will modify the Tag. if you create a brand new object you will not be able to do so at 0/56/1 as the Address is already reserved .

    So in Short, TAG Map without Object = Yes
    Object without Tag Map = No

    If you want to discover what a Controller is having control over then GET the Object List, whereas if you want to Get a List if Addresses on C-Bus that the Controller is aware of then GET the Tag Map List.

    The rest will come in proper documentation.
     
    Colin, Mar 6, 2023
    #12
    KevinH, Damaxx and KCW like this.
  13. Diggerz

    Dasman

    Joined:
    May 5, 2011
    Messages:
    37
    Likes Received:
    5
    Location:
    Adelaide
    I also have some experience in playing around with this API (getting the NAC to create objects on itself), so i will be able to field some questions on it
     
    Dasman, Mar 6, 2023
    #13
  14. Diggerz

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    I've just been revisting this again over the christmas break.

    The Initial idea was raised as we work on a lot of large commercial installations running schedule plus and a number of CNI networks over an ethernet backbone. Its probably not too applicable to a residential installation unless you have a situation where its dificult to get a c-bus cable between 2 buildings ( main house / outhouse or detached garage ) but you can get wifi or have an ethernet connection there.

    Most sites these days wish to do away with maintaining schedule plus and a dedicated lighting control PC and the Automation controller is a reliable replacement, however this means either changing all the CNI's to Automation controllers and using a BACnet device as a central platform to control all the networks or replacing all the CNI's with Bridges and wiring a c-bus backbone so the Automation controller can communicate to all networks.

    Are there any plans to enable native communication like c-bus over ethernet between Automation controllers? This would allow the CNI's to be replaced with Automation controllers.

    The KNX logic Machine currently does this using KNX netIP and multicast. The advantage is you can distribute the network over a commercial buildings central ethernet network, and choose one controller to host all master schedules and logic as well as the interface for control of the entire system, and if needed you can also offload local schedules and logic to the local controllers,

    Ive currently got 2 way lighitng application comms working between one c-bus network with an Application Controller and another c-bus network with a CNI. Im in the process of adding support for a 3rd c-bus network with another CNI and more with the goal to have the application controller able to replace schedule plus without the need to remove the CNI's.
     
    Diggerz, Jan 10, 2024
    #14
  15. Diggerz

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    An update to this: I currently have 3 individual C-Bus networks connected via Ethernet as the backbone.
    C-Bus Network 1 and C-Bus Network 2 use CNI's (5500CN2's), and the 3rd has an AC controller and acts as the headend.
    The AC controller can send and receive lighting messages and stores the values as objects mapped to different applications. I can create a scene on the AC, and it sends messages to all 3 networks. I can also send messages between the 2 CNI networks, using the AC as the middle man. A switch on CNI network 1 can turn a light on/off on CNI network 2 and vice versa.

    How do the C-Bus objects on the AC work in regards to networks? Ideally, I'd like to map each CNI network with a network value rather than mapping to applications. However, I've noticed while using the same application with different network addresses on the AC (e.g. 0/56/1, 1/56/1, 2/56/1, even 253/56/1) that if I send a message to one object, all objects on the AC with the same application will update to the same value. Is this the expect behaviour? I was expecting these to operate in isolation of one another on the AC.
     
    Diggerz, Jan 20, 2024
    #15
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.