Doorbell Function

Discussion in 'Pascal Logic Code Examples' started by Damaxx, May 6, 2016.

  1. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    I have finally got around to installing my Ness Smartbell and configuring it to message C-Bus Matrix to trigger the doorbell sound over the MRA speakers.

    As the Matrix doorbell function still has some issues , I decided to make up my own little doorbell Logic/Scene to alert the house that someone is at the door. In the kitchen I have installed an Android touchscreen that is connected as a MRA source that also rings with the Ness Smartbell app.

    Started off with a few variables capture the current MRA Zone source and volumes to return them back to after the doorbell function was finished
    Code:
    {Variables for Doorbell Function}
    Ensuite_Source : integer;
    Workshop_Source : integer;
    Studio_Source : integer;
    Kitchen_Source : integer;
    
    Ensuite_Volume : integer;
    Workshop_Volume : integer;
    Studio_Volume : integer;
    Kitchen_Volume : integer;
    Then created the module to capture the status of the various speaker locations along with a couple of scenes to tie it all together
    Code:
    {Once the doorbell has been pressed}
    once (GetCBusState("WiredHouse", "Trigger Control", "Front Doorbell") = ON) then
    begin
    {Capture MRA Zone Sources}
    Ensuite_Source := GetCbusLevel("WiredHouse", "Lighting", "Ensuite Absolute Source");
    Kitchen_Source := GetCbusLevel("WiredHouse", "Lighting", "Kitchen Absolute") ;
    Studio_Source  := GetCbusLevel("WiredHouse", "Lighting", "Studio Absolute")   ;
    Workshop_Source  := GetCbusLevel("WiredHouse", "Lighting", "Workshop Absolute Source");
    
    {Capture MRA Zone Volumes}
    Ensuite_Volume := GetCbusLevel("WiredHouse", "Lighting", "Ensuite Volume");
    Kitchen_Volume := GetCbusLevel("WiredHouse", "Lighting", "Kitchen Volume") ;
    Studio_Volume  := GetCbusLevel("WiredHouse", "Lighting", "Studio Volume")   ;
    Workshop_Volume  := GetCbusLevel("WiredHouse", "Lighting", "Workshop Volume");
    
    {Set Volumes to Zero}
    SetScene("AmpOffDoorbell");
    Delay(3);
    
    {Set Volume on the 4 zones to 40% over 8 Seconds and set to touchscreen souce}
    SetScene("Doorbell");
    
    {Wait for doorbell to be answered or timeout}
    Delay(60);
    {Return Zones back to where they were}
    
    SetLightingLevel("Ensuite Absolute Source", Ensuite_Source, "0s");
    SetLightingLevel("Kitchen Absolute", Kitchen_Source, "0s");
    SetLightingLevel("Studio Absolute", Studio_Source, "0s");
    SetLightingLevel("Workshop Absolute Source", Workshop_Source, "0s");
    
    
    SetLightingLevel("Ensuite Volume", Ensuite_Volume, "8s");
    SetLightingLevel("Kitchen Volume", Kitchen_Volume, "8s");
    SetLightingLevel("Studio Volume", Studio_Volume, "8s");
    SetLightingLevel("Workshop Volume", Workshop_Volume, "8s");
                                  
    end;
    The first scene sets these zones volume to off, then changes the source to the kitchen touchscreen, then ramps the volume to 40% over 8 seconds.

    After a minute, it returns the various zones back to their previous source and volume settings.

    Heavy and convoluted, but think it should work well.

    Going to test it out tonight. :D
     
    Damaxx, May 6, 2016
    #1
  2. Damaxx

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,151
    Likes Received:
    17
    Can you explain how you got the smartbell to integrate with C-Bus. I have not used one yet, but have had a quick look at it in the past and did not think it would integrate with anything - obviously I was wrong if you have it working.

    Mick
     
    znelbok, May 10, 2016
    #2
  3. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    Hey Mick - This is my setup

    • Smartbell to sends a simple ASCII message configured in the 'Front Door Visitor Calling' section of the eGateway.
    • On the other end, I have the raspberry pi that is running C-Gate and NodeJS to listen for the message.
    • When it receives the message it sends a command to the NodeJS/C-Bus interface.

    Unfortunately the smartbell cannot parse messages with either ':' or '.' in them, otherwise I would have done it directly.

    From the experience I have had with Ness so far, I don't believe the smartbell is a real good product (one RMA for the eGateway already) and unless you are installing the M1 as well, the interfacing becomes very convoluted as you can see above.
     
    Last edited by a moderator: May 10, 2016
    Damaxx, May 10, 2016
    #3
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.