EDLT, SHAC & 5104DTSI

Discussion in 'Pascal Logic Code Examples' started by max w, Dec 13, 2018.

  1. max w

    max w

    Joined:
    Sep 14, 2017
    Messages:
    24
    Likes Received:
    2
    Location:
    GB
    Hi I want to be able to display a temperature from my5104DTSI and be able to set an adjustable set point, is this possible?

    I know I need to use the script writer in the SHAC, can any one point me in the right direction?

    Any advice will be thankfully received !

    Max W
     
    max w, Dec 13, 2018
    #1
  2. max w

    lcrowhurst

    Joined:
    Dec 2, 2004
    Messages:
    275
    Likes Received:
    98
    Location:
    Sydney, NSW, Australia
    This script turns an air con unit to hot/coll/off if auto is set
    It is a event-based script that triggers when the sensor temperature changes (0/228/1/1)

    ==================================================

    -- compare set temp to rounded tempGet Kitchen Temp
    -- compare set temp to rounded tempSet Display Temp
    -- compare set temp to rounded tempIf Auto is ON Turn on either Heat or Cool depending temperature

    -- Read temperature from sensor - first 1 = the id of the sensor, set in tool
    -- GetCBusMeasurement(network, sensor device ID, channel)
    temp, units = GetCBusMeasurement('House', 1, 1)

    -- round temp up/down for display and comparing
    actualtemp = temp>=0 and math.floor(temp+0.5) or math.ceil(temp-0.5)

    SetCBusMeasurement('House', 201, 1, actualtemp, 254)

    tempauto = GetEnableLevel(1)
    --Is Auto ON ?
    if tempauto == 255 then

    -- read what the set temp is
    settemp, units = GetCBusMeasurement('House', 101, 1)

    -- Turn Heat On
    -- compare set temp to rounded temp

    if settemp > actualtemp then
    SetCBusLevel(0, 56, 95, 255, 0)
    end

    --Turn Cool On
    -- compare set temp to rounded temp

    if settemp < actualtemp then
    SetCBusLevel(0, 56, 95, 127, 0)
    end


    -- Turn Off

    if settemp == actualtemp then
    SetCBusLevel(0, 56, 95, 0, 0)
    end

    end
    ==================


    The rounded temp is shown on the screen

    upload_2018-12-15_10-45-34.png

    The target temp can be adjusted

    upload_2018-12-15_10-49-11.png
     
    lcrowhurst, Dec 14, 2018
    #2
    max w likes this.
  3. max w

    max w

    Joined:
    Sep 14, 2017
    Messages:
    24
    Likes Received:
    2
    Location:
    GB
    Hi Laurance,
    Thanks for the script example how did you set up the display for the set point and the buttons to adjust the temp set point?

    thanks Max W
     
    max w, Feb 10, 2019
    #3
  4. max w

    lcrowhurst

    Joined:
    Dec 2, 2004
    Messages:
    275
    Likes Received:
    98
    Location:
    Sydney, NSW, Australia
    Create a button (object) for the settemp object
    then assign the following Visual parameters

    upload_2019-2-11_17-37-59.png


    then onto of the button object over lay another object for the actualtemp object

    and make it read only

    upload_2019-2-11_17-45-37.png
     
    lcrowhurst, Feb 11, 2019
    #4
    max w likes this.
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.