pimatic-mysensors controller plugin
-
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.
-
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.
-
@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... -
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... -
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.
-
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"! -
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"!@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" ofgive me sometime will fix this issue.
-
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.
-
I have fixed the issues, plugin published to public npm registry . now i think it should work perfectly
-
Dheeraj,
When we can expect more variables available to mysensors plugin? I miss a simple on off switch.
Thanks!
-
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.00What 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
-
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.00What 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
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
-
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? -
This post is deleted!
-
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? -
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 definedI 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 = 0What 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)