Reading Light Levels

Discussion in 'C-Bus Wired Hardware' started by more-solutions, Mar 1, 2011.

  1. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    I have a few light level sensors that I'm reading the light level from directly (looking at the unit params from an application communicating via CGate).

    What determines the frequency of update for this parameter? I can see it changing in the device status in Toolkit but I'm not getting values from it into my application anything like as often.
     
    more-solutions, Mar 1, 2011
    #1
  2. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    Playing with Toolkit it looks like I need to move from v1 firmware to later firmware which would allow me to set a group address to be updated at a frequency of my choosing, is that correct?

    If so, in order to justify the upgrade, can anyone tell me what determines the frequency of status updates in v1 firmware so that I have a quantifiable difference the client can relate to?

    Thanks
     
    more-solutions, Mar 1, 2011
    #2
  3. more-solutions

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    When the Toolkit UI for a Light Level Sensor is open it polls the unit for it's light level very frequently. This is to enable you, the programmer, to get a rapid response from the unit as to the current light level. This makes it easier to determine thresholds and the like but it does create quite a bit of network traffic and is not suitable to be left this way.

    V1 Light Level sensors don't have the ability to broadcast their light level as such. Applications such as HomeGate/Schedule+ and units such as Touchscreens/Wiser/PACA can poll the Light Level Sensor at a user-defined rate. This rate is usually configured in the Monitor Manager section of PICED.

    In general, polling things in C-Bus is not a good idea. It's better to have a device that broadcasts it's status when it either changes by a significant amount, and at some background rate to ensure things stay synchronised.

    Newer light level sensors, i.e. those that report as firmware 2.3.00 may look the same but they have a completely new guts compared to the older 1.00 units. They allow you to broadcast the current light level at regular intervals, anywhere from 10 seconds apart (a bit too close IMHO) up to 18+ hours apart (too far apart to be practical). A broadcast rate of every 1-2 minutes would be a good starting point. The light level of 0 - 2550 lux gets translated into an 0 - 255 level on the group address. For example, a level of 1280 lux would correspond with a level of 50%. You'll need to turn this back into a lux level yourself.
     
    Newman, Mar 1, 2011
    #3
  4. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    Thanks for the confirmation of this. We're seeing values at the moment at almost exactly 40min intervals. I have four sensors each on different networks, all reporting at roughly the same time, which were the units themselves controlling the interval seems a bit coincidental, so I assume this is controlled by C-Gate?

    Indeed. All I actually care about is the light level, and if it were to send updates when it changed that would be fine, but we don't even seem to be getting that; at this time of the (UK) year, evenings draw in pretty quickly, and a 40 minute update cycle means it's easily possible to go from daylight to dark within that time and not bring on lighting at the right level.

    I've played with the unit configuration but can't change that 40-min period, and can't see anything relevant in the C-Gate config either. There are occassional updates outside the 40-min cycle but very rare and they don't seem to have any obvious cause.

    That's just what I need. This is a large site, with several networks, and only 4 light level sensors, so replacing those four with new units reporting every minute is going to be a negligible cost and negligible additional network load, so I think we have our solution. If I had several dozen old units I might have been more interested in the protocol that Toolkit (and others) use to get the levels more frequently, though.
     
    more-solutions, Mar 2, 2011
    #4
  5. more-solutions

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    The update rate is usually defined by PICED/HomeGate/etc and not managed directly by C-Gate as such. If your install of C-Gate has only ever been used with Toolkit then it's possible that C-Gate uses some default/background rate but I'm pretty hazy on the specifics.
     
    Newman, Mar 2, 2011
    #5
  6. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    I've just bought and installed four new 5031PE's but they all have the same firmware (1.00) and as far as I can tell no new functionality?
     
    more-solutions, May 18, 2011
    #6
  7. more-solutions

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Correct.
     
    Newman, May 18, 2011
    #7
  8. more-solutions

    Alex

    Joined:
    Aug 3, 2004
    Messages:
    21
    Likes Received:
    0
    Location:
    Sydney
    If the site has a Windows server or PC running 24/7 you could leave C-gate running and write a simple Windows application or service that queries C-Gate at regular intervals to get the values. The C-Gate manual lists the command you need to send to C-Gate. I?ve used this method for a few years ? main problem is ensuring that everything keeps running.
     
    Alex, May 18, 2011
    #8
  9. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    Does this mean that the 2.x firmware is not actually available, or that I've just been shipped old devices and need to source newer ones?
     
    more-solutions, May 19, 2011
    #9
  10. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    This would be a solution for me, there is a server there. I'll go and explore the manuals, thanks.
     
    more-solutions, May 19, 2011
    #10
  11. more-solutions

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    They're very new. Sometimes it takes a while for stock to flush through the warehouses.
     
    Newman, May 20, 2011
    #11
  12. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    Ah, OK. I've ordered some with the new firmware.

    In the meantime, if I understand correctly I can get things working with the old sensors if I add some code to send a psync to the sensors every few minutes? (That's how I interpret the documentation, but I don't have any kit to test with until I go back to site.)
     
    more-solutions, May 21, 2011
    #12
  13. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    Now that I'm on-site I've been able to test this theory:
    do 254/p/100 psync
    .. does indeed cause the lux sensor at address 100 on network 254 to send it' current lux level.

    I'll have to see if I can cancel the order for the updated units!
     
    more-solutions, May 24, 2011
    #13
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.