openHAB binding
-
Hi @bkl and all other user of this great binding!
I would like to know if its possible to send a message using this binding. I will try to explain my problem.
I've built the "EnergyMeterPulseSensor.ino" sensor and I have it up and running. The sketch request a starting number for the count loop and if the item in Openhab has been initialized this value is sent back per request.
This request function is only active before the actual count begins.I would now like to be able to reset the counter each midnight but as the sensor only requests the start count value at each startup I would have to manually restart the sensor at the same time as I have "reinitialized" the count item with a "0".
I now see two ways of doing this if this binding allows it:
-
1: Send a "I_REBOOT" in some way through the binding directly after manually updating the count item with a "0".
-
2: Sending a new count value via the V_VAR1 parameter. This would be preferable I guess.
In this thread @stoffej is after the same thing. I've tried the same approach using a
myPulsecountItem.sendCommand(0)but other than adding a "0" to the persistence service nothing happens. The count continues where it left off. So my guess is that there is no actual message sent to the sensor. Sadly I don't get any useful information from the debug-xml. I don't know where @stoffej got the debug messageI_LOG_MESSAGE:..., my serial debugging interface towards the gateway is occupied.My count item is defined as:
Number myElecVar "Elmätare pulser [%d]" {mysensors="50;1;V_VAR1"}I guess if I could utilize a switch item in some way I could send a message in the same way as in the relay implementation. For a switch I know that a message is being sent as I've built one of those myself but the switch can only send "on" or "off".
Here's the receive function from the sketch:
void receive(const MyMessage &message) { if (message.type==V_VAR1) { pulseCount = oldPulseCount = message.getLong(); Serial.print("Received last pulse count from gw:"); Serial.println(pulseCount); pcReceived = true; } }Assistance is much appreciated!
@NickBuilder
From what i know sendCommand should be the way to go.myElecVar.sendCommand(0);That should send the value to your sensor, and then update its value of pulseCount
-
-
I'm trying to get a single Dallas Temp sensor displayed in OpenHAB using the Serial Gateway. I'm running the MySensors v2 Dallas Temp sketch, and I'm seeing my sensor in the logs. However, I'm getting the following:
2016-09-28 07:34:21.805 [ERROR] [i.internal.GenericItemProvider] - Binding configuration of type 'mysensors' of item ?Temperature? could not be parsed correctly. java.lang.NullPointerException: null at java.util.regex.Matcher.getTextLength(Matcher.java:1234) ~[na:1.7.0_101] at java.util.regex.Matcher.reset(Matcher.java:308) ~[na:1.7.0_101] at java.util.regex.Matcher.<init>(Matcher.java:228) ~[na:1.7.0_101] at java.util.regex.Pattern.matcher(Pattern.java:1088) ~[na:1.7.0_101] at org.openhab.binding.mysensors.internal.MySensorsGenericBindingProvider.validateItemType(MySensorsGenericBindingProvider.java:57) ~[na:na] at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:347) [org.openhab.model.item_1.8.3.jar:na] at org.openhab.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:324) [org.openhab.model.item_1.8.3.jar:na] at org.openhab.model.item.internal.GenericItemProvider.processBindingConfigsFromModel(GenericItemProvider.java:171) [org.openhab.model.item_1.8.3.jar:na] at org.openhab.model.item.internal.GenericItemProvider.modelChanged(GenericItemProvider.java:390) [org.openhab.model.item_1.8.3.jar:na] at org.openhab.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:159) [org.openhab.model.core_1.8.3.jar:na] at org.openhab.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:100) [org.openhab.model.core_1.8.3.jar:na] at org.openhab.model.core.internal.folder.FolderObserver.checkFolder(FolderObserver.java:142) [org.openhab.model.core_1.8.3.jar:na] at org.openhab.model.core.internal.folder.FolderObserver.run(FolderObserver.java:99) [org.openhab.model.core_1.8.3.jar:na]My item definition looks like the following:
Number Temperature "Temp [%s °C]" <temperature> (gBio,gTemperature) {mysensors=105;1;V_TEMP}As a follow-on, I've been trying to understand the {mysensors=105;1;V_TEMP} binding and what the semicolon separated values represent. So far I've been following example code, and haven't found the right documentation. Can someone point me to the right place? I appreciate any help.
-
@NickBuilder
From what i know sendCommand should be the way to go.myElecVar.sendCommand(0);That should send the value to your sensor, and then update its value of pulseCount
@bkl
Ok. But for some reason the new value is not accepted in my case. I will try and see if the serial terminal, when connected to the sensor, will give a hint on what’s going on. It would be nice if the debug of the binding could show what is actually being sent to (and possibly through) the gateway. Is this possible already by ”activating” a certain debug.xml module?The serial binding is quite clear in this regard as the message with payload according to the mysensor protocol is displayed in the debug log.
-
@bkl First off I want to thank you for the MySensors openhab binding. It works wonderfully!
In the MySensors 2.0 there is an internal message that doesn't seem to be handled by the binding. I believe it needs to be handled in MySensorsBinding.java. I would do it myself but my knowledge of Java sucks....to put it lightly. The internal message is:
I_DISCOVER_RESPONSEso my openhab log keeps getting spammed with:
2016-10-21 22:16:21.653 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE" 2016-10-21 22:26:21.374 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE" 2016-10-21 22:36:22.127 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE" 2016-10-21 22:46:21.847 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE" 2016-10-21 22:56:21.569 [INFO ] [.b.m.internal.MySensorsBinding] - No item configured for "4;255;I_DISCOVER_RESPONSE"I'm assuming that we just need to add a line to:
public void incommingMessage(Message message)to handle it but I would rather let you do it since like I said....I suck with Java. Is that something that would be an easy fix?
-
Ethernet gw binding source seems to be missing in github repo.
Any clue?
Thanks
: Compilation failure:
[ERROR] /root/openhab/bundles/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/internal/MySensorsBinding.java:[17]
[ERROR] import org.openhab.binding.mysensors.internal.gateway.Ethernet;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import org.openhab.binding.mysensors.internal.gateway.Ethernet cannot be resolved
[ERROR] /root/openhab/bundles/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/internal/MySensorsBinding.java:[117]
[ERROR] gateway = new Ethernet(prop.getProperty("host"), Integer.parseInt(prop.getProperty("port", "5003")));
[ERROR] ^^^^^^^^
[ERROR] Ethernet cannot be resolved to a type
[ERROR] 2 problems (2 errors)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.openhab.binding.mysensors -
How do I add the "my-sensors" add on to openhab2.0. I openhab2 up and running based on their rasp-image. I have downloaded a couple other adds and install just fine. I don't know how to place the .jar file into the adds. Is there a clear guide on how to get this done ? PLS HELP!
-
@bkl Hi,
Use this biding from it`s beginning, many thanks again. Just want to know if there is any function like the "ack" as there is on OH2 binding, where gateway re-sends the msg 5 times if it does not hear from the sensor after a command. It´s a killer function to make it more reliable, but I´m not ready for OH2 yet.
Thanks
-
Hi,
after my openHAB system completely failed I had to re-install everying. I had MySensors configured the old way with a lot of rules with the serial binding I thought I give the binding a try.
In general it works but I have issues with S_COVER, not sure how to configure this.
But of course in openhab it is a single Rollershutter item... I think I could do a workaround in creating in total 4 items and only show my rollershutter and then have a rule and based on up/down/stop update the 3 items.Anyhow, seems to complex.
What is best practice here?
The sensor presents itself with this:
* Example item: 188;2;V_UP - Window covering. Up. * Example item: 188;2;V_DOWN - Window covering. Down. * Example item: 188;2;V_STOP - Window covering. Stop. * Example item: 188;2;V_PERCENTAGE - Percentage value. 0-100 (%) ``` -
Hi,
after my openHAB system completely failed I had to re-install everying. I had MySensors configured the old way with a lot of rules with the serial binding I thought I give the binding a try.
In general it works but I have issues with S_COVER, not sure how to configure this.
But of course in openhab it is a single Rollershutter item... I think I could do a workaround in creating in total 4 items and only show my rollershutter and then have a rule and based on up/down/stop update the 3 items.Anyhow, seems to complex.
What is best practice here?
The sensor presents itself with this:
* Example item: 188;2;V_UP - Window covering. Up. * Example item: 188;2;V_DOWN - Window covering. Down. * Example item: 188;2;V_STOP - Window covering. Stop. * Example item: 188;2;V_PERCENTAGE - Percentage value. 0-100 (%) ```I saw STOP in S_cover is not supported in OH2 - what about OH1? Anyone?
-
I saw STOP in S_cover is not supported in OH2 - what about OH1? Anyone?
@parachutesj According OH2: That was fixed a looooooong time ago. :D
Refer to: https://github.com/tobof/openhab2-addons/wiki/Examples for an example (cover).
-
@parachutesj According OH2: That was fixed a looooooong time ago. :D
Refer to: https://github.com/tobof/openhab2-addons/wiki/Examples for an example (cover).
@TimO thank you.
and what is with OH1? Not getting it to work.
Does not seem that STOP works, UP & DOWN and PERCENTAGE work -
@TimO thank you.
and what is with OH1? Not getting it to work.
Does not seem that STOP works, UP & DOWN and PERCENTAGE work@parachutesj I can't help you with this version of the binding, I've never used it.
-
@parachutesj I can't help you with this version of the binding, I've never used it.
@TimO Thanks anyway. I am slowly moving into the OH2 direction - still a lot of things to be clarified and configured
-
Hello guys, who can unpin this post?
It is terribly outdated.
The effort for an openhab-mysensors binding is still valid but several things changed on OpenHAB, making this a lot easier.
-
Hello guys, who can unpin this post?
It is terribly outdated.
The effort for an openhab-mysensors binding is still valid but several things changed on OpenHAB, making this a lot easier.
-
@guillermo-schimmel done. Is there some other post that should be pinned instead?
@mfalkvidd Thanks! Just give me a couple of days and I will try to make a new tutorial for mysensors+openhab.