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.
  • hekH Offline
    hekH Offline
    hek
    Admin
    wrote on last edited by
    #27

    Yep, but there might be other use cases where a node have been sleeping and wants to request an update from the controller (of something). Guess we cannot just assume that all nodes behaves the same here and just need all VARs sent out.

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

      Fair point, and the ultimate solution should definitely support this.

      Still, I think my suggestion could be useful and much easier to implement on the binding side (and sensor side) since it requires no user configuration in openhab (apart from possibly a checkbox to enable/disable the functionality). The only user interaction required is to actually consume the messages in the node and do something useful with them, if desired. So maybe it is a useful start?

      In the pulse sensor example, what should be providing the data when it is requested by the node?

      1 Reply Last reply
      0
      • hekH Offline
        hekH Offline
        hek
        Admin
        wrote on last edited by
        #29

        @kolaf
        Maybe I misinterpreted your earlier post... Do you mean that the controller-plugin should send out the last known value/state of all previously received variables to the node (even if it hasn't received a REQ message) when it detects a newly started node?

        If it already keeps this information I guess it would be simpler to just reply on the REQ message only? Like intended... :)

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

          Yes, but how does it know what to send as a response to a generic request. Everything? A single specific variable? In that case, which variable?

          Sorry for bringing this thread off track. Maybe I should take this off-line with @hek or try to read some documentation to understand this better, at least until we see whether @TimO wants to do anything like this at all.

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

            @kolaf thanks again for testing!

            The light switch can't get updated by the sensor, I've forgotten to implement that. Thanks for the hint! :-)

            The request from sensors is definatly a thing I want to implement. As far as I can see, I should be able to determine which value is requested, because of the combination of nodeId, childId and Subtype.

            I stumpled already about the isMetric() request in the humidity sketch, I want to add that too.

            A problem currently is, that for persistance in OpenHAB2 the addon from OpenHAB1 is used and that is not yet fully compatible. I need to check, wether it is usable for development yet. A second problem: I need to dig deeper to find out, how to read the value of a thing.

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

              There it is, the Child ID is included in the request message :-). Sorry for the confusion caused by my lack of observation skills.

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

                Small update:

                • I've fixed the problem with the representation of the light status (@kolaf ).

                • I've experimented a little with the configuration files. Additionally to the thing discovery or manual creation via the Paper UI you're able to declare the gateway and corresponding things/items in configuration files. It is very similar to the declaration done in OpenHAB 1.X, without the need to handle the messages in the rules files. I've documented that in the Readme.md you find while following the Link to the Github repository in the first post of this thread.

                • I've started a discussion in the google group for OpenHAB2. OpenHAB2 is not able to read out the value of a thing within the binding. This would be very useful, for example for the pulse sensors (power/water) that are able to request the last pulse count. (Corresponding thread in the google group: https://groups.google.com/forum/#!topic/openhab2/QbmaSwC59l0)

                The current snapshot of the mysensors binding is available for download here:
                Download

                K 1 Reply Last reply
                0
                • T TimO

                  Small update:

                  • I've fixed the problem with the representation of the light status (@kolaf ).

                  • I've experimented a little with the configuration files. Additionally to the thing discovery or manual creation via the Paper UI you're able to declare the gateway and corresponding things/items in configuration files. It is very similar to the declaration done in OpenHAB 1.X, without the need to handle the messages in the rules files. I've documented that in the Readme.md you find while following the Link to the Github repository in the first post of this thread.

                  • I've started a discussion in the google group for OpenHAB2. OpenHAB2 is not able to read out the value of a thing within the binding. This would be very useful, for example for the pulse sensors (power/water) that are able to request the last pulse count. (Corresponding thread in the google group: https://groups.google.com/forum/#!topic/openhab2/QbmaSwC59l0)

                  The current snapshot of the mysensors binding is available for download here:
                  Download

                  K Offline
                  K Offline
                  kolaf
                  Hero Member
                  wrote on last edited by kolaf
                  #34

                  @TimO Great work, I will try to test it tonight.

                  It appears from the discussion that official support for getting the values in the binding seems unlikely.

                  I guess you could argue that as long as the thing and openhab are not rebooted at the same time, the count should be consistent from the thing. But perhaps he is right, maybe it is better to just keep the total count inside openhab and create a rule to calculate the total power consumed based on our knowledge of number of pulses per kwh, for instance?

                  On the other hand, was about something like a lock which needs to know its last state if it was not written to EEPROM, is this also beyond the scope of what the binding should be able to do?

                  1 Reply Last reply
                  0
                  • bpairB Offline
                    bpairB Offline
                    bpair
                    wrote on last edited by
                    #35

                    I just wanted to say thanks for your work on this. OpenHAB2 has been slow to a release but I think a mySensors-openHAB2 combination could really be a solution that many people need. Ease of entry, big user base, handles many sensors and applications.

                    My kids go back to school in a couple weeks and I hope to help with testing. Thanks.

                    1 Reply Last reply
                    0
                    • bpairB Offline
                      bpairB Offline
                      bpair
                      wrote on last edited by
                      #36

                      I followed your directions and installed on a Windows 7 machine with a serial gateway. Everything came up fine. I configured the serial gateway (added the port). Then I waited but my humidity sensor was not detected. I restarted my arduino with the humidity sensor and immediately two new devices appeared (Humidity plus temperature).

                      Really nice! Thanks.

                      T 1 Reply Last reply
                      0
                      • bpairB bpair

                        I followed your directions and installed on a Windows 7 machine with a serial gateway. Everything came up fine. I configured the serial gateway (added the port). Then I waited but my humidity sensor was not detected. I restarted my arduino with the humidity sensor and immediately two new devices appeared (Humidity plus temperature).

                        Really nice! Thanks.

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

                        @bpair Thanks for your feedback. I'm glad it works.

                        I'm currently adding some sensors and plan to test them against @barduino s mocksensor.

                        barduinoB 1 Reply Last reply
                        0
                        • T TimO

                          @bpair Thanks for your feedback. I'm glad it works.

                          I'm currently adding some sensors and plan to test them against @barduino s mocksensor.

                          barduinoB Offline
                          barduinoB Offline
                          barduino
                          wrote on last edited by barduino
                          #38

                          @TimO

                          oh let me update the code then. :blush:

                          Did some fixes since my last commit

                          Cheers

                          UPDATE

                          Guys, folks here at MySensor were gracefull enough to upgrade the MockMySensors to lib 1.5 and I didn't realise that. So making a dumb mistake I've tried to update the development branch from my local copy.
                          I don't think the pull request went through which is good and I think you should be fine with the master version.

                          Cheers

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            Atomfire
                            wrote on last edited by
                            #39

                            I am new to MySensors and for that matter home automation in general, but I have setup OpenHab 2.0 on Windows 7 with a serial gateway device. I built a humidity and temp sensor and after a bit of trial and error (30 mins) the sensors were detected within OpenHab. Sensors are updating every 30 seconds without any issues even though the gateway is in the loft and the sensor is in the downstairs living room. I am very impressed at how easy your auto detection has made the initial setup. I have initially bought Vera Edge but my serial gateway has the wrong chipset to work with it so thought I would give this a try. I am tempted to sell the Vera now after having quick success thanks to your help, just need to keep an eye on the OpenHab 2.0 development and hope it's ready to use sometime soon.

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

                              @Atomfire I'm glad it worked for you too!! :-)

                              I've added a few additional sensors:

                              • S_DOOR
                              • S_MOTION
                              • S_SMOKE
                              • S_DIMMER
                              • S_COVER (V_STOP not implemented in OH2, can't use it yet)
                              • S_WIND
                              • S_RAIN
                              • S_UV
                              • S_WEIGHT
                              • S_DISTANCE
                              • S_LIGHT_LEVEL

                              Downloadlink is in the first post and I've modified the instructions.

                              Please delete the content of the userdata directory if you already tested with an older version of the binding. OH2 may get confused (throws exceptions) otherwise.

                              1 Reply Last reply
                              0
                              • Cliff KarlssonC Offline
                                Cliff KarlssonC Offline
                                Cliff Karlsson
                                wrote on last edited by
                                #41

                                after installing openhab2 this way how do I keep it updated?

                                1 Reply Last reply
                                0
                                • bpairB Offline
                                  bpairB Offline
                                  bpair
                                  wrote on last edited by
                                  #42

                                  This is probably a better question for the openHAB2 google group but is there anyway to persist the data without having to create a items.xml? Or another way to put it, is there any way to persist data for a sensor that is detected and added?

                                  1 Reply Last reply
                                  0
                                  • greglG Offline
                                    greglG Offline
                                    gregl
                                    Hero Member
                                    wrote on last edited by
                                    #43

                                    For those interested in OpenHAB - they have a new forum here:
                                    http://community.openhab.org/

                                    I think/hope it will be easier to use that the google groups.

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      MartinP
                                      wrote on last edited by
                                      #44

                                      @gregl the link doesn't work, here is the correct one:
                                      https://community.openhab.org/
                                      (only that annoying little s after http i think ;) )

                                      1 Reply Last reply
                                      0
                                      • Q Offline
                                        Q Offline
                                        Qu3Uk
                                        wrote on last edited by
                                        #45

                                        Firstly great work on the binding... it makes openhab2 a bit more attractive.

                                        Not entirely sure how to debug this further as I'm very new to openhab but after setting all my sensors up (even via discovery which is cool) after I restart the openhab2 service the MYS things never get initialized and stay in the UNINITIALIZED state.

                                        Running on RP2 and start_debug.sh I see the incoming MYS messages but OH2 is not updating the thing, for example

                                        2015-08-15 04:04:57 [DEBUG] [b.m.p.ip.MySensorsIpConnection:68 ] - 4;0;1;0;0;29.0
                                        2015-08-15 04:05:08 [DEBUG] [b.m.p.ip.MySensorsIpConnection:68 ] - 1;0;1;0;0;30.0

                                        However if I go in to the thing via the paperui, edit/save it. The thing is then initialized and I can see in the console OH2 updating the thing when a message is received.

                                        2015-08-15 04:08:53 [DEBUG] [b.m.p.ip.MySensorsIpConnection:68 ] - 1;0;1;0;0;30.0
                                        2015-08-15 04:08:53 [INFO ] [runtime.busevents :27 ] - mysensors_temperature_08797005_Temperature_1_0_temp state updated to 30.0

                                        I deleted the userdata directory before updating to the latest version 3 days ago.

                                        No idea if this is a OH2 issue or a binding issue though.

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

                                          @Qu3Uk: Thank you for the report. I am able to reproduce this. I suppose it is an error in my binding because some parts are started correctly. I will look into it.

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


                                          19

                                          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