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.6k 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 Offline
    T Offline
    TimO
    Hero Member
    wrote on last edited by
    #107

    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.

    1. 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

    2. Unzip file (into a directory like oh2).

    3. Download the current binding from Binding and place it in the addons directory under oh2.

    4. Configure addons, things, items and sitemap. Example?! addons.cfg, demo.things , demo.items, demo.sitemap

    5. Start "start_debug.sh", "start_debug.bat" ...

    6. In the karaf console enter: "feature:install openhab-transport-serial".

    7. 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.

    andreacioniA 1 Reply Last reply
    0
    • T TimO

      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.

      1. 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

      2. Unzip file (into a directory like oh2).

      3. Download the current binding from Binding and place it in the addons directory under oh2.

      4. Configure addons, things, items and sitemap. Example?! addons.cfg, demo.things , demo.items, demo.sitemap

      5. Start "start_debug.sh", "start_debug.bat" ...

      6. In the karaf console enter: "feature:install openhab-transport-serial".

      7. 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.

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

      @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

      G 1 Reply Last reply
      0
      • andreacioniA andreacioni

        @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

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

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

        Is this the intended behavior for every node of my sensor, despite having or not a battery?

        Regards.
        Gonzalo.

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

          @gonzalonal said:

          V_STOP for Rollershutter sensors, is a MySensors binding limitation, or it is not implemented in OH2 yet?

          It is a limitation of OH2 and I don't understand the limitation. It is very confusing, because with the "RollerShutter" widget in OH2 I get three buttons: UP, DOWN and STOP. UP and down calls the handler in which I generate the MySensors message. STOP don't call the handler and therefore I can't do anything. I need to dig deeper.

          Battery Level
          mysensors:cover:gateway:Cover_1_0:battery
          MySensors Battery Channel

          Is this the intended behavior for every node of my sensor, despite having or not a battery?

          This is intended behavior. The battery status is send via an internal message and there is no presentation if a sensor has a battery or not.
          I've therefore added the battery channel to every item. In Paper UI you are able to simply disable the channel by clicking the blue circle next to the battery channel or in the configuration file you have to specify the channel, if you want to use it. If the battery channel is not defined for a thing it won't receive the battery status.

          For the future: maybe there is a way to hide the channel as long as there was no battery status received and display it only when used. But currently I don't see an easy way to implement that.

          Greetings!
          Tim

          G 1 Reply Last reply
          0
          • T TimO

            @gonzalonal said:

            V_STOP for Rollershutter sensors, is a MySensors binding limitation, or it is not implemented in OH2 yet?

            It is a limitation of OH2 and I don't understand the limitation. It is very confusing, because with the "RollerShutter" widget in OH2 I get three buttons: UP, DOWN and STOP. UP and down calls the handler in which I generate the MySensors message. STOP don't call the handler and therefore I can't do anything. I need to dig deeper.

            Battery Level
            mysensors:cover:gateway:Cover_1_0:battery
            MySensors Battery Channel

            Is this the intended behavior for every node of my sensor, despite having or not a battery?

            This is intended behavior. The battery status is send via an internal message and there is no presentation if a sensor has a battery or not.
            I've therefore added the battery channel to every item. In Paper UI you are able to simply disable the channel by clicking the blue circle next to the battery channel or in the configuration file you have to specify the channel, if you want to use it. If the battery channel is not defined for a thing it won't receive the battery status.

            For the future: maybe there is a way to hide the channel as long as there was no battery status received and display it only when used. But currently I don't see an easy way to implement that.

            Greetings!
            Tim

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

            @TimO
            Great TimO. Thanks for clarifying this topic.
            Regards.
            Gonzalo

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

              @gonzalonal : I found a solution for V_STOP! It will be available soon.

              But more important: @andreacioni is doing some great work improving the stability and performance of the binding!!

              I just wanted to let you know, that the binding is currently under heavy development. :+1:

              G 1 Reply Last reply
              4
              • T TimO

                @gonzalonal : I found a solution for V_STOP! It will be available soon.

                But more important: @andreacioni is doing some great work improving the stability and performance of the binding!!

                I just wanted to let you know, that the binding is currently under heavy development. :+1:

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

                @TimO
                Great news TimO. Really nice to hear that.
                Regarding STOP functionality for the binding, I have read somewhere that the supported commands by OpenHAB, for RollerShutter items, are Up, Down and StopMove. Have yoy tried something like this?

                Regards
                Gonzalo.

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

                  @gonzalonal said:

                  Regarding STOP functionality for the binding, I have read somewhere that the supported commands by OpenHAB, for RollerShutter items, are Up, Down and StopMove. Have yoy tried something like this?

                  Yeah, my problem till yesterday was, that I was not able to cast the given state to StopMoveType in case of Stop, while casting the state to UpDownType for Up and Down was no problem. :-)

                  I changed the way how the binding handles this type of message and it works now.

                  S 1 Reply Last reply
                  0
                  • T TimO

                    @gonzalonal said:

                    Regarding STOP functionality for the binding, I have read somewhere that the supported commands by OpenHAB, for RollerShutter items, are Up, Down and StopMove. Have yoy tried something like this?

                    Yeah, my problem till yesterday was, that I was not able to cast the given state to StopMoveType in case of Stop, while casting the state to UpDownType for Up and Down was no problem. :-)

                    I changed the way how the binding handles this type of message and it works now.

                    S Offline
                    S Offline
                    Sebastián Zaffarano
                    wrote on last edited by
                    #115

                    @TimO
                    Can we clone the latest source code from this binding? I think that your github repository is outdated and I want to work this weekend with it, 'cause I would like to integrate the mysensors 2.0-beta "smartSleep" feature with your binding in my home sensors setup (ESP8266 Ethernet GW).

                    Also, if there are any ISSUE y your TODO list in which I can help you, please tell me.

                    Regards

                    andreacioniA 1 Reply Last reply
                    0
                    • S Sebastián Zaffarano

                      @TimO
                      Can we clone the latest source code from this binding? I think that your github repository is outdated and I want to work this weekend with it, 'cause I would like to integrate the mysensors 2.0-beta "smartSleep" feature with your binding in my home sensors setup (ESP8266 Ethernet GW).

                      Also, if there are any ISSUE y your TODO list in which I can help you, please tell me.

                      Regards

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

                      @Sebastián-Zaffarano

                      Hi Sebastián, what repository have you checked? Currently the development is not on the old https://github.com/wishmoooop/openhab2/tree/master/addons/binding/org.openhab.binding.mysensors but was moved here: https://github.com/tobof/openhab2-addons/tree/MySensors/addons/binding/org.openhab.binding.mysensors

                      Hope this help :)

                      S 1 Reply Last reply
                      0
                      • andreacioniA andreacioni

                        @Sebastián-Zaffarano

                        Hi Sebastián, what repository have you checked? Currently the development is not on the old https://github.com/wishmoooop/openhab2/tree/master/addons/binding/org.openhab.binding.mysensors but was moved here: https://github.com/tobof/openhab2-addons/tree/MySensors/addons/binding/org.openhab.binding.mysensors

                        Hope this help :)

                        S Offline
                        S Offline
                        Sebastián Zaffarano
                        wrote on last edited by
                        #117

                        @andreacioni said:

                        @Sebastián-Zaffarano

                        Hi Sebastián, what repository have you checked? Currently the development is not on the old https://github.com/wishmoooop/openhab2/tree/master/addons/binding/org.openhab.binding.mysensors but was moved here: https://github.com/tobof/openhab2-addons/tree/MySensors/addons/binding/org.openhab.binding.mysensors

                        Hope this help :)

                        Thanks @andreacioni
                        I was working on the old repo! :)

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

                          I've updated the first posting in this thread. You'll find the current repo there (also). ;-)

                          I've added a Wiki to the repo and made a brief description of the installation and configuration process.

                          https://github.com/tobof/openhab2-addons/wiki

                          The current binding (jar) is also in the repo now. You'll find the link in the wiki under "Installation".

                          Modifications in the current version:

                          • RollerShutter now supports STOP
                          • Performance of the binding improved. Big thanks to @andreacioni !!
                          • Stability improved. Also big thanks to @andreacioni
                          • Error handling on connection loss improved
                          • The baud rate of the serial gateway is now adjustable. (@andreacioni again!)
                          • some code cleanup: removed not needed debug output etc.

                          Please let me know if you found the time to test the binding and what the results are. :-)

                          S 1 Reply Last reply
                          1
                          • T TimO

                            I've updated the first posting in this thread. You'll find the current repo there (also). ;-)

                            I've added a Wiki to the repo and made a brief description of the installation and configuration process.

                            https://github.com/tobof/openhab2-addons/wiki

                            The current binding (jar) is also in the repo now. You'll find the link in the wiki under "Installation".

                            Modifications in the current version:

                            • RollerShutter now supports STOP
                            • Performance of the binding improved. Big thanks to @andreacioni !!
                            • Stability improved. Also big thanks to @andreacioni
                            • Error handling on connection loss improved
                            • The baud rate of the serial gateway is now adjustable. (@andreacioni again!)
                            • some code cleanup: removed not needed debug output etc.

                            Please let me know if you found the time to test the binding and what the results are. :-)

                            S Offline
                            S Offline
                            Sebastián Zaffarano
                            wrote on last edited by
                            #119

                            @TimO said:

                            I've updated the first posting in this thread. You'll find the current repo there (also). ;-)

                            I've added a Wiki to the repo and made a brief description of the installation and configuration process.

                            https://github.com/tobof/openhab2-addons/wiki

                            The current binding (jar) is also in the repo now. You'll find the link in the wiki under "Installation".

                            Modifications in the current version:

                            • RollerShutter now supports STOP
                            • Performance of the binding improved. Big thanks to @andreacioni !!
                            • Stability improved. Also big thanks to @andreacioni
                            • Error handling on connection loss improved
                            • The baud rate of the serial gateway is now adjustable. (@andreacioni again!)
                            • some code cleanup: removed not needed debug output etc.

                            Please let me know if you found the time to test the binding and what the results are. :-)

                            Thank you @TimO !
                            This weekend I started migrating from my OH1.8 + mqtt GW setup to OH 2 beta + your binding. At the moment all is working fine, I spent some time learning about OH2 / Eclipse smartHome and watching your code, because I want to implement the smartSleep feature (https://github.com/mysensors/Arduino/pull/271) in the mysensors binding.

                            My idea is: when the handler don't receive an ACK from a message, it store the message for a while, waiting a heartbeat from a node, and, if the binding has some message stored for this node, then send it again. I don't know if this is correct, or if you thinks there is a better solution.

                            Regards

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

                              @Sebastián-Zaffarano said:

                              This weekend I started migrating from my OH1.8 + mqtt GW setup to OH 2 beta + your binding. At the moment all is working fine, I spent some time learning about OH2 / Eclipse smartHome and watching your code, because I want to implement the smartSleep feature (https://github.com/mysensors/Arduino/pull/271) in the mysensors binding.

                              My idea is: when the handler don't receive an ACK from a message, it store the message for a while, waiting a heartbeat from a node, and, if the binding has some message stored for this node, then send it again. I don't know if this is correct, or if you thinks there is a better solution.

                              That sounds like a good plan. The binding already uses a queue where messages that should be send are buffered and you are able to specify how long a message is hold in the queue (when it is time to send again).

                              I've already implemented a mechanism to request for an ACK message. This mechanism sends a message to the node, but holds this message in the queue and increments the number of retries (currently 4 retries, with different/longer delays). If the node responds with an ACK or the number of retries exceeds 4 the message is removed from queue. So you could indicate, with a configuration setting, that the node is an smartSleep node and thus only send the message once and if no ACK is received store the message for 10 minutes (for example) in the queue.

                              Here is the implementation: https://github.com/tobof/openhab2-addons/blob/MySensors/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/protocol/MySensorsWriter.java

                              BUT: The reader and the writer are working in different threads (asynchronus), so we have to sync the threads (the queue), if we receive an ACK and remove a message from the queue. I'm still struggling with that and that is the reason why the request for ACK should not be used at the moment and this will be a problem for smartSleep too.

                              According to the ACK feature: if the binding don't receive an ACK after 4 timeouts it will revert the status of the thing to the last value. So if you for example try to switch on your light and the message is not acknowledged, the binding will revert the switch state to off. I've removed the code for this, because of the issue above, but will add it again in the future.

                              1 Reply Last reply
                              0
                              • AndrewZA Offline
                                AndrewZA Offline
                                AndrewZ
                                wrote on last edited by
                                #121

                                Hello everyone

                                I'm testing MySensor Ethernet gateway with a relay code on it. My understanding that Gateway stores the current state of the relay (or GPIO port) in it's EPROM. Can the binding periodically check the state of the port or should I rely on OH persistence functionality? Please advise what is the right way to keep the states synced between the Gateway and OH.

                                Thanks
                                Andrew

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

                                  Hi Andrew!

                                  Good question. Polling is currently not supported by the binding itself, but what you could do is: send a message from the node to the gateway, when the node restarts (the moment after you read the EEPROM and set the output of the pin).

                                  Greetings
                                  Tim

                                  AndrewZA 1 Reply Last reply
                                  0
                                  • T TimO

                                    Hi Andrew!

                                    Good question. Polling is currently not supported by the binding itself, but what you could do is: send a message from the node to the gateway, when the node restarts (the moment after you read the EEPROM and set the output of the pin).

                                    Greetings
                                    Tim

                                    AndrewZA Offline
                                    AndrewZA Offline
                                    AndrewZ
                                    wrote on last edited by
                                    #123

                                    @TimO , thanks for the idea.
                                    So I can probably take some code used for reporting button presses in the examples and use it in the 'message'.

                                    Thanks again
                                    Andrew

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

                                      Hi Tim0.

                                      I have read all your instructions in the GitHub Repo.
                                      Is there any special reason why you suggest to add things in manual, text way, rather than with the PaperUI?

                                      I have done it with the PaperUI and manually restarting my nodes and everything works just fine.

                                      Let me know what you think.
                                      Regards

                                      Q T 2 Replies Last reply
                                      0
                                      • G gonzalonal

                                        Hi Tim0.

                                        I have read all your instructions in the GitHub Repo.
                                        Is there any special reason why you suggest to add things in manual, text way, rather than with the PaperUI?

                                        I have done it with the PaperUI and manually restarting my nodes and everything works just fine.

                                        Let me know what you think.
                                        Regards

                                        Q Offline
                                        Q Offline
                                        Qu3Uk
                                        wrote on last edited by
                                        #125

                                        I wondered that but I'm quite new to OpenHab so did some looking in to how various things work..

                                        PaperUi uses something called MapDB which is basically a non-human readable configuration file. If you add "things" via PaperUi as far as I can tell you've still got to link the thing to an item for OpenHab to work with as far as I can tell..

                                        I opted to do everything manually like in the wiki, seems much simpler

                                        I get the impression PaperUi is still very new and not for production yet... its not compatible with sitemaps as they are waiting to implement a version of sitemaps in PaperUI or something.. I think it all boils down to the fact they want to keep V2 100% compatible with V1 configs and bindings etc so all the new stuff in V2 isn't quite ready yet...

                                        Anyway might have totally got the wrong impression but that's what I see as a new OpenHab user going straight to v2.

                                        On another note the work your doing TimO is awesome!

                                        1 Reply Last reply
                                        0
                                        • G gonzalonal

                                          Hi Tim0.

                                          I have read all your instructions in the GitHub Repo.
                                          Is there any special reason why you suggest to add things in manual, text way, rather than with the PaperUI?

                                          I have done it with the PaperUI and manually restarting my nodes and everything works just fine.

                                          Let me know what you think.
                                          Regards

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

                                          @gonzalonal

                                          I totally agree with @Qu3Uk ! :-)
                                          Both ways work and currently I like the configuration with the .items file more.

                                          In an early version of the PaperUI it was possible to change the status of items (switch lights on and off). Maybe something like this will return or habmin2 will fill the gap.

                                          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