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:
    3
    Likes Received:
    0
    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
    1. Advertisements

  2. max w

    lcrowhurst

    Joined:
    Dec 2, 2004
    Messages:
    124
    Likes Received:
    33
    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.
    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.