eDLT options - change with time of day

Discussion in 'C-Bus Wired Hardware' started by pict, Aug 15, 2020.

  1. pict

    pict

    Joined:
    Jul 26, 2020
    Messages:
    8
    Likes Received:
    0
    Hi all

    Pretty sure this will be a simple 'not possible', but I'll ask anyway

    Can you change the EDLT options based on the time of day?

    Cheers
     
    pict, Aug 15, 2020
    #1
  2. pict

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    What specifically do u want to change?

    You can change colours and brightness based on a schedule if i have a logic unit on your network.
     
    chromus, Aug 15, 2020
    #2
  3. pict

    pict

    Joined:
    Jul 26, 2020
    Messages:
    8
    Likes Received:
    0
    Maybe to have morning scenes available for selection in the AM and Goodnight type scenes available in the PM?

    Still getting my head around how the logic unit integrates with the broader system.
     
    pict, Aug 15, 2020
    #3
  4. pict

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    That kind of thing is possible, but would have to be pretty much all done in logic/scripting in one of the controller engines. Its not simple to do, but basically you would be making the button just a bit that you monitor and use the dynamic labelling of the switch to show different things based on time of day and then action something when your button bit changes and it is a certain time of day....
     
    jboer, Aug 15, 2020
    #4
  5. pict

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    If u can get it down to 1 page per time of day, you could use the Page Control functions which means you could set a grp address up and set a schedule to change the value of that address and it will change the default open page to that addressed value.

    The help file for EDLTs covers this in Toolkit.
     
    chromus, Aug 15, 2020
    #5
    Mr Mark and jboer like this.
  6. pict

    pict

    Joined:
    Jul 26, 2020
    Messages:
    8
    Likes Received:
    0
    Thanks everyone.

    Chromus, that sounds like the go. I will suss that out.

    Been working on some scripting to gather weather information from public API's - also keen to see if this can be displayed on an eDLT.
     
    pict, Aug 17, 2020
    #6
  7. pict

    Shiney2512

    Joined:
    Apr 26, 2016
    Messages:
    39
    Likes Received:
    4
    Location:
    Melbourne
    this is what i'm using to display local weather temp from BOM -


    Code:
    json = require('json')
    http = require('socket.http')
    res, err = socket.http.request('http://www.bom.gov.au/fwo/IDV60901/IDV60901.94870.json') -- Change idv60901/idv60901.xxxxx to local weather station
    if res then
      data = json.pdecode(res)
      if type(data) == 'table' then
        log(data.observations.data[1].air_temp)
        SetCBusMeasurement('local', 0, 0, data.observations.data[1].air_temp, 0)  -- set weather temp to c-bus measurement group
      end
    end
    IMG_8043.JPG
     
    Shiney2512, Aug 17, 2020
    #7
  8. pict

    pict

    Joined:
    Jul 26, 2020
    Messages:
    8
    Likes Received:
    0
    Oh wow, perfect, thats pretty much what I needed to see!

    I wanted to see if I could get something like the below displayed - but wasn't sure if the CbusMeasurement only accepted a 'temperature' and not a string value.

    Code:
    -- load the http socket module
    local http = require("socket.http")
    -- load the json module
    json = require("json")
    
    api = "http://api.openweathermap.org/data/2.5/weather?q=sydney&units=metric&appid=<my api key>"
    
    -- Unicode weather symbols to use
    icons = {
      ["01"] = "☀",
      ["02"] = "",
      ["03"] = "",
      ["04"] = "☁",
      ["09"] = "",
      ["10"] = "",
      ["11"] = "",
      ["13"] = "",
      ["50"] = "",
    }
    
    measure = '°'
    currenttime = os.date("!%Y%m%d%H%M%S")
    
    math.round = function (n)
      return math.floor(n + 0.5)
    end
    
    response = http.request(api)
    weather = json.decode(response)
    temp = math.round(weather.main.temp)
    description = weather.weather[1].main
    icon = weather.weather[1].icon:sub(1,2)
    iconf = icons[icon]
    display = iconf .. " " .. description .." " .. temp .. measure
    
    as for eDLT page and group address - I have found where to configure the dynamic labels for the pages, which I assume configures the group address.

    Does anyone have any code examples of how these pages would be 'set' ?

    Thanks!!!
     
    pict, Aug 17, 2020
    #8
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.