C-Bus Module group status

Discussion in 'C-Bus Serial Protocols' started by KevinH, Oct 3, 2011.

  1. KevinH

    KevinH

    Joined:
    Aug 3, 2004
    Messages:
    171
    Likes Received:
    0
    Location:
    Yorkshire. UK
    I'm using the C-Bus module code with great success but I have a rather basic question as I can't just see how to get at the information from the inbuilt database. (Level 4). I know this isn't formally supported code but I'm hoping someone can help..

    How do I get the group status (on/off/absent/error) - as reported by the status MMI) ?

    1) I want to know if a group exists , in the sense that it is present in an output unit on C-Bus and hence participates in MMI.

    2) I'd also like to know if the group 'exists' in a phantom sense i.e it has been set to a level by some command that was transmitted on C-Bus and therefore has a valid level although MMI's will not reflect that. The module certainly raises events for level changes on phantom groups - and immediately after reports the correct level using cbus_lighting_if_get_level but I am not sure if subsequent level MMI's might purge this ?

    At the moment the database returns a level for every group which is 0 even if the group is absent / unknown. An error isn't raised if you have all 256 groups present for an application. There doesn't seem to be an API call to easily get this information and yet I'm sure it must maintained in the database.

    Maybe I have to have my own supplementary state table - but I still need to get at the status MMI response. I know I can do a discovery and extract groups in output units that way but that takes a while to run at startup and the info is all available via a status MMI instantly.

    Go on ... tell me what I'm missing...

    Kevin

    [edit] At the moment I've patched within vf_extract_status_MMI_data to get me the MMI info and I've added a couple of bit fields to the database to hold phantom/present group status - and a call to set the phantom bit based on a lighting event handler change event for an absent group. I guess my need for this is not typical but I was kinda surprised it wasn't there. I was trying to avoid patching the code so any updates would be easier to apply.

    BTW Should such Q's be in this forum , 'Enabled' , direct email - or .... not at all / unsupported ;-)
     
    Last edited by a moderator: Oct 3, 2011
    KevinH, Oct 3, 2011
    #1
  2. KevinH

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    You generally do that using the discovery functions. This tells you the groups that are present in an application (or more depending on how you set up what you want discovered).

    Also, though, in general you don't care about groups that are not present :)

    If you've made some changes and they do what you want then I'd suggest you stick with them. But you might want to consider looking at discovery as well.

    Just remember that discovery should really be a one-off thing used at (say) power up time to find whats there, a bit like priming the pump.
     
    ashleigh, Oct 3, 2011
    #2
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.