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 4 MySensors Binding

openHAB 4 MySensors Binding

Scheduled Pinned Locked Moved OpenHAB
19 Posts 9 Posters 230 Views 8 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.
  • ben999B ben999

    Hello there
    I thought it would be a good idea to upgrade my system to openHAB4, as i wanted to play with my security cameras linked to a Synology NAS system...
    Well it didn't go according to plan.
    First openhabian had to be upgraded from Buster to Bullseye in order to get Java from 11 to 17. Then Java got upgraded, By that time MySensors stopped working. So i started over with a fresh install of MySensors. All went well until

    make
    
    hal/architecture/Linux/drivers/core/GPIO.cpp: In constructor ‘GPIOClass::GPIOClass()’:
    hal/architecture/Linux/drivers/core/GPIO.cpp:53:50: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 48 [-Wformat-truncation=]
       53 |    snprintf(file, sizeof(file), "/sys/class/gpio/%s/base", de->d_name);
          |                                                  ^~
    hal/architecture/Linux/drivers/core/GPIO.cpp:53:12: note: ‘snprintf’ output between 22 and 277 bytes into a destination of size 64
       53 |    snprintf(file, sizeof(file), "/sys/class/gpio/%s/base", de->d_name);
          |    ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    hal/architecture/Linux/drivers/core/GPIO.cpp:62:50: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 48 [-Wformat-truncation=]
       62 |    snprintf(file, sizeof(file), "/sys/class/gpio/%s/ngpio", de->d_name);
          |                                                  ^~
    hal/architecture/Linux/drivers/core/GPIO.cpp:62:12: note: ‘snprintf’ output between 23 and 278 bytes into a destination of size 64
       62 |    snprintf(file, sizeof(file), "/sys/class/gpio/%s/ngpio", de->d_name);
          |    ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    g++ -MT build/hal/architecture/Linux/drivers/core/interrupt.o -MMD -MP -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -DMY_RADIO_RF24 -DMY_GATEWAY_LINUX -DMY_GATEWAY_MQTT_CLIENT -DMY_DEBUG -DLINUX_SPI_BCM -DLINUX_ARCH_RASPBERRYPI -DMY_MQTT_CLIENT_ID=\"impassedesroses\" -DMY_MQTT_SUBSCRIBE_TOPIC_PREFIX=\"mysensors-in\" -DMY_MQTT_PUBLISH_TOPIC_PREFIX=\"mysensors-out\" -DMY_RF24_PA_LEVEL=RF24_PA_LOW -DMY_CONTROLLER_IP_ADDRESS=127,0,0,1  -Ofast -g -Wall -Wextra -std=c++11 -I. -I./core -I./hal/architecture/Linux/drivers/core -I./hal/architecture/Linux/drivers/BCM -c hal/architecture/Linux/drivers/core/interrupt.cpp -o build/hal/architecture/Linux/drivers/core/interrupt.o
    hal/architecture/Linux/drivers/core/interrupt.cpp:33:10: fatal error: stropts.h: No such file or directory
       33 | #include <stropts.h>
          |          ^~~~~~~~~~~
    compilation terminated.
    make: *** [Makefile:99: build/hal/architecture/Linux/drivers/core/interrupt.o] Error 1
    
    

    Please advise if i should start over from the very begenning (fresh SD) or just stick with openHAB 3 (but soon or later it will be superseeded)

    Thanks a lot for your time people.

    ben999B Offline
    ben999B Offline
    ben999
    wrote on last edited by
    #3
    This post is deleted!
    1 Reply Last reply
    0
    • mfalkviddM mfalkvidd

      @ben999 just remove the stropts include (in hal/architecture/Linux/drivers/core/interrupt.cpp), or use the development branch where the include has already been removed.

      https://github.com/mysensors/MySensors/pull/1446

      ben999B Offline
      ben999B Offline
      ben999
      wrote on last edited by
      #4

      @mfalkvidd Genius !!! :open_mouth:

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zkarolyi
        wrote on last edited by
        #5

        Hi,

        After changed to develop branch, the make was successfull, but how to get MySensors binding?
        I have found this: https://github.com/tobof/openhab-addons/wiki/Installation but it is for OpenHab 3.
        When I installed the jar, I get this error:

        [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.mysensors-3.1.0.jar
        
        org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mysensors [265]
        
          Unresolved requirement: Import-Package: org.apache.commons.lang; version="[2.6.0,3.0.0)"
        

        How to get a new binding?
        How to solve this?

        ben999B ChachaC C 3 Replies Last reply
        0
        • Z zkarolyi

          Hi,

          After changed to develop branch, the make was successfull, but how to get MySensors binding?
          I have found this: https://github.com/tobof/openhab-addons/wiki/Installation but it is for OpenHab 3.
          When I installed the jar, I get this error:

          [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.mysensors-3.1.0.jar
          
          org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mysensors [265]
          
            Unresolved requirement: Import-Package: org.apache.commons.lang; version="[2.6.0,3.0.0)"
          

          How to get a new binding?
          How to solve this?

          ben999B Offline
          ben999B Offline
          ben999
          wrote on last edited by
          #6

          Hi @zkarolyi

          I can not provide any help on that matter as i went the MQTT way.

          The binding for serial gateway requires loads of work from the MySensors dev team; so it might tatke a while before it becomes available (if it does all together). I really appreciate all the effort put into this but i also understand that it might come to an end someday. No matter how much i prefer the serial gateway over MQTT... i ended up in the mqtt team

          Back to your issu : the jar file might not be compatible with OH4

          1 Reply Last reply
          0
          • N Offline
            N Offline
            niccodemi
            wrote on last edited by niccodemi
            #7

            Hi @ben999

            I used to have OH3 with MySensors Ethernet gateway but now I have upgraded to OH4 and it seems the only option is to connect MySensors network to OH via MQTT.
            I flashed MySensors mqtt_gateway and installed Mosquitto on same machine where OH4 is installed (ip=192.168.1.yyy). I also installed MQTT binding in OH4.

            Can you please advise how did you configure things and items file? In OH3 I had them configured in textual format.

            Things file in OH3

            Bridge mysensors:bridge-eth:gateway [ ipAddress="192.168.1.xxx", tcpPort=5003, sendDelay=300, startupCheckEnabled=false, networkSanCheckEnabled=true ] {
            	 light			relunderstair0101 [ nodeId=1, childId=1, requestAck=false ]
            

            Items file in OH3

            Switch relunderstair0101  "LED-stairs" { channel="mysensors:light:gateway:relunderstair0101:status" }
            
            ben999B 1 Reply Last reply
            0
            • N niccodemi

              Hi @ben999

              I used to have OH3 with MySensors Ethernet gateway but now I have upgraded to OH4 and it seems the only option is to connect MySensors network to OH via MQTT.
              I flashed MySensors mqtt_gateway and installed Mosquitto on same machine where OH4 is installed (ip=192.168.1.yyy). I also installed MQTT binding in OH4.

              Can you please advise how did you configure things and items file? In OH3 I had them configured in textual format.

              Things file in OH3

              Bridge mysensors:bridge-eth:gateway [ ipAddress="192.168.1.xxx", tcpPort=5003, sendDelay=300, startupCheckEnabled=false, networkSanCheckEnabled=true ] {
              	 light			relunderstair0101 [ nodeId=1, childId=1, requestAck=false ]
              

              Items file in OH3

              Switch relunderstair0101  "LED-stairs" { channel="mysensors:light:gateway:relunderstair0101:status" }
              
              ben999B Offline
              ben999B Offline
              ben999
              wrote on last edited by ben999
              #8

              @niccodemi I am no expert and am having a tough time with these files as well !!!

              My .things file looks like so :

              Bridge mqtt:broker:mosquitto "MySensorsGateway"@"Home" [host="openhabian", port="1883", secure=false]
              {
              	Thing topic garageDoor01 "Garage"@"Basement" {
              		Channels:
              			Type contact :	garageDoor01switch	[stateTopic="mysensors-out/19/1/1/0/16", transformationPattern="MAP:contact.map"]
              			Type datetime : garageDoor01switch_LastUpdate
              	}
              

              As far as i understand, you're missing that "linktopic" descrption...

              N 1 Reply Last reply
              0
              • ben999B ben999

                @niccodemi I am no expert and am having a tough time with these files as well !!!

                My .things file looks like so :

                Bridge mqtt:broker:mosquitto "MySensorsGateway"@"Home" [host="openhabian", port="1883", secure=false]
                {
                	Thing topic garageDoor01 "Garage"@"Basement" {
                		Channels:
                			Type contact :	garageDoor01switch	[stateTopic="mysensors-out/19/1/1/0/16", transformationPattern="MAP:contact.map"]
                			Type datetime : garageDoor01switch_LastUpdate
                	}
                

                As far as i understand, you're missing that "linktopic" descrption...

                N Offline
                N Offline
                niccodemi
                wrote on last edited by
                #9

                @ben999 Thank you. I managed to get sensors data coming into OH.

                Would you happen to have also any thing / item example for switch / relay sketch?

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  forexsieno
                  wrote on last edited by
                  #10

                  Hello anybody runing openhab4 with latest bindings (3.3.0) and serial gateway?
                  I'm not able to get the bindings active. They are installed but not active.

                  d2c88d93-f48c-4149-87ae-864a0d9cc88a-image.png

                  diag gives following message:

                  7cf09807-9953-4235-bafd-cc3986e25756-image.png

                  Any ideas?

                  N 1 Reply Last reply
                  0
                  • F forexsieno

                    Hello anybody runing openhab4 with latest bindings (3.3.0) and serial gateway?
                    I'm not able to get the bindings active. They are installed but not active.

                    d2c88d93-f48c-4149-87ae-864a0d9cc88a-image.png

                    diag gives following message:

                    7cf09807-9953-4235-bafd-cc3986e25756-image.png

                    Any ideas?

                    N Offline
                    N Offline
                    niccodemi
                    wrote on last edited by niccodemi
                    #11

                    @forexsieno I am running OH4 but have migrated MySensors to MQTTGateway. Below example of how to control relays.

                    thing file

                    Bridge mqtt:broker:Mosquitto "Mysensors MQTT Broker" [host="192.xxx.xxx.xxx", secure=false, port=1883, clientID="Openhab"] 
                    {
                        Thing topic relunderstair "Relay" (mqtt:broker:Mosquitto) {
                            Channels:
                                Type switch : relunderstair0101 "LED-stairs" [ stateTopic="mygateway1-out/1/1/0/0/2", commandTopic ="mygateway1-in/1/1/0/0/2", on="1", off="0" ]
                        }
                     }
                    

                    item file

                    Switch relunderstair0101  "LED-stairs" { channel="mqtt:topic:Mosquitto:relunderstair:relunderstair0101" }
                    
                    1 Reply Last reply
                    0
                    • Z zkarolyi

                      Hi,

                      After changed to develop branch, the make was successfull, but how to get MySensors binding?
                      I have found this: https://github.com/tobof/openhab-addons/wiki/Installation but it is for OpenHab 3.
                      When I installed the jar, I get this error:

                      [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.mysensors-3.1.0.jar
                      
                      org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mysensors [265]
                      
                        Unresolved requirement: Import-Package: org.apache.commons.lang; version="[2.6.0,3.0.0)"
                      

                      How to get a new binding?
                      How to solve this?

                      ChachaC Offline
                      ChachaC Offline
                      Chacha
                      wrote on last edited by
                      #12

                      Hi @zkarolyi

                      You can download the 3.2.0-Snapshot version from here:
                      https://forum.mysensors.org/post/110626

                      It is working in OH3 and OH4!

                      There is also a 3.3.0-Snapshot version, but it doesn't work in OH4.
                      See my post here: https://forum.mysensors.org/post/113864

                      1 Reply Last reply
                      0
                      • Z zkarolyi

                        Hi,

                        After changed to develop branch, the make was successfull, but how to get MySensors binding?
                        I have found this: https://github.com/tobof/openhab-addons/wiki/Installation but it is for OpenHab 3.
                        When I installed the jar, I get this error:

                        [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.mysensors-3.1.0.jar
                        
                        org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mysensors [265]
                        
                          Unresolved requirement: Import-Package: org.apache.commons.lang; version="[2.6.0,3.0.0)"
                        

                        How to get a new binding?
                        How to solve this?

                        C Offline
                        C Offline
                        CyborgAndy
                        wrote on last edited by CyborgAndy
                        #13

                        Hi @zkarolyi

                        Download org.openhab.binding.mysensors-4.0.4-SNAPSHOT.jar from my Google Disk and try it.
                        I only tested as a MySensors MQTT Gateway

                        kerberosK Z 2 Replies Last reply
                        0
                        • C CyborgAndy

                          Hi @zkarolyi

                          Download org.openhab.binding.mysensors-4.0.4-SNAPSHOT.jar from my Google Disk and try it.
                          I only tested as a MySensors MQTT Gateway

                          kerberosK Offline
                          kerberosK Offline
                          kerberos
                          wrote on last edited by
                          #14

                          Hi @CyborgAndy

                          many thanks for providing the binding update for MySensors 4.0.4! I upgrade my OpenHAB 3.4.4 a few minutes ago to 4.0.4 successfully with your binding update. I use a USB connected serial-gateway. The OpenHAB manual installation upgrade works perfect. I need to do afterwards the following steps in the Karaf console, to get the gateway online again, after the update:

                          feature:install openhab-transport-serial
                          feature:install openhab-core-io-transport-mqtt
                          feature:install openhab-core-io-transport-serial-javacomm
                          

                          Many thanks again!
                          kerberos

                          1 Reply Last reply
                          0
                          • kerberosK Offline
                            kerberosK Offline
                            kerberos
                            wrote on last edited by
                            #15

                            As x-mas gift :santa: works with OpenHAB 4.1 as well...

                            1 Reply Last reply
                            1
                            • C CyborgAndy

                              Hi @zkarolyi

                              Download org.openhab.binding.mysensors-4.0.4-SNAPSHOT.jar from my Google Disk and try it.
                              I only tested as a MySensors MQTT Gateway

                              Z Offline
                              Z Offline
                              zkarolyi
                              wrote on last edited by
                              #16

                              Hi @CyborgAndy

                              Really thank you for this jar so much, I finally managed to bring my sensors to life!
                              A thousand thanks and gratitude!

                              zkarolyi

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                adds666
                                wrote on last edited by
                                #17

                                As an OH3 user looking to upgrade, I'm wondering, do all of the binding points from OH to mysensor nodes, children etc work after upgrade and loading this new .jar?

                                Or do I have to re-build everything in OH?

                                kerberosK 2 Replies Last reply
                                0
                                • A adds666

                                  As an OH3 user looking to upgrade, I'm wondering, do all of the binding points from OH to mysensor nodes, children etc work after upgrade and loading this new .jar?

                                  Or do I have to re-build everything in OH?

                                  kerberosK Offline
                                  kerberosK Offline
                                  kerberos
                                  wrote on last edited by
                                  #18
                                  This post is deleted!
                                  1 Reply Last reply
                                  0
                                  • A adds666

                                    As an OH3 user looking to upgrade, I'm wondering, do all of the binding points from OH to mysensor nodes, children etc work after upgrade and loading this new .jar?

                                    Or do I have to re-build everything in OH?

                                    kerberosK Offline
                                    kerberosK Offline
                                    kerberos
                                    wrote on last edited by
                                    #19

                                    Hi @adds666

                                    I did in between the switch from 2.5.12 to 3.4.4 a change from pure textual configuration in 2.5.12 to a UI configuration in 3.4.4. This requires some homework. Can't remember beside the exchanged mysensors binding files anything else to upgrade to 4.0.4 from 3.4.4 and finally to current 4.1.1. Keep in mind, I use a OpenHAB manual installation on a non-Debian Linux system, not openHABian. This may have an influence, but I don't expect any hiccups.

                                    kerberos

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


                                    29

                                    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