Wiser and Monitors

Discussion in 'C-Bus Wiser 1 Controller' started by techguy, Oct 23, 2011.

  1. techguy

    techguy

    Joined:
    Mar 24, 2011
    Messages:
    5
    Likes Received:
    0
    Location:
    Melbourne
    a quick question, I am wanting to provide a temperature reading from a C-Bus temperature sensor, can do this easily on the colour touch screen using a monitor. Unfortunately I cant find a monitor widget on the wiser, any advice on the best way to show this on the wiser, thx
     
    techguy, Oct 23, 2011
    #1
  2. techguy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You can do this, using logic.

    If the temperature sensor is a reasonably new one it should support transmitting the temperature as a value on the Measurement application. You then need to create a System IO String variable and use logic to write the value being broadcast on the measurement application to the variable. You can then add a System IO String widget to your Wiser UI to display it.

    If the temperature sensor is older you can still do it, but you additionally need to create the Monitor for the temperature sensor in the PICED project first.
     
    Newman, Oct 23, 2011
    #2
  3. techguy

    techguy

    Joined:
    Mar 24, 2011
    Messages:
    5
    Likes Received:
    0
    Location:
    Melbourne
    thanks Newman, I will give this a go, I have previously tried this approach using a System IO using a Real value, will try this taking the value into a System IO String and see how I go, thanks again for the advice. One for the Wiser guys to add a Monitor widget to the Wiser like available in PICED.
     
    techguy, Oct 24, 2011
    #3
  4. techguy

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Monitors are not currently supported in Wiser. PICED allows you to add them, but it shouldn't.

    Issue number 22277
     
    Darren, Oct 24, 2011
    #4
  5. techguy

    poldim

    Joined:
    Dec 7, 2010
    Messages:
    166
    Likes Received:
    2
    Location:
    San Francisco, CA
    Newman, Is there a place where I can get more information on how I can actually do this? I'm new to PICED / Wiser and any "how to's" or tutorials would be a great help.
     
    poldim, Oct 25, 2011
    #5
  6. techguy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    There's no official "how to" but hopefully the info below will give you enough to get you going. I've assumed that your temperature sensors are new-ish and support broadcasting temperature on the measurement application. Note that the same basic technique can be used for anything that is broadcast on the Measurment Application, not just temperatures from temperature sensors.

    Temperature Sensor Config - Toolkit

    • In the Toolkit UI for the temperature sensor set the Sensor Mode to Measurement.
    • For simplicity, make sure the Device ID, which appears when you select Measurement for Sensor Mode, matches the unit address of the sensor.
    • On the Global tab configure a broadcast interval for how often you want the unit to broadcast it's temperature. Every 2 minutes should do the trick.
    • If desired, you can specify a Temperature Threshold. This allows you to specify a change in temperature (since the last broadcast) that will result in an immediate broadcast of temperature. A value of 1 degree here is sufficient.
    Create System IO String variable - PICED

    • In PICED select the Project menu and select the Edit System IO option. The User System Input / Output Variable Manager window will appear.
    • Click the Add button and select the Type as String.
    • Give the variable a sensible name, e.g. TempLounge
    • The default value doesn't matter as logic will overwrite it as soon as it starts getting values, but you can use 0.0C here so that it shows something sensible at the start.
    Write logic code to update System IO String variable - PICED
    The code below will take the numerical value for temperature being broadcast from the temperature sensor and store it as text in the System IO variable, to 1 decimal place with the "C" suffix.

    • Click the Logic button on the PICED main window to load the logic editor.
    • Click the Stop button at the top of this window to stop the logic engine.
    • Select the Advanced node on the treeview and select the item called Global Variables
    • Add the following two variables to this section. The names don't matter, as long as they make sense to you, as we will use them in just a sec:
    Code:
    {Enter Variable definitions here}
    TempLounge : real;
    TempLoungeString : string;
    • Select the Initialisation node on the treeview and insert the following information:
    Code:
    TempLounge := 0;
    • Select the Modules node in the tree view on the left and click the Add New Module text or button
    • Give the module a sensible name like "Temperature".
    • Put the code below in the module.
    Code:
      if  GetBoolIBSystemIO("Measurement App Valid Value", "Wired Network", <Device ID>, 1) then
    begin
        TempLounge := GetRealIBSystemIO("Measurement App Real Value", "Wired Network", <Device ID>, 1);
        Format(TempLoungeString, TempLounge:0:1, 'C');
        SetStringSystemIO("TempLounge", TempLoungeString);
     end;
    • Make sure that the Global Variable and System IO variable names match the ones you've created earlier.
    • Replace <Device ID> in both places in the code above with the actual Device ID of the temperature sensor you wish to monitor.
    • Save and close the logic editor.
    Create the System IO Widget - PICED

    • Go back to the Widget Manager and add a new widget.
    • Set the Serivce to Logic
    • Set the Widget Type to User System IO String
    • Set the Location and Function group according to where and when you want them to appear in the Wiser UI
    • Set the System IO Variable to TempLounge
    • Give the Widget a label, such as "Lounge Room Temperature"
    It might take a minute or two after the Wiser project starts before this starts working, as the Wiser needs to see a valid broadcast from the temperature sensor before it can update the Widget, but that should be about it.
     
    Last edited by a moderator: Oct 25, 2011
    Newman, Oct 25, 2011
    #6
  7. techguy

    poldim

    Joined:
    Dec 7, 2010
    Messages:
    166
    Likes Received:
    2
    Location:
    San Francisco, CA
    Thanks Newman, I am going to order the measurements module and try this out... on second thought, I also have the outdoor light sensor unit, could I do the same thing with that to get a value displayed on the Wiser web UI?
     
    poldim, Oct 28, 2011
    #7
  8. techguy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Not quite sure which "measurements module" you're referring to. The above was written for a Temperature Sensor that can broadcast the temperature on the Measurement Application.

    The Light Level sensor does not support the measurement application. If it is more than a year or so old then the only way to get the light level from the unit is to use a Monitor, and the Wiser does not currently support Monitors. You would need to use another device, such as a PAC or Touchscreen, to get the light level out of the sensor and then re-transmit it in a form that the Wiser can use, such as a Light Level on the Measurement Application or the Level of a Group Address.

    If the light level sensor is fairly new (firmware 2.3.00+) then it can be configured to broadcast the light level as a level on a Group Address. You would then need to re-jig the logic above to get the level of that group, rather than the Measurement Application value.

    Provided either you've got another PICED-programmed unit on your network, or your Light Level sensor is new enough, you will be able to get the light level up on your Wiser UI. The age of the various bits of hardware you have will determine how much effort is required to get there.
     
    Last edited by a moderator: Oct 28, 2011
    Newman, Oct 28, 2011
    #8
  9. techguy

    poldim

    Joined:
    Dec 7, 2010
    Messages:
    166
    Likes Received:
    2
    Location:
    San Francisco, CA
    Newman, Thanks for all the info!

    I've made myself a small prototype board to get acquainted with the SE/Clipsal system. I currently have no plans to incorporate any standard PICED programmed screens. The only access will be through wall switches and the WebUI that will hopefully work off of tablets in a couple spots around the house. This currently sits on my LAN behind a set of Linksys routers (with which I'm still not having any luck getting the correct forwarding settings to get access to it from the WAN). The components attached to it are also below from the C-Bus Toolkit 1.11.4:
    [​IMG][​IMG]

    I've gone in and played around with the settings in the Light Sensor:
    [​IMG]

    But I'm not sure on the Piced/Wiser side to display this value.
     
    poldim, Oct 28, 2011
    #9
  10. techguy

    poldim

    Joined:
    Dec 7, 2010
    Messages:
    166
    Likes Received:
    2
    Location:
    San Francisco, CA
    So after 20 minutes of playing around, I figured out how to to show it in %.

    I have a PIR that I need to add to the prototype board. I need to learn how to do some coding so that the based on the light level sensor on being low enough, the PIR can dim up the lights to ~30% if it detects movement. This would be a nice feature of automatically ramping up the lights a bit if you walk out of a bedroom in the middle of the night.

    [​IMG]
     
    poldim, Oct 28, 2011
    #10
  11. techguy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Great that you've got the light level in percent being displayed. That means that you're able to get the light level form the sensor.

    To turn it from a group level to a meaningful number, you can follow most of the steps I outlined above. The primary change is to go through and replace all the references to the Measurement Application with the equivalent commands for the Lighitng Application. You can remove the check for a valid value as the group level will just report as zero until the Wiser sees the first command from the sensor. In the Logic Code you'll also need to change it to take the level of the group address and multiply it by 10 to give you the light level in Lux.

    A level of 18% corresponds with a level value of 46, so the light level at that time was most likely 460 Lux.
     
    Last edited by a moderator: Oct 29, 2011
    Newman, Oct 29, 2011
    #11
  12. techguy

    wappinghigh

    Joined:
    Dec 20, 2005
    Messages:
    198
    Likes Received:
    0
    Can't CIS just do a simple Wiser temp widget for us?

    Hi Mr Newman. Why don't you and the cbus lads just make this easy for all us users and write a simple temp monitor widget? A sort of cut down verison of the Tstat widget.

    At the moment I use these Tstat widgets to "monitor" a coupe of cbus temp sensors..it works, but the widget is ridiculously complex for what should really be a very simple display..

    Cheers :)
     
    wappinghigh, Nov 22, 2011
    #12
  13. techguy

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    Hi Wappinghigh.

    Do you really think that if it was as easy as you think it should be, that we wouldn't have done it already?

    Unfortunately there is a lot more to making these changes than just making the change. They need to be tested, and before we can even do anything, any changes need to be prioritised against all the other developments going on.

    Given that in this case, there is a workaround, this one just isn't a high priority.

    Nick
     
    NickD, Nov 22, 2011
    #13
  14. techguy

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    It is in our system as issue number 15439. It will get done in due course.
     
    Darren, Nov 22, 2011
    #14
  15. techguy

    wappinghigh

    Joined:
    Dec 20, 2005
    Messages:
    198
    Likes Received:
    0
    Thanks!

    Look forward to it

    Sorry I didn't realize it was so complicated....given that my temp readings already come up in the tstat widget..I just assumed it was simple code change or something to just blank out/remove the unnecessary fan/set point/on-off control of the tstat and just have the temp reading alone.....I mean geez, it was a fair enough assumption guys..:eek:
     
    wappinghigh, Nov 23, 2011
    #15
  16. techguy

    poldim

    Joined:
    Dec 7, 2010
    Messages:
    166
    Likes Received:
    2
    Location:
    San Francisco, CA
    Darren,

    Just out of curiosity, where does that place it on your list in terms of ho many other tickets do you have in higher priority over this one...?
     
    poldim, Nov 23, 2011
    #16
  17. techguy

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    We don't generally comment on development plans.
     
    Darren, Nov 23, 2011
    #17
  18. techguy

    paulwat

    Joined:
    Apr 30, 2009
    Messages:
    23
    Likes Received:
    0
    Location:
    Bristol, UK
    Hello all,

    I think I have followed the instructions outlined by Newman on how to display the temperature from a E5031RDTSLWE on Wiser.

    Which left me with the following code running as a logic module:-
    "
    if GetBoolIBSystemIO("Measurement App Valid Value", "Stoke Meadows", 55, 1) then
    begin
    SummerHouseTemp := GetRealIBSystemIO("Measurement App Real Value", "Stoke Meadows", 55, 1);
    Format(SummerHouseTempString, SummerHouseTemp:0:1, 'C');
    SetStringSystemIO("SummerHouseTemp", SummerHouseTempString);
    end;
    "
    My problem is that when i put this code on the Wiser the wiser appears to become unstable - the wifi connection keeps dropping to all clients and the iOS app for Wiser seems unresponsive with lights not responding to pressing icons.

    I thought the router and CNI portions were seperate and therefore wouldn't have expected it to behave in this way - I am very new to the idea of Logic code on Wiser so may have overlooked something when following Newmans instructions.

    Any help greatly appreciated as currently I have had to remove the logic in order to get stable iOS access to the lighting.

    Thanks

    Paul
     
    paulwat, Jun 16, 2012
    #18
  19. techguy

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Your logic code looks correct.

    I am not aware of any reason that this should affect stability, but it would need someone from the Wiser development team to comment.
     
    Darren, Jun 17, 2012
    #19
  20. techguy

    kjayakumar

    Joined:
    Oct 27, 2008
    Messages:
    448
    Likes Received:
    0
    I agree with Darren. The code looks syntactically correct. But I think what it is doing is continuously setting the SummerHouseTemp string. If I'm not mistaken, what would happen is that this string would be set every 100ms which means the Wiser would then have to send that string message to all clients over TCP/IP every 100ms. My guess is that might be what's causing the Wiser to appear to be unresponsive. I would add a check to only set the string if the value has changed, ie: something like if old_temp <> newTemp, then oldTemp := newTemp and only then SetStringSystemIO.
     
    kjayakumar, Jun 17, 2012
    #20
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.