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 binding

openHAB binding

Scheduled Pinned Locked Moved OpenHAB
89 Posts 30 Posters 55.6k Views 33 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.
  • S sensorchecker

    Hello all,

    i use a ATMEGA328P with internal clock (MysBootloader) and have a 4-channel relay board connected at the Arduino outputs D3-D6 (current MySensors Example Sketch).

    As central unit i use a RaspberryPi with openhab 1.8 and a serial gateway (Arduino Nano) and the MySensors- OpenHAB serial binding of @bkl

    The OpenHab item looks like this:

    Switch Lights_Downlights_Front "Downlights Front" <selfLight> (Outdoor, Lights_Outdoor) {mysensors="54;1;V_STATUS"}

    Unfortunately I can not switch the relays ON or OFF.
    Many other sensors (Temp, Hum, Rain) works fine with this environment.

    Any help is appreciated!

    Greets & Thanks

    NickBuilderN Offline
    NickBuilderN Offline
    NickBuilder
    wrote on last edited by
    #71

    @sensorchecker Hi!
    Its not easy helping you using only the posted information. Any debug logs available from Openhab or the serial interface terminal?

    My item defintion looks the same:

    Switch Lampa <light> {mysensors="40;1;V_STATUS"}
    
    1 Reply Last reply
    0
    • Kodiak80K Offline
      Kodiak80K Offline
      Kodiak80
      wrote on last edited by
      #72

      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.

      bklB 1 Reply Last reply
      0
      • NickBuilderN NickBuilder

        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 message I_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!

        bklB Offline
        bklB Offline
        bkl
        wrote on last edited by
        #73

        @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

        NickBuilderN 1 Reply Last reply
        0
        • Kodiak80K Kodiak80

          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.

          bklB Offline
          bklB Offline
          bkl
          wrote on last edited by
          #74

          Hi @Kodiak80

          Your are missing the " item definition should be.

          Number  Temperature           "Temp [%s °C]"     <temperature>   (gBio,gTemperature)     {mysensors="105;1;V_TEMP"}
          

          The values is just

          node-id;child-sensor-id;sub-type
          
          1 Reply Last reply
          0
          • bklB bkl

            @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

            NickBuilderN Offline
            NickBuilderN Offline
            NickBuilder
            wrote on last edited by
            #75

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

            1 Reply Last reply
            0
            • Velo17V Offline
              Velo17V Offline
              Velo17
              wrote on last edited by
              #76

              ...trying to download the jar from the link in the first post, but server is not reachable. Is there any other URL to this .jar?

              1 Reply Last reply
              0
              • jerseyguy1996J Offline
                jerseyguy1996J Offline
                jerseyguy1996
                wrote on last edited by
                #77

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

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

                1 Reply Last reply
                1
                • A Offline
                  A Offline
                  andreground
                  wrote on last edited by
                  #78

                  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

                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    Fritzin
                    wrote on last edited by
                    #79

                    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!

                    1 Reply Last reply
                    0
                    • andredtsA Offline
                      andredtsA Offline
                      andredts
                      wrote on last edited by
                      #80

                      @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

                      1 Reply Last reply
                      0
                      • parachutesjP Offline
                        parachutesjP Offline
                        parachutesj
                        wrote on last edited by parachutesj
                        #81

                        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 (%) ```
                        parachutesjP 1 Reply Last reply
                        0
                        • parachutesjP parachutesj

                          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 (%) ```
                          parachutesjP Offline
                          parachutesjP Offline
                          parachutesj
                          wrote on last edited by parachutesj
                          #82

                          I saw STOP in S_cover is not supported in OH2 - what about OH1? Anyone?

                          T 1 Reply Last reply
                          0
                          • parachutesjP parachutesj

                            I saw STOP in S_cover is not supported in OH2 - what about OH1? Anyone?

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

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

                            parachutesjP 1 Reply Last reply
                            1
                            • T TimO

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

                              parachutesjP Offline
                              parachutesjP Offline
                              parachutesj
                              wrote on last edited by
                              #84

                              @TimO thank you.
                              and what is with OH1? Not getting it to work.
                              Does not seem that STOP works, UP & DOWN and PERCENTAGE work

                              T 1 Reply Last reply
                              0
                              • parachutesjP parachutesj

                                @TimO thank you.
                                and what is with OH1? Not getting it to work.
                                Does not seem that STOP works, UP & DOWN and PERCENTAGE work

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

                                @parachutesj I can't help you with this version of the binding, I've never used it.

                                parachutesjP 1 Reply Last reply
                                0
                                • T TimO

                                  @parachutesj I can't help you with this version of the binding, I've never used it.

                                  parachutesjP Offline
                                  parachutesjP Offline
                                  parachutesj
                                  wrote on last edited by
                                  #86

                                  @TimO Thanks anyway. I am slowly moving into the OH2 direction - still a lot of things to be clarified and configured

                                  1 Reply Last reply
                                  0
                                  • G Offline
                                    G Offline
                                    Guillermo Schimmel
                                    wrote on last edited by
                                    #87

                                    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.

                                    mfalkviddM 1 Reply Last reply
                                    0
                                    • G Guillermo Schimmel

                                      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.

                                      mfalkviddM Offline
                                      mfalkviddM Offline
                                      mfalkvidd
                                      Mod
                                      wrote on last edited by
                                      #88

                                      @guillermo-schimmel done. Is there some other post that should be pinned instead?

                                      G 1 Reply Last reply
                                      0
                                      • mfalkviddM mfalkvidd

                                        @guillermo-schimmel done. Is there some other post that should be pinned instead?

                                        G Offline
                                        G Offline
                                        Guillermo Schimmel
                                        wrote on last edited by
                                        #89

                                        @mfalkvidd Thanks! Just give me a couple of days and I will try to make a new tutorial for mysensors+openhab.

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


                                        13

                                        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