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.9k 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.
  • 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
              • T TimO

                @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 Offline
                Q Offline
                Qu3Uk
                wrote on last edited by
                #47

                @TimO Good to know its not just me, may still be O2 it is alpha after all.

                Now to figure out these rules..

                T 1 Reply Last reply
                0
                • fetsF Offline
                  fetsF Offline
                  fets
                  wrote on last edited by
                  #48

                  Hi @TimO, any chance you add support to MySensors MQTT to your great work in progress ?

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

                    How do I add this button from the paper UI ? I can´t understand what to enter in the child id, node id fields.

                    /**
                    * The MySensors Arduino library handles the wireless radio link and protocol
                    * between your home built sensors/actuators and HA controller of choice.
                    * The sensors forms a self healing radio network with optional repeaters. Each
                    * repeater and gateway builds a routing tables in EEPROM which keeps track of the
                    * network topology allowing messages to be routed to nodes.
                    *
                    * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
                    * Copyright (C) 2013-2015 Sensnology AB
                    * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
                    *
                    * Documentation: http://www.mysensors.org
                    * Support Forum: http://forum.mysensors.org
                    *
                    * This program is free software; you can redistribute it and/or
                    * modify it under the terms of the GNU General Public License
                    * version 2 as published by the Free Software Foundation.
                    *
                    *******************************
                    *
                    * DESCRIPTION
                    *
                    * Simple binary switch example 
                    * Connect button or door/window reed switch between 
                    * digitial I/O pin 3 (BUTTON_PIN below) and GND.
                    * http://www.mysensors.org/build/binary
                    */
                    
                    
                    #include <MySensor.h>
                    #include <SPI.h>
                    #include <Bounce2.h>
                    
                    #define CHILD_ID 3
                    #define BUTTON_PIN  3  // Arduino Digital I/O pin for button/reed switch
                    
                    MySensor gw;
                    Bounce debouncer = Bounce(); 
                    int oldValue=-1;
                    
                    // Change to V_LIGHT if you use S_LIGHT in presentation below
                    MyMessage msg(CHILD_ID,V_TRIPPED);
                    
                    void setup()  
                    {  
                    gw.begin();
                    
                    // Setup the button
                    pinMode(BUTTON_PIN,INPUT);
                    // Activate internal pull-up
                    digitalWrite(BUTTON_PIN,HIGH);
                    
                    // After setting up the button, setup debouncer
                    debouncer.attach(BUTTON_PIN);
                    debouncer.interval(5);
                    
                    // Register binary input sensor to gw (they will be created as child devices)
                    // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. 
                    // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
                    gw.present(CHILD_ID, S_DOOR);  
                    }
                    
                    
                    //  Check if digital input has changed and send in new value
                    void loop() 
                    {
                    debouncer.update();
                    // Get the update value
                    int value = debouncer.read();
                    
                    if (value != oldValue) {
                       // Send in the new value
                       gw.send(msg.set(value==HIGH ? 1 : 0));
                       oldValue = value;
                    }
                    }
                    
                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      TimO
                      Hero Member
                      wrote on last edited by
                      #50

                      @Cliff-Karlsson : Start the discovery process in the paper ui and after that restart your sensor. The sensor will represent itself while starting up and should appear in the paper ui.

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

                        @fets: I'm not very familiar with MQTT but that should already work with the 1.X binding, or not?

                        1 Reply Last reply
                        0
                        • fetsF Offline
                          fetsF Offline
                          fets
                          wrote on last edited by fets
                          #52

                          @TimO yes I think it works with manual bindins (several discussions mention it) but I meant using paper ui as you do here :)

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

                            Well if I add a door sensor and just enter some random node id/child Id it shows up as online. I never managed to add any sensor automatically even if I start the search process and resetting any sensors.

                            But the problem is that I can't get any reaction from the switch. I have tried connecting a button to pin 3 and also tried just connecting a cable from pin 3 to gnd. But no reaction whatever I do.

                            1 Reply Last reply
                            0
                            • Q Qu3Uk

                              @TimO Good to know its not just me, may still be O2 it is alpha after all.

                              Now to figure out these rules..

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

                              @Qu3Uk : Fixed the error. The sensors were initialized before the bridge was up.

                              @Cliff-Karlsson: The status of a thing in OH is not reliable and I'm yet not sure how to make it reliable because the connection between sensor and gateway is stateless, so a sensor maybe is online even if it only transmits one time per day.

                              In your case: what is the output of the "start_debug.sh"? Are there messages from the MySensors Gateway logged?

                              1 Reply Last reply
                              0
                              • Z Offline
                                Z Offline
                                ZoTyA
                                wrote on last edited by
                                #55

                                Nice work!

                                Did anyone try the binding with FakeMySensors?

                                http://forum.mysensors.org/topic/1648/test-your-home-made-controller-with-fakemysensors

                                Q 1 Reply Last reply
                                0
                                • Z Offline
                                  Z Offline
                                  ZoTyA
                                  wrote on last edited by
                                  #56

                                  after OH2 restart I got "UNINITIALIZED - HANDLER_INITIALIZING_ERROR" for all already existing sensors. If I add a new sensors it works until OH2 restart

                                  1 Reply Last reply
                                  0
                                  • Z Offline
                                    Z Offline
                                    ZoTyA
                                    wrote on last edited by
                                    #57

                                    on thing removing:

                                    2015-08-21 19:40:36 [DEBUG] [.c.thing.internal.ThingManager:174 ] - Asking handler of thing 'mysensors:temperature:8da0bd23:Temperature_87_1' to handle its removal.
                                    2015-08-21 19:40:36 [INFO ] [ome.event.ThingStatusInfoEvent:43 ] - mysensors:temperature:8da0bd23:Temperature_87_1' updated: REMOVING
                                    2015-08-21 19:40:36 [ERROR] [.c.thing.internal.ThingManager:178 ] - The ItemHandler caused an exception while handling the removal of its thingjava.lang.NullPointerException: null
                                    at org.eclipse.smarthome.core.thing.internal.ThingManager$1.statusUpdated(ThingManager.java:176)
                                    at org.eclipse.smarthome.core.thing.internal.ThingManager.thingRemoving(ThingManager.java:361)
                                    at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyTrackers(ThingRegistryImpl.java:193)
                                    at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.remove(ThingRegistryImpl.java:89)
                                    at org.eclipse.smarthome.core.thing.setup.ThingSetupManager.removeThing(ThingSetupManager.java:442)
                                    at org.eclipse.smarthome.io.rest.core.thing.setup.ThingSetupManagerResource.removeThing(ThingSetupManagerResource.java:126)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                    at java.lang.reflect.Method.invoke(Method.java:497)
                                    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)

                                    1 Reply Last reply
                                    0
                                    • Z ZoTyA

                                      Nice work!

                                      Did anyone try the binding with FakeMySensors?

                                      http://forum.mysensors.org/topic/1648/test-your-home-made-controller-with-fakemysensors

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

                                      @ZoTyA said:

                                      after OH2 restart I got "UNINITIALIZED - HANDLER_INITIALIZING_ERROR" for all already existing sensors. If I add a new sensors it works until OH2 restart

                                      This should be fixed but I don't think @Tim0 has released the fix yet? Might be wrong.

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

                                        I'm pretty sure this time it is a bug in OH2, because my code works sometimes. :-)
                                        I've found a workaround and got 10/10 clean starts of OH2 and reinitializations of the configured things.

                                        Please let me know, if the error occures again!

                                        Thanks for testing!!

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

                                          How do I keep openhab2 updated after installing?

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

                                          Posts


                                          Copyright 2025 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