Openhab thing/item for gas sensor

  • Dear Forum
    I would appreciate some pointers making a gas meter sensor working in openhab using a serial gateway. I used the water meter sketch and redefined S_WATER with S_GAS. The sensors shows up in openhab and reports data, but the data never gets stored as item.

    The Sensor sketch uses:
    #define CHILD_ID 1 // Id of the sensor child
    MyMessage flowMsg(CHILD_ID,V_FLOW);
    MyMessage volumeMsg(CHILD_ID,V_VOLUME);
    MyMessage lastCounterMsg(CHILD_ID,V_VAR1);

    things definition:
    Bridge mysensors:bridge-eth:mybridge [ ipAddress="", tcpPort=5003, sendDelay=100, networkSanCheckEnabled=true ] {
    Thing gasMeter Meter_Gas [ nodeId=100, childId=1 ] {
    Type number : volume []
    Type number : flow []
    Type number : var1 []

    items definition:
    Number Gas_Flow "GasFlow" <flow> (Gas) ["Meter"] {channel="mysensors:gasMeter:mybridge:Meter_Gas:flow"}
    Number Gas_Volume "GasVol" <volume> (Gas) ["Meter"] {channel="mysensors:gasMeter:mybridge:Meter_Gas:vol"

    openhab receives the messages and shows them in the gateway debug output:
    Message from gateway received: 100;1;1;0;24;36
    Node 100 found in gateway
    Child 1 found in node 100
    Message from gateway received: 100;1;1;0;35;0.360
    Node 100 found in gateway
    Child 1 found in node 100

    But the output of the other (working) sensors is then processed and stored:
    Updating channel: hum(V_HUM) value to: 49.2
    Humidity1 changed from 48.2 to 49.2

    How can I specifythe channels correctly in the things and items file? Would it be better to use seperate child Ids instead of channels?

  • just a small correction: it's a Raspberry Pi Gateway, but probably this makes no difference

Log in to reply

Suggested Topics