Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. OpenHAB
  4. openHAB 2.0 binding

openHAB 2.0 binding

Scheduled Pinned Locked Moved OpenHAB
534 Posts 88 Posters 479.8k Views 99 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T TimO

    @mirko-ugolini The documentation on how to develop bindings for OH2 is rather thin. :(
    Starting point is here: https://github.com/openhab/openhab2/blob/master/docs/sources/development/ide.md

    From that point I've looked into the existing bindings and into the eclipse smarthome documentation, that does not work all the time, but the concepts match.

    If you would like to contribute to the MySensors binding I will gladly help you to find the entrance. :)

    @BenCranston I will have a look at it. Thanks for testing! The queue currently is rather basic (but should work). Maybe the data is written too fast to the serial output. I have a similar problem with OH 1.X and my rules, where I need to define a delay between commands.

    Something I plan to do, is adding the ACK functionality to the binding, so if no ACK is received the command is repeated for 5 times or so.

    S Offline
    S Offline
    SiLeX
    wrote on last edited by
    #87

    @TimO said:

    Something I plan to do, is adding the ACK functionality to the binding, so if no ACK is received the command is repeated for 5 times or so.

    +1 for the ack functionality. In my opinion this is a Transport-Layer functionality and should be built into the gateway (Arduino or whatever) itself. But the main developer doesn't like the idea because he is fearful that the serial buffer (or even an arduino queue system) will be unable queue enough messages while resends happen.

    On the other hand: we have plenty of RAM on our openhab hosts, so your idea seems like it will solve the problem completely, because we could even react on continous fails with putting the device offline (or whatever the openhab2 terms are for this) :grin:

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TimO
      Hero Member
      wrote on last edited by
      #88

      @BenCranston : I'm pretty sure now, OH2 is sending the data too fast, because if I use terminal emulation instead of hardware all three commands are transmitted.

      Just curious: are you using an ethernet or serial gateway?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TimO
        Hero Member
        wrote on last edited by
        #89

        I've added an option to influence the delay between messages send to gateway.

        Possible values are 1 to 1000 milliseconds.

        upload-0d7698f4-f0b0-4440-811b-0694740f9f9d

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kolaf
          Hero Member
          wrote on last edited by kolaf
          #90

          @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?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kolaf
            Hero Member
            wrote on last edited by
            #91

            Also, from where can we download the latest versions of your binding?

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kolaf
              Hero Member
              wrote on last edited by
              #92

              And finally, GREAT WORK :-)

              1 Reply Last reply
              0
              • T Offline
                T Offline
                TimO
                Hero Member
                wrote on last edited by
                #93

                @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!

                upload-fa96d617-5c91-4a7a-abc2-21c1a4457444

                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.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kolaf
                  Hero Member
                  wrote on last edited by
                  #94

                  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)
                  
                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    TimO
                    Hero Member
                    wrote on last edited by
                    #95

                    @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

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      kolaf
                      Hero Member
                      wrote on last edited by
                      #96

                      Thanks, it seems that that was the problem.

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        gonzalonal
                        wrote on last edited by gonzalonal
                        #97

                        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.

                        1 Reply Last reply
                        0
                        • dakkyD Offline
                          dakkyD Offline
                          dakky
                          wrote on last edited by
                          #98

                          kewl, thank 4 digging this up. I'm just evaluating openHab2 :D

                          Controller: Raspberry Pi 2 :: Openhab2 :: with @TimO MySensors Binding
                          Gateway: Arduino MEGA 2560 R3 :: W5100 :: Ethernet GW

                          Software: MySensors 2.0development

                          1 Reply Last reply
                          0
                          • O Offline
                            O Offline
                            ofverstedt
                            wrote on last edited by
                            #99

                            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

                            1 Reply Last reply
                            0
                            • T Offline
                              T Offline
                              TimO
                              Hero Member
                              wrote on last edited by
                              #100

                              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.

                              1 Reply Last reply
                              1
                              • G Offline
                                G Offline
                                gonzalonal
                                wrote on last edited by
                                #101

                                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.

                                1 Reply Last reply
                                0
                                • T Offline
                                  T Offline
                                  TimO
                                  Hero Member
                                  wrote on last edited by
                                  #102

                                  Hi @gonzalonal !

                                  I'm working on it. Due to the changes in the OH git repository my environment is all messed up. :-(

                                  1 Reply Last reply
                                  0
                                  • andreacioniA Offline
                                    andreacioniA Offline
                                    andreacioni
                                    wrote on last edited by andreacioni
                                    #103

                                    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

                                    G T 2 Replies Last reply
                                    0
                                    • andreacioniA andreacioni

                                      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

                                      G Offline
                                      G Offline
                                      gonzalonal
                                      wrote on last edited by
                                      #104

                                      @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 work

                                      Remember to copy your serial thing to things folder.
                                      Regards!
                                      Gonzalo

                                      1 Reply Last reply
                                      0
                                      • andreacioniA andreacioni

                                        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

                                        T Offline
                                        T Offline
                                        TimO
                                        Hero Member
                                        wrote on last edited by
                                        #105

                                        @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! :-)

                                        andreacioniA 1 Reply Last reply
                                        0
                                        • T TimO

                                          @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! :-)

                                          andreacioniA Offline
                                          andreacioniA Offline
                                          andreacioni
                                          wrote on last edited by andreacioni
                                          #106

                                          @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!!

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          15

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular