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. pimatic
  4. pimatic-mysensors controller plugin

pimatic-mysensors controller plugin

Scheduled Pinned Locked Moved pimatic
controllernode idnrf24l01+mysensorsrasp
92 Posts 23 Posters 56.0k Views 11 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.
  • D Dheeraj

    @ricardot said:

    let me the exact error msg.

    R Offline
    R Offline
    ricardot
    wrote on last edited by
    #7

    @Dheeraj said:

    @ricardot said:

    let me the exact error msg.

    15:16:12.055 [pimatic] Starting pimatic version 0.8.45
    15:16:15.227 [pimatic] Startup error: Error: Parse error on line 80:
    15:16:15.227 [pimatic]>..."/dev/ttyUSB0", "#" "#""/dev/ttyUSBx" "i
    15:16:15.227 [pimatic]>-----------------------^
    15:16:15.227 [pimatic]>Expecting 'EOF', '}', ':', ',', ']', got 'STRING'
    15:16:15.227 [pimatic]> at Object.parseError (/usr/local/pimatic-app/node_modules/pimatic/node_modules/cjson/node_modules/jsonlint/lib/jsonlint.js:55:11)
    15:16:15.227 [pimatic]> at Object.parse (/usr/local/pimatic-app/node_modules/pimatic/node_modules/cjson/node_modules/jsonlint/lib/jsonlint.js:132:22)
    15:16:15.227 [pimatic]> at Object.exports.parse (/usr/local/pimatic-app/node_modules/pimatic/node_modules/cjson/node_modules/jsonlint/lib/jsonlint.js:417:53)
    15:16:15.227 [pimatic]> at Object.exports.parse (/usr/local/pimatic-app/node_modules/pimatic/node_modules/cjson/index.js:88:28)
    15:16:15.227 [pimatic]> at Framework._loadConfig (/usr/local/pimatic-app/framework.coffee:96:24)
    15:16:15.227 [pimatic]> at new Framework (/usr/local/pimatic-app/framework.coffee:54:8)
    15:16:15.227 [pimatic]> at /usr/local/pimatic-app/startup.coffee:48:21
    15:16:15.227 [pimatic]> at tryCatch1 (/usr/local/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:43:21)
    15:16:15.227 [pimatic]> at Function.Promise$_Try (/usr/local/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:233:11)
    15:16:15.227 [pimatic]> at Object.module.exports.startup (/usr/local/pimatic-app/startup.coffee:47:10)
    15:16:15.227 [pimatic]> at run (/usr/local/pimatic-app/node_modules/pimatic/pimatic.js:15:24)
    15:16:15.227 [pimatic]> at Object.<anonymous> (/usr/local/pimatic-app/node_modules/pimatic/pimatic.js:20:3)
    15:16:15.227 [pimatic]> at Module._compile (module.js:456:26)
    15:16:15.227 [pimatic]> at Object.Module._extensions..js (module.js:474:10)
    15:16:15.227 [pimatic]> at Module.load (module.js:356:32)
    15:16:15.227 [pimatic]> at Function.Module._load (module.js:312:12)
    15:16:15.227 [pimatic]> at Function.Module.runMain (module.js:497:10)
    15:16:15.227 [pimatic]> at startup (node.js:119:16)
    15:16:15.227 [pimatic]> at node.js:902:3
    15:16:15.274 [pimatic] exiting...

    1 Reply Last reply
    0
    • R Offline
      R Offline
      ricardot
      wrote on last edited by
      #8

      I removed the # #'/dev/ttyUSBx' if using serial Gateway

      So I got this:

      15:17:54.005 [pimatic] Starting pimatic version 0.8.45
      15:17:58.403 [pimatic] loading plugin: "pimatic-cron" (0.8.5)
      15:18:00.793 [pimatic] loading plugin: "pimatic-mobile-frontend" (0.8.44)
      15:18:05.848 [pimatic] loading plugin: "pimatic-mail" (0.8.2)
      15:18:08.301 [pimatic] Installing: "MySensors"
      15:18:16.958 [pimatic, npm] http GET https://registry.npmjs.org/pimatic-MySensors
      15:18:18.741 [pimatic, npm] http 404 https://registry.npmjs.org/pimatic-MySensors
      15:18:18.848 [pimatic, npm] ERR! 404 'pimatic-MySensors' is not in the npm registry.
      15:18:18.872 [pimatic, npm] ERR! 404 You should bug the author to publish it
      15:18:18.896 [pimatic, npm] ERR! 404
      15:18:18.914 [pimatic, npm] ERR! 404 Note that you can also install from a
      15:18:18.955 [pimatic, npm] ERR! 404 tarball, folder, or http url, or git url.
      15:18:18.964 [pimatic, npm] ERR! System Linux 3.12.28+
      15:18:18.986 [pimatic, npm] ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "pimatic-MySensors"
      15:18:19.005 [pimatic, npm] ERR! cwd /usr/local/pimatic-app
      15:18:19.025 [pimatic, npm] ERR! node -v v0.10.24
      15:18:19.034 [pimatic, npm] ERR! npm -v 1.3.21
      15:18:19.056 [pimatic, npm] ERR! code E404
      15:18:19.161 [pimatic, npm] ERR!
      15:18:19.192 [pimatic, npm] ERR! Additional logging details can be found in:
      15:18:19.205 [pimatic, npm] ERR! /usr/local/pimatic-app/npm-debug.log
      15:18:19.213 [pimatic, npm] ERR! not ok code 0
      15:18:19.312 [pimatic] Error running "npm install pimatic-MySensors"
      15:18:20.192 [pimatic-cron] the time is: Mon Feb 16 2015 15:18:20 GMT+0000 (UTC)
      15:18:20.996 [pimatic-mobile-frontend] packing static assets
      15:18:22.251 [pimatic-mobile-frontend] packing static assets finished
      15:18:22.273 [pimatic-mobile-frontend] rendering html
      15:18:44.851 [pimatic-mobile-frontend] rendering html finished
      15:18:44.989 [pimatic] listening for http-request on port 80...

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dheeraj
        Plugin Developer
        wrote on last edited by
        #9

        Since i haven't register mysensors with npm. that's the reason it is giving you the error. As a work around try download & manually installing pimatic-MySensors in node_module in pimatic-app folder.. Here other plugins are also installed like Pimatic-mobile-fontend etc.. Pimatic should be able to pick it up..
        I will try to fix this issue meanwhile.

        Let me know if it's works.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          ricardot
          wrote on last edited by
          #10

          I manually installed the pimatic-mysensors, seems it works, but I'm receiving this message:

          13:46:47.360 [pimatic] Cannot find module 'bluebird'

          Later I added two devices, a PIR and a relay-switch, and I'm receiving this message:

          13:46:49.289 [pimatic] no plugin found for device "Switch" of class "MySensorsSwitch"!
          13:46:49.305 [pimatic] no plugin found for device "PIR" of class "MySensorsPIR"!

          D 1 Reply Last reply
          0
          • R ricardot

            I manually installed the pimatic-mysensors, seems it works, but I'm receiving this message:

            13:46:47.360 [pimatic] Cannot find module 'bluebird'

            Later I added two devices, a PIR and a relay-switch, and I'm receiving this message:

            13:46:49.289 [pimatic] no plugin found for device "Switch" of class "MySensorsSwitch"!
            13:46:49.305 [pimatic] no plugin found for device "PIR" of class "MySensorsPIR"!

            D Offline
            D Offline
            Dheeraj
            Plugin Developer
            wrote on last edited by
            #11

            @ricardot said:

            atic] Cannot find module 'bluebird'

            Later I added two devices, a PIR and a relay-switch, and I'm receiving this message:

            13:46:49.289 [pimatic] no plugin found for device "Switch" of class "MySensorsSwitch"!
            13:46:49.305 [pimatic] no plugin found for device "PIR" of

            give me sometime will fix this issue.

            1 Reply Last reply
            0
            • R ricardot

              I can´t make mysensors plugin works in pimatic. I added this lines at plugins session of config.json with no sucess:

              {
              "plugin": "MySensors",
              "driver": "serialport",
              "protocols": "1.4.1",
              "driverOptions": {
              "serialDevice": "/dev/ttyUSB0", # #'/dev/ttyUSBx' if using serial Gateway
              "baudrate": 115200
              }
              }

              I received error messages like syntax error.

              D Offline
              D Offline
              Dheeraj
              Plugin Developer
              wrote on last edited by Dheeraj
              #12

              @ricardot

              I have fixed the issues, plugin published to public npm registry . now i think it should work perfectly

              R 1 Reply Last reply
              0
              • D Dheeraj

                @ricardot

                I have fixed the issues, plugin published to public npm registry . now i think it should work perfectly

                R Offline
                R Offline
                ricardot
                wrote on last edited by
                #13

                @Dheeraj

                It worked now, but I had to change the ttyUSB0 to ttyACM0. I'm using the uno for the gateway.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  ricardot
                  wrote on last edited by
                  #14

                  Dheeraj,

                  When we can expect more variables available to mysensors plugin? I miss a simple on off switch.

                  Thanks!

                  D 1 Reply Last reply
                  0
                  • R ricardot

                    Dheeraj,

                    When we can expect more variables available to mysensors plugin? I miss a simple on off switch.

                    Thanks!

                    D Offline
                    D Offline
                    Dheeraj
                    Plugin Developer
                    wrote on last edited by Dheeraj
                    #15

                    @ricardot
                    contact/door/light mysensor add to list.. just check :)
                    upload-58e0611e-710b-4a9a-9337-60282ed10131

                    1 Reply Last reply
                    1
                    • G Offline
                      G Offline
                      gogomartin
                      wrote on last edited by gogomartin
                      #16

                      @Dheeraj

                      This is my first try at getting MySensors to work.

                      I've connected a SerialGateway to the Pi, and configured a DHT22 sensor. But no values are recorded.

                      Logs from the pi:

                      <- I_LOG_MESSAGE 0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                      <- I_ID_REQUEST 255;255;3;0;3;
                      <- I_LOG_MESSAGE 0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                      <- I_ID_REQUEST 255;255;3;0;3;

                      Serial output from the sensor:

                      req node id
                      send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                      T: 22.70
                      req node id
                      send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                      H: 31.10
                      req node id
                      send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                      H: 31.00

                      What can I be doing wrong? Seems like the sensor is requesting a node ID but not getting any?

                      Thank you for any kind of response!

                      Regards, Martin

                      D 1 Reply Last reply
                      0
                      • G gogomartin

                        @Dheeraj

                        This is my first try at getting MySensors to work.

                        I've connected a SerialGateway to the Pi, and configured a DHT22 sensor. But no values are recorded.

                        Logs from the pi:

                        <- I_LOG_MESSAGE 0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                        <- I_ID_REQUEST 255;255;3;0;3;
                        <- I_LOG_MESSAGE 0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
                        <- I_ID_REQUEST 255;255;3;0;3;

                        Serial output from the sensor:

                        req node id
                        send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                        T: 22.70
                        req node id
                        send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                        H: 31.10
                        req node id
                        send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
                        H: 31.00

                        What can I be doing wrong? Seems like the sensor is requesting a node ID but not getting any?

                        Thank you for any kind of response!

                        Regards, Martin

                        D Offline
                        D Offline
                        Dheeraj
                        Plugin Developer
                        wrote on last edited by
                        #17

                        @gogomartin

                        Currently mysensors plugin only support static node id. Try configuring static node id in sensor code. Hint.. Gw. Begin (null, node id)

                        Let me know if it's works

                        Sebastien Vayrette-GavardS 1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          ricardot
                          wrote on last edited by
                          #18

                          Dheeraj,

                          Good work!

                          Is possible to send sensor battery level info?

                          D 2 Replies Last reply
                          0
                          • R ricardot

                            Dheeraj,

                            Good work!

                            Is possible to send sensor battery level info?

                            D Offline
                            D Offline
                            Dheeraj
                            Plugin Developer
                            wrote on last edited by
                            #19

                            @ricardot

                            battery sensor visualization is WIP..

                            1 Reply Last reply
                            0
                            • R Offline
                              R Offline
                              Ralf H
                              wrote on last edited by
                              #20

                              hey,
                              I really like your plugin now that I finally managed to get everything working. :)
                              But I would also like to use a BH1750 Light sensor with your plugin. I made a sensorbox with PIR to switch on lights for a minute when movement is detected, but I only want to switch on light when it's dark enough. Is it planned to add support for this?

                              D 1 Reply Last reply
                              1
                              • D Offline
                                D Offline
                                Dheeraj
                                Plugin Developer
                                wrote on last edited by
                                #21
                                This post is deleted!
                                1 Reply Last reply
                                0
                                • R ricardot

                                  Dheeraj,

                                  Good work!

                                  Is possible to send sensor battery level info?

                                  D Offline
                                  D Offline
                                  Dheeraj
                                  Plugin Developer
                                  wrote on last edited by
                                  #22

                                  @ricardot added support for battery level stats 0.8.9

                                  1 Reply Last reply
                                  0
                                  • R Ralf H

                                    hey,
                                    I really like your plugin now that I finally managed to get everything working. :)
                                    But I would also like to use a BH1750 Light sensor with your plugin. I made a sensorbox with PIR to switch on lights for a minute when movement is detected, but I only want to switch on light when it's dark enough. Is it planned to add support for this?

                                    D Offline
                                    D Offline
                                    Dheeraj
                                    Plugin Developer
                                    wrote on last edited by
                                    #23

                                    @Ralf-H sure will add support for light sensor

                                    1 Reply Last reply
                                    0
                                    • Vladut GrecuV Offline
                                      Vladut GrecuV Offline
                                      Vladut Grecu
                                      wrote on last edited by Vladut Grecu
                                      #24

                                      I would like to help you make a color picker for rgb leds and a slider for random pwm outputs :D
                                      -edit-

                                      deviceClasses = [
                                              MySensorsDHT
                                              MySensorsBMP
                                              MySensorsPIR
                                              MySensorsSwitch
                                              MySensorsPulseMeter
                                              MySensorsButton
                                              MySensorBattery
                                              MySensorsDevDimmer
                                            ]
                                      

                                      and

                                       class MySensorsDevDimmer extends env.devices.DimmerActuator
                                      
                                          constructor: (@config,lastState, @board) ->
                                            @id = config.id
                                            @name = config.name
                                            @_state = lastState?.state?.value
                                            env.logger.info "MySensorsDevDimmer" , @id , @name, @_state
                                      
                                            @board.on('rfValue', (result) =>
                                              if result.sender is @config.nodeid and result.type is
                                              V_LIGHT and result.sensor is @config.sensorid
                                                state = (if parseInt(result.value) is 1 then on else off)
                                                env.logger.info "<- MySensorDevDimmer " , result
                                                @_setState(state)
                                              )
                                            super()
                                      
                                          changeStateTo: (state) ->
                                            assert state is on or state is off
                                            if state is true then _state = 1  else _state = 0
                                            datas = {}
                                            datas =
                                            {
                                              "destination": @config.nodeid,
                                              "sensor": @config.sensorid,
                                              "type"  : V_LIGHT,
                                              "value" : _state,
                                              "ack"   : 1
                                            }
                                            @board._rfWrite(datas).then ( () =>
                                              @_setState(state)
                                            )
                                      
                                      

                                      But i get :
                                      Could not initialize the plugin "mysensors": MySensorsDevDimmer is not defined

                                      I know that this won`t actually work because of the :

                                       state = (if parseInt(result.value) is 1 then on else off) 
                                      

                                      and the :

                                        if state is true then _state = 1  else _state = 0
                                      

                                      What I don't get is why does it throw me that error. (Don't go hard on me, I just learned the basics of coffee script only for this)

                                      D 1 Reply Last reply
                                      0
                                      • Vladut GrecuV Vladut Grecu

                                        I would like to help you make a color picker for rgb leds and a slider for random pwm outputs :D
                                        -edit-

                                        deviceClasses = [
                                                MySensorsDHT
                                                MySensorsBMP
                                                MySensorsPIR
                                                MySensorsSwitch
                                                MySensorsPulseMeter
                                                MySensorsButton
                                                MySensorBattery
                                                MySensorsDevDimmer
                                              ]
                                        

                                        and

                                         class MySensorsDevDimmer extends env.devices.DimmerActuator
                                        
                                            constructor: (@config,lastState, @board) ->
                                              @id = config.id
                                              @name = config.name
                                              @_state = lastState?.state?.value
                                              env.logger.info "MySensorsDevDimmer" , @id , @name, @_state
                                        
                                              @board.on('rfValue', (result) =>
                                                if result.sender is @config.nodeid and result.type is
                                                V_LIGHT and result.sensor is @config.sensorid
                                                  state = (if parseInt(result.value) is 1 then on else off)
                                                  env.logger.info "<- MySensorDevDimmer " , result
                                                  @_setState(state)
                                                )
                                              super()
                                        
                                            changeStateTo: (state) ->
                                              assert state is on or state is off
                                              if state is true then _state = 1  else _state = 0
                                              datas = {}
                                              datas =
                                              {
                                                "destination": @config.nodeid,
                                                "sensor": @config.sensorid,
                                                "type"  : V_LIGHT,
                                                "value" : _state,
                                                "ack"   : 1
                                              }
                                              @board._rfWrite(datas).then ( () =>
                                                @_setState(state)
                                              )
                                        
                                        

                                        But i get :
                                        Could not initialize the plugin "mysensors": MySensorsDevDimmer is not defined

                                        I know that this won`t actually work because of the :

                                         state = (if parseInt(result.value) is 1 then on else off) 
                                        

                                        and the :

                                          if state is true then _state = 1  else _state = 0
                                        

                                        What I don't get is why does it throw me that error. (Don't go hard on me, I just learned the basics of coffee script only for this)

                                        D Offline
                                        D Offline
                                        Dheeraj
                                        Plugin Developer
                                        wrote on last edited by
                                        #25

                                        @Vladut-Grecu said:

                                        if state is true then _state = 1 else

                                        check the pimatic-daemon.log file and what kind of error exception your are getting . not sure if you have enable the "logLevel": "debug", in config.json for pimatic.

                                        Also, you need to add entry in device-config-schema.coffee schema file.
                                        if nothing works share the log file with me..

                                        I'm also new to coffee or nodejs and struggled a lot understanding the coffee script , basically, still in learning phase..

                                        1 Reply Last reply
                                        0
                                        • D Dheeraj

                                          @gogomartin

                                          Currently mysensors plugin only support static node id. Try configuring static node id in sensor code. Hint.. Gw. Begin (null, node id)

                                          Let me know if it's works

                                          Sebastien Vayrette-GavardS Offline
                                          Sebastien Vayrette-GavardS Offline
                                          Sebastien Vayrette-Gavard
                                          wrote on last edited by
                                          #26

                                          @Dheeraj, I have been looking all day for how to configure static node id , meanwhile I heard of mysensors last night so pardon me if I didn't find the doc that explain it. Can you point me in the right direction?

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


                                          10

                                          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