Variables from External Devices

Discussion in 'C-Bus Automation Controllers' started by brianza, Jan 21, 2021.

  1. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    I have been wondering about this for a while and would like to know if it is possible.

    Does anyone have any experience with displaying data on a C-Touch (B/W Touch screen) from an external source?

    Some examples:

    1. A weather station that sends UDP data (eg external temperature)
    2. The water level from a sensor
    3. Garage Door state

    and so on.

    I can import CBUS variables but what about such scenarios?

    Brian
     
    brianza, Jan 21, 2021
    #1
    1. Advertisements

  2. brianza

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,254
    Likes Received:
    130
    Location:
    Adelaide, Australia
    There are lots of ways of interfacing external devices with cbus. It is done all the time. If you search the forums you will find plenty of info. If have a specific question about a specific device, feel free to ask about that.
     
    Ashley, Jan 21, 2021
    #2
    1. Advertisements

  3. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    Thank you.

    I have a weather station (weatherflow tempest) which has two options for interfacing. Either rest Api or UDP packets on a specific port.

    I also have a solaredge pv inverter that offers data through api.

    I would like to use the touch screen as a dashboard displaying data from these devices and also take actions according to the data being received.

    I have c-gate running on a server, homebridge and also node-red which may help.

    I would like to know how to bring such data into the Cubs system after which I should be ok
     
    brianza, Jan 22, 2021
    #3
  4. brianza

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    418
    Likes Received:
    50
    Location:
    Perth
    Which touch screen do you have? there are multiple versions and capabilities vary.
     
    chromus, Jan 29, 2021
    #4
  5. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    Mine are these:
    5050CTL2GB- B/W with Logic.

    Just to be complete I am familiar with Aux and General Input C-Bus units. My question is more about how to get IP based network data (which would come in as UDP or TCP packets to display on the touch screen).
     
    brianza, Jan 29, 2021
    #5
  6. brianza

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,254
    Likes Received:
    130
    Location:
    Adelaide, Australia
    Without a Cbus device that supports networking (like the SHAC, Wiser or the original colour touchscreen) you are going to have to use an external application to fetch the data, decode it, and write it to cbus via cgate. I can't help you with off the shelf apps that can do this as I just wrote my own,
     
    Ashley, Jan 29, 2021
    #6
  7. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    Actually I also have a cytech comfort alarm which is seen as a Wiser on the be e Cbus network and this also has Ethernet. Would this help? Alternatively could you point me to programming documentation on how to get data into cgate and I’ll try to program it myself.
     
    brianza, Jan 30, 2021
    #7
  8. brianza

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,254
    Likes Received:
    130
    Location:
    Adelaide, Australia
    I haven't used Cytech alarm panels but I would be surprised if they were programmable to that level.

    All the cgate documentation is installed with cgate. It's in C:\Clipsal\C-Gate2 on windows. Writing group address or measurement values is quite straightforward.
     
    Ashley, Jan 30, 2021
    #8
  9. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    Hi,

    I have tried this for a few weeks and I am still a little stuck as the manuals are a little confusing as they seem to interchange terminology when referring to the same thing.

    In order to do this in baby steps. What I want to achieve is to display a value on the touch screen and change it at will via Telnet to C-gate using the SET command.

    What I have tried so far is to set up a Network Variable in Toolkit (under Enable Control) and view its status in the touchscreen. When changing the value in toolkit this is not reflected on the screen hence I am missing the point somewhere.

    Any guidance appreciated.
     
    brianza, Mar 19, 2021
    #9
  10. brianza

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,254
    Likes Received:
    130
    Location:
    Adelaide, Australia
    This should work fine. You need to describe what you have done in more detail.
    As a minimum:
    Have some values assigned to your enable control variable (e.g. 0 as OFF and 255 as ON).
    In the touchscreen (or PICED which is easier), add a Level Indicator component and select the Enable Control Variable under its Cbus tab.

    If you change the level in Toolkit, the value will change.

    Don't use the SET command. Use RAMP,ON or OFF for lighting, ENABLE SET for Enable Control, and TRIGGER for trigger control.
     
    Ashley, Mar 20, 2021
    #10
  11. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    As a follow up to this question. Could I ask for more help please.

    Here is what I want to achieve:

    On a B/W Touch Screen have a Text Component with Text "Cloudy", "Sunny" or "Overcast" controlled by data sent to C-gate via Telnet.

    I have tried but keep hitting different issues.

    At the point I am not even sure it is possible
     
    brianza, Apr 24, 2021
    #11
  12. brianza

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,254
    Likes Received:
    130
    Location:
    Adelaide, Australia
    There is no component that will select different text based on a cbus value. To do this you will need to use logic. Does your touchscreen support logic?
     
    Ashley, Apr 25, 2021
    #12
  13. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    Yes, it does
     
    brianza, Apr 25, 2021
    #13
  14. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    As a follow up to this question I read the PICED manual from cover to cover over the weekend and it seems that a B/W C-Touch with Logic is not able to show text from a variable. My understanding is that this can be achieved by using Drawtext which is only available on the colour C-Touch. While other indicators can only be used to show integers on the B/W C-touch.

    From the manual:

    There are two ways of displaying logic engine data (for example, the content of a String variable):
    1. Using DrawText is very flexible, but requires code to be written.
    2. A Level / Value indicator can be used to show the text for a string User System IO variable. This requires no coding and you can drag it to wherever you want and set the font, size etc. You place it over the top of a button to make it look like the text is part of the button if required. You can use the "word wrap" option if the text may be wider than the button.

    At this point I'd appreciate confirmation that this cannot be done.

    Brian
     
    brianza, Apr 26, 2021
    #14
  15. brianza

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,254
    Likes Received:
    130
    Location:
    Adelaide, Australia
    Create a User System IO called say 'Tmp'
    Under Component menu, select Place Tool. Select "User System IO", function "Value" and variable "Tmp".
    Create a new module with the following code:

    Code:
    SetStringSystemIO("Tmp", 'ABC');
    Delay(2);
    SetStringSystemIO("Tmp", 'DEF');
    Delay(2);
    Run the logic. Text swaps between ABC and DEF every 2 seconds.
    Hopefully this is enough to get you going.
     
    Ashley, Apr 27, 2021
    #15
  16. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    Thank you. This worked exactly like I needed it. If I could ask two further questions please:

    1. Which component can I use to do the exact same but change between two images rather than variables?

    2. The manuals I have are these:

    cbus Documentation-
    Release 0.2-devby Michael Farrell

    PICED Logic Engine Programmer's Guide
    SW v4.14 Feb 2015

    C-BUS Basic Logic Training Guide
    1250SM0905R10/09

    None of these make reference to the "Place Tool" - User SystemIO as you described. Had you not told me about it I probably would have missed it and gave up.

    Is there a better manual please?

    rgs
    Brian
     
    brianza, Apr 27, 2021
    #16
  17. brianza

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,254
    Likes Received:
    130
    Location:
    Adelaide, Australia
    There is no way to change an image on the B&W touch screen. The only option I can think of is to duplicate the page with a different image on each page then select the appropriate page with logic. You can use the pageShowing function to pick up when the user selects that page then just change the page as you need to get the different images.

    This is in the PICED on-line help manual under HELP/Main...
    There is also lot's more help in the same menu
     
    Ashley, Apr 27, 2021
    #17
  18. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    13
    Likes Received:
    0
    thanks once again. Armed with this new information I will try to build on it and will post updates which may help others too.
     
    brianza, Apr 27, 2021
    #18
    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.