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="127.0.0.1", tcpPort=5003, sendDelay=100, networkSanCheckEnabled=true ] {
Thing gasMeter Meter_Gas [ nodeId=100, childId=1 ] {
Channels:
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 100But 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.2How can I specifythe channels correctly in the things and items file? Would it be better to use seperate child Ids instead of channels?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login