Boolean Status Wiser2

Discussion in 'C-Bus Wiser 2 Controller' started by breadknife, Nov 8, 2016.

  1. breadknife

    breadknife

    Joined:
    Apr 16, 2015
    Messages:
    19
    Likes Received:
    0
    Location:
    Western Australia
    Hi Guys,
    having read the forums, garage door status has been covered before however i'm unable to find the solution to my problem regarding the Wiser2.
    I have installed a reed switch on my garage door to indicate closed and wired this back to a 4 input bus coupler.

    Through PICED i wanted to simply indicate the door position, door fully down would be closed and anything else would indicate open.
    I am able to indicate 0% when door is down and then 100% when door moves away from reed switch using the lighting status widget, what i would prefer is a simple open or closed text to display on the Wiser2 app.

    I have tried the 2 state enable widget and the system IO Boolean, however these are both buttons which i don't want to be able to change state from the WISER2 app.

    I started heading down the track of using either 2 state enable or IO Boolean widget with some logic to write status back to original state if the change originated from the Wiser2
    (and allowing the change if it originated from the bus coupler), but i thought there must be an easier way to read a boolean state on the Wiser2 app.

    Any help would be appreciated, i am possibly missing something obvious here! :confused: as it's reasonably straight forward to indicate temperature via the app.
    Cheers
     
    breadknife, Nov 8, 2016
    #1
  2. breadknife

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,420
    Likes Received:
    62
    Location:
    Adelaide
    If you're happy using logic, maybe just use a String System IO and change the string between "Open" and "Closed" based on the state?

    Nick
     
    NickD, Nov 8, 2016
    #2
  3. breadknife

    breadknife

    Joined:
    Apr 16, 2015
    Messages:
    19
    Likes Received:
    0
    Location:
    Western Australia
    Thanks NickD for pushing me in the right direction!
    I guess the logic thing daunted me! I wrote the below code and all seems sweet! :D
    Please let me know if you see any improvements in my code, I included the 1 second delay as i think the scan of the wiser is 200ms. I could possibly increase this a little if needed. I assume the wiser wouldn't be too stressed executing this code every second.
    Think i need to include an initialisation statement as it reads 'null' after a project transfer.

    Thanks again.


    {Garage Door Status}

    once (GetLightingState("Garage Door Status") = ON) then
    begin
    SetStringSystemIO("Garage Door Status", 'Open');
    end;

    once (GetLightingState("Garage Door Status") = OFF) then
    begin
    SetStringSystemIO("Garage Door Status", 'Closed');
    end;

    delay("00:00:01");
     
    breadknife, Nov 8, 2016
    #3
  4. breadknife

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,420
    Likes Received:
    62
    Location:
    Adelaide
    Looks fine.

    The delay is probably not necessary, since the "once" statement only executes once, and even then only when the test condition changes from false to true.

    As for the initialisation.. initialising the string is one thing but there is also the problem of the state of the bus coupler input.. I *think* the bus coupler has an option to broadcast its state on powerup, but the Wiser may not see this and will not know the state until the door state actually changes.

    If you can find an unused logic channel in an output unit, assigning the same group to that will make the output unit report the state in the MMI (status report) and this will get picked up by the Wiser and give you the correct state.

    Nick
     
    NickD, Nov 8, 2016
    #4
  5. breadknife

    breadknife

    Joined:
    Apr 16, 2015
    Messages:
    19
    Likes Received:
    0
    Location:
    Western Australia
    Yes ofcourse!

    You are correct, the bus coupler does have the option to broadcast its state on powerup (which i have selected), which i think will be sufficient, the 'Null' was being displayed after a project transfer.

    Nice trick!


    Thanks for your help Nick, much appreciated. :)

    I've also for a bit of fun, have now changed the eDLT display background colour so at least if i'm sitting on the couch i will know if i've left the garage door open!
    Cheers
     
    Last edited by a moderator: Nov 8, 2016
    breadknife, Nov 8, 2016
    #5
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.