openHAB 2.0 binding
-
@TimO Would it be too much trouble for you to implement support for S_MULTIMETER? It seems that this is required for me to get the voltage reading from my battery driven sensors. Alternatively, is there anything you can do with the battery percentage that is sent using sendBatteryPercent? I don't know if OH2 has any notion of the sensors battery level?
I notice you have support for the type S_VOLTAGE, but I cannot find that this is present in the master branch of MySensors?
-
Also, from where can we download the latest versions of your binding?
-
And finally, GREAT WORK :-)
-
@kolaf Thank you! :)
I update the download in the first post here, whenever I upload a new version.
Newest update 1 minute ago: Implementation of S_MULTIMETER!
Please let me know if this works for you.
I'm planning to add a battery channel for every sensor. So if a sensor is added via UI, you are able to select/deselect a channel you don't need it. In *.items you are free to define the channel too.
-
Thanks, that was quick. However, something is not right:
2015-11-23 17:47:17 [DEBUG] [i.DiscoveryServiceRegistryImpl:333 ] - Triggering scan for thing types '[mysensors:humidity, mysensors:temperature, mysensors:light, mysensors:multimeter, mysensors:power, mysensors:baro, mysensors:door, mysensors:motion, mysensors:smoke, mysensors:dimmer, mysensors:cover, mysensors:wind, mysensors:rain, mysensors:uv, mysensors:weight, mysensors:distance, mysensors:light-level]' on 'MySensorsDiscoveryService'... 2015-11-23 17:47:17 [ERROR] [i.DiscoveryServiceRegistryImpl:339 ] - Cannot trigger scan for thing types '[mysensors:humidity, mysensors:temperature, mysensors:light, mysensors:multimeter, mysensors:power, mysensors:baro, mysensors:door, mysensors:motion, mysensors:smoke, mysensors:dimmer, mysensors:cover, mysensors:wind, mysensors:rain, mysensors:uv, mysensors:weight, mysensors:distance, mysensors:light-level]' on 'MySensorsDiscoveryService'!java.lang.NullPointerException: null at org.openhab.binding.mysensors.service.DiscoveryThread.stop(DiscoveryThread.java:23) at org.openhab.binding.mysensors.discovery.MySensorsDiscoveryService.stopScan(MySensorsDiscoveryService.java:63) at org.eclipse.smarthome.config.discovery.AbstractDiscoveryService.startScan(AbstractDiscoveryService.java:173) at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.startScan(DiscoveryServiceRegistryImpl.java:336) at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.startScans(DiscoveryServiceRegistryImpl.java:321) at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.startScan(DiscoveryServiceRegistryImpl.java:172) at org.eclipse.smarthome.io.rest.core.discovery.DiscoveryResource.scan(DiscoveryResource.java:64) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) -
@kolaf: Interesting. I'm not able to reproduce the error. Did you clean the userdata directory? OH2 gets stuck, when the xml-Definition changes, because it uses some sort of cache.
Because it is somewhat annoying to start from the scratch after deleting userdata, I define fixed things (like the gateway) in the *.things file.
https://github.com/wishmoooop/openhab2/tree/master/addons/binding/org.openhab.binding.mysensors
-
Thanks, it seems that that was the problem.
-
Hi everyone. Just to let you know OpenHAB 2.0.0 first BETA release is available. Unfortunatelly Tim0's binding is throwing some errors while OpenHAB tryes to install it.
2016-01-13 13:46:25.314 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/home/pi/OpenHAB2/Downloads/OpenHAB-Beta/addons/org.openhab.binding.mysensors-2.0.0-SNAPSHOT.jar org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mysensors [166] Unresolved requirement: Import-Package: gnu.io at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:] at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1245)[8:org.apache.felix.fileinstall:3.5.0] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1217)[8:org.apache.felix.fileinstall:3.5.0] at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:509)[8:org.apache.felix.fileinstall:3.5.0] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358)[8:org.apache.felix.fileinstall:3.5.0] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310)[8:org.apache.felix.fileinstall:3.5.0]Let me know Tim0 if I can help you fix this.
Thanks, regards.
Gonzalo. -
Hi Timo,
Regarding the errors in OH2beta, see this post for a possible solution.
Some other questions:
Is it possible to access sensors with different "V_types" for example V_VAR1 to a temperature sensor? I would like to send out numbers to my sensor nodes from rules.I was not able to get the battery level to work.
my item looks like this:Number SHBat "Storehouse Node Battery Level [%f %%]" (nSH,gBAT) { channel="mysensors:temperature:gateway:SHtemp_in:battery" }What is wrong?
Thank you for a great work!
/Tomas
-
Hi Tomas!
Thanks for the hint, I will take a closer look!
@ofverstedt said:
I would like to send out numbers to my sensor nodes from rules.
This is currently not possible, but it will be. It is on my ToDo list. :-)
The current solution with the serial binding in OH 1.X is complicated, but leaves a lot of freedom for the user and I would like to preserve as much freedom as possible.I've implemented some new features a while ago, like resending of messages if no ACK is received. But the Repo is out of date. I will fix that.
-
Hi Tim0.
Really nice work with this binding. Huge step forward into a official MySensors OpenHAB binding.It would be nice to have the repo updated so as to try the new features you have implemented.
Have you had time to check why we are gewtting that error at OpenHAB 2 Beta while trying to install the binding?
Let me know if there is any way in which I can help.
Thanks, regards!Gonzalo.
-
Hi @gonzalonal !
I'm working on it. Due to the changes in the OH git repository my environment is all messed up. :-(
-
This kind of problem (as I've read online) in this release of OH seems to be not only related to this binding. One suggestion that I found is here: https://github.com/openhab/openhab-distro/issues/82 (last comment) or here: https://github.com/openhab/openhab-distro/issues/81
I've tested it without success but I don't know if I've done it right. I've also try to build myself a rfxcom binding (this one use gnu.io) and it has the same issue
hope this help
EDIT: this work for me, run on OSGI console: feature:install openhab-transport-serial and restart OH
-
This kind of problem (as I've read online) in this release of OH seems to be not only related to this binding. One suggestion that I found is here: https://github.com/openhab/openhab-distro/issues/82 (last comment) or here: https://github.com/openhab/openhab-distro/issues/81
I've tested it without success but I don't know if I've done it right. I've also try to build myself a rfxcom binding (this one use gnu.io) and it has the same issue
hope this help
EDIT: this work for me, run on OSGI console: feature:install openhab-transport-serial and restart OH
@andreacioni said:
This kind of problem (as I've read online) in this release of OH seems to be not only related to this binding. One suggestion that I found is here: https://github.com/openhab/openhab-distro/issues/82 (last comment) or here: https://github.com/openhab/openhab-distro/issues/81
I've tested it without success but I don't know if I've done it right. I've also try to build myself a rfxcom binding (this one use gnu.io) and it has the same issue
hope this help
EDIT: this work for me, run on OSGI console: feature:install openhab-transport-serial and restart OH
Hi @andreacioni.
You saved the day. It worked for me.
Here the steps I did to make it work.1- Download latest snapshot from https://openhab.ci.cloudbees.com/job/openHAB-Distribution/ (Download offline version)
2- Unzip the file.
3- Run start_debug.sh
4- In console write "feature:install openhab-runtime-compat1x"
5- Ctrl-D to exit/shutdown OpenHAB
6- Once exited, copy MySensors binding to addons folder.
7- Start againg OpenHAB-
8- Thats it. It should workRemember to copy your serial thing to things folder.
Regards!
Gonzalo -
This kind of problem (as I've read online) in this release of OH seems to be not only related to this binding. One suggestion that I found is here: https://github.com/openhab/openhab-distro/issues/82 (last comment) or here: https://github.com/openhab/openhab-distro/issues/81
I've tested it without success but I don't know if I've done it right. I've also try to build myself a rfxcom binding (this one use gnu.io) and it has the same issue
hope this help
EDIT: this work for me, run on OSGI console: feature:install openhab-transport-serial and restart OH
@andreacioni: Absolultly amazing! Thanks!
I don't understand why this helps though because the changes in the code I have to do have nothing to do with OH1 (compability).
I hope to provide an adjusted version today or tomorrow along with a clean and working repository.
Thanks for your patience! :-)
-
@andreacioni: Absolultly amazing! Thanks!
I don't understand why this helps though because the changes in the code I have to do have nothing to do with OH1 (compability).
I hope to provide an adjusted version today or tomorrow along with a clean and working repository.
Thanks for your patience! :-)
@TimO I'think the OH1 compatibility is not the problem. It seems that OH2 beta1 have not installed transport feature and so it has no definition for the gno.io pakage, so I'think there's nothing to do on your code :D
PS tell me when the new repo is OK that I download it and try to add the baudrate config ;) Thanks!!
-
So, I would like to show you my current status. I've tested it against my mini MySensors environment and it looks good so far. Feel free to test.
-
Download latest snapshot from cloudbees: https://openhab.ci.cloudbees.com/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-offline/target/openhab-offline-2.0.0-SNAPSHOT.zip
-
Unzip file (into a directory like oh2).
-
Download the current binding from Binding and place it in the addons directory under oh2.
-
Configure addons, things, items and sitemap. Example?! addons.cfg, demo.things , demo.items, demo.sitemap
-
Start "start_debug.sh", "start_debug.bat" ...
-
In the karaf console enter: "feature:install openhab-transport-serial".
-
MySensors Plugin "should" start. ;-)
8: "log:set debug" + "log:tail" to see debug output.
Github and documentation will follow, please refer to the "old" Readme and the examples.
-
-
So, I would like to show you my current status. I've tested it against my mini MySensors environment and it looks good so far. Feel free to test.
-
Download latest snapshot from cloudbees: https://openhab.ci.cloudbees.com/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-offline/target/openhab-offline-2.0.0-SNAPSHOT.zip
-
Unzip file (into a directory like oh2).
-
Download the current binding from Binding and place it in the addons directory under oh2.
-
Configure addons, things, items and sitemap. Example?! addons.cfg, demo.things , demo.items, demo.sitemap
-
Start "start_debug.sh", "start_debug.bat" ...
-
In the karaf console enter: "feature:install openhab-transport-serial".
-
MySensors Plugin "should" start. ;-)
8: "log:set debug" + "log:tail" to see debug output.
Github and documentation will follow, please refer to the "old" Readme and the examples.
@TimO Hi Tim, for debugging outupt of the binding I need to write:
log:set DEBUG org.openhab.binding.mysensors, without this I cannot see anything about binding logs -
-
@TimO Hi Tim, for debugging outupt of the binding I need to write:
log:set DEBUG org.openhab.binding.mysensors, without this I cannot see anything about binding logs@andreacioni Hi andreacioni. Same issue with debug mode with me. Thanks for the tip!
@TimO: V_STOP for Rollershutter sensors, is a MySensors binding limitation, or it is not implemented in OH2 yet?
Another thing I've noticed is that every item added, despite being a regular switch or a rollershutter, is is being added as:
Battery Level
mysensors:cover:gateway:Cover_1_0:battery
MySensors Battery ChannelIs this the intended behavior for every node of my sensor, despite having or not a battery?
Regards.
Gonzalo.