SHAC - Edlt heating control

Discussion in 'C-Bus Automation Controllers' started by max w, Feb 5, 2019.

  1. max w

    max w

    Joined:
    Sep 14, 2017
    Messages:
    24
    Likes Received:
    2
    Location:
    GB
    Hi I have created a script to enable me to set the room temp on a edlt and change the set point, (due to a update you need to keep the labels length below 14 characters). Im look to duplicate the set up onto the shac to allow the user to edit the same "set point" - I can get the local temp and the status but cannot get the button to move the set point up and down to work? Also any pointers on how to display the "set point- target temp?


    --get room temp from sensor--
    temp, units = GetCBusMeasurement(0, 253, 1)
    --round the value
    temp1 = tonumber(string.format("%." .. (1) .. "f", temp))
    --convert to a string
    temp2 = tostring(temp1)
    --format the appearance of the label
    label = ('Room Temp ' ..temp2..' '..units)
    --if temp is different the update dynamic label
    if (old_temp ~= temp1) then
    SetCBusUnicodeLabel(0, 56, 8, 'English', 'Variant2', label)
    old_temp = temp1
    else
    end

    --read in setpoint and convert to a string
    set_temp = storage.get('setpoint')
    set_temp1 = tostring(set_temp)
    --format the appearance of the label
    set_label = ('SetPoint ' ..set_temp1..' '..units)
    --if temp is different the update dynamic label
    if (old_set_temp ~= set_temp1) then
    SetCBusUnicodeLabel(0, 56, 8, 'English', 'Variant1', set_label)
    old_set_temp = set_temp1
    else
    end

    -- compare values and turn the load on or off
    if set_temp > temp1 then
    SetCBusLevel(0, 56, 10, 255, 4)
    elseif set_temp <= temp1 then
    SetCBusLevel(0, 56, 10, 0, 0)
    end
     
    max w, Feb 5, 2019
    #1
    MarkB 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.