Need help with MeSensors library sub-type values



  • Hi All,

    im a new to mysensors library but want to learn it. I found in documentation that (as example) Motion sensor can use 2 types of values.
    S_MOTION 1 Motion sensors V_TRIPPED, V_ARMED

    So my question is: how sub-type V_ARMED can be used? via incomingMessageCallback ? Can this value be send from Controller to sensor to pass/disable Tripped checks?

    I saw many screenshots with Motion (Vera controller) sensor and all of them contains ARM and BYPASS buttons, but what the purpose of those buttons?
    Sorry for the newbie questions, but can someone explain this for me.
    Thanks


  • Plugin Developer

    @timota said:

    Hi All,

    im a new to mysensors library but want to learn it. I found in documentation that (as example) Motion sensor can use 2 types of values.
    S_MOTION 1 Motion sensors V_TRIPPED, V_ARMED

    So my question is: how sub-type V_ARMED can be used? via incomingMessageCallback ? Can this value be send from Controller to sensor to pass/disable Tripped checks?

    I saw many screenshots with Motion (Vera controller) sensor and all of them contains ARM and BYPASS buttons, but what the purpose of those buttons?
    Sorry for the newbie questions, but can someone explain this for me.
    Thanks

    @timota I do not know how vera controller works, But can answer how to use your incomingMessageCallback for different sensor variable types. Here is the example code.

    void incomingMessage(const MyMessage &message) {
        if (message.sensor == YOUR_SENSOR_ID) {
            if (message.type == V_TRIPPED) {
              //Do somthing here
            } else if (message.type == V_ARMED) {
              //Do somthing here
            }
        }
    }
    


  • @ jkandasa Many thanks for your answer.

    So this means that these 2 values can be simply send/receive from/to Controller and so can be processed on sensor side. Am right?



  • @timota

    Picture this scenario:

    You have an alarm system for you house based on MySensors.

    You have sensors to detect if the door and windows are open. Once they are open you trigger some kind of alarm if the system is not turned off.

    Also you might want to be able to open the windows or door and have the alarm off.

    The V_TRIPPED would detect if the door or windowsa are opened and the V_ARMED would control if the alarm is on or off.

    So ye, the V_ARMED would be turned on and off via incoming message and you would find out if you need to trigger the alarm by looking t both variables.

    As for implementation examples you have plenty under /libraries/MySensors/Examples.

    There is also one example wich has fake implementations of almost all sensors . This was designed to help developers test or implement controllers but it has also been a nice learning exercise.

    Cheers



  • yes. that's it what i want to know.
    Thanks.


Log in to reply
 

Suggested Topics

  • 8
  • 3
  • 90
  • 1
  • 1
  • 1

10
Online

11.4k
Users

11.1k
Topics

112.7k
Posts