Questions about the release of v0.9
After long searching and fiddleing I have to give up…
For some reason, my fully working pimatic server gave up and I had to reinstall it from scratch.
So I loaded the SD Card with the latest Wheezy img (I had it on my computer because Jessie didn’t work for me one time), made the
sudo apt-get update & upgrade
and installed pimatic.
So far so good.
I fired the
sudo node /home/pi/pimatic-app/node_modules/pimatic/pimatic.js
and all I got was:coffee-cache: compiling coffee-script file "startup.coffee"...Done coffee-cache: compiling coffee-script file "lib/logger.coffee"...Done 10:56:07.264 2017-04-28 Friday coffee-cache: compiling coffee-script file "lib/api.coffee"...Done coffee-cache: compiling coffee-script file "lib/users.coffee"...Done coffee-cache: compiling coffee-script file "lib/devices.coffee"...Done coffee-cache: compiling coffee-script file "lib/matcher.coffee"...Done coffee-cache: compiling coffee-script file "lib/milliseconds.coffee"...Done coffee-cache: compiling coffee-script file "lib/variables.coffee"...Done coffee-cache: compiling coffee-script file "lib/variables-ast-builder.coffee"...Done coffee-cache: compiling coffee-script file "lib/actions.coffee"...Done coffee-cache: compiling coffee-script file "lib/predicates.coffee"...Done coffee-cache: compiling coffee-script file "lib/rules.coffee"...Done coffee-cache: compiling coffee-script file "lib/rules-ast-builder.coffee"...Done coffee-cache: compiling coffee-script file "lib/plugins.coffee"...Done coffee-cache: compiling coffee-script file "lib/database.coffee"...Done coffee-cache: compiling coffee-script file "lib/groups.coffee"...Done coffee-cache: compiling coffee-script file "lib/pages.coffee"...Done coffee-cache: compiling coffee-script file "lib/framework.coffee"...Done 10:58:59.188 [pimatic] Starting pimatic version 0.9.39 coffee-cache: compiling coffee-script file "config-schema.coffee"...Done Knex: run $ npm install sqlite3 --save Error: Cannot find module '/home/pi/node_modules/sqlite3/lib/binding/node-v46-linux-arm/node_sqlite3.node' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (/home/pi/node_modules/sqlite3/lib/sqlite3.js:4:15) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (/home/pi/pimatic-app/node_modules/pimatic/node_modules/coffee-script/lib/coffee-script/register.js:45:36) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Client_SQLite3._driver (/home/pi/pimatic-app/node_modules/pimatic/node_modules/knex/lib/dialects/sqlite3/index.js:75:12) at Client_SQLite3.initializeDriver (/home/pi/pimatic-app/node_modules/pimatic/node_modules/knex/lib/client.js:219:26) at Client_SQLite3.Client (/home/pi/pimatic-app/node_modules/pimatic/node_modules/knex/lib/client.js:113:10) at new Client_SQLite3 (/home/pi/pimatic-app/node_modules/pimatic/node_modules/knex/lib/dialects/sqlite3/index.js:58:20) at Knex (/home/pi/pimatic-app/node_modules/pimatic/node_modules/knex/lib/index.js:60:34) at /home/pi/pimatic-app/node_modules/pimatic/lib/database.coffee:73:17 at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromiseCtx (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:606:10) at Async._drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:138:12) at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:143:10) at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:17:14) at processImmediate [as _immediateCallback] (timers.js:383:17)
I don’t know why this always happens, has anyone an idea?
I tried various solutions I found on google and on this board but nothing worked…
I would be so grateful if you can help me out, this is really frustrating me…
My problem with +/- Buttons seems to be soleved. I can not reproduce it again
The update-the-variable-only-when-the-editing-is-finished feature is still a feature request see: https://forum.pimatic.org/topic/2760/variableinputdevice-add-option-to-update-the-variable-only-when-the-editing-is-finished
A small new problem came up:
If you change a variable may be by rule or from menu variable to a non numeric value, an associated VariableInputDevice of type number will display this value without complain.When trying to update then the variableInputDevice with +/- Buttons an error occurs.
An optimization idea: VariableInputDevices as well as similar devices needs to be connected to a plain variable. This leads to some redundancy. You can access the value direct from $var and also from $vardevice.input. In most cases it would be enough to have a VariableInputDevice withot a variable in background. If you compare this with other e.g. sensor devices the value is stored internally is enough.
in short: I vote for making the attribute ‘variable’ of VariableInputDevice (and similar devices) optional to use it standalone.
Ok… bash script seems to be a problem for me No idea where/how to start. Is it possible to do it with the “pimatic shell execute plugin”? Sorry if it’s a stupid question but as I said… totally newbie.
Yes, you need that plugin for this to work:pimatic shell execute plugin This plugin let you define devices that execute shell commands. Additionally, it allows you to execute shell commands in rule actions. So you can define rules of the form: if ... then execute "some command"
For now, ill assume you use putty to access your raspberry terminal.
You first create a file that will become your executable:
sudo nano /home/pi/pimatic-app/reboot-fritzbox.sh
This will open a terminal and you can paste the code there with SHIFT-INSERT keys.
Now you edit the variables._BOXURL="http://your url to fritzbox" _USERNAME="your username" _PASSWORD="your password"
Press ctrl+x and y - enter to save
Now we need to make it executable:
sudo chmod +x /home/pi/pimatic-app/reboot-fritzbox.sh
Now that is is executable, pimatic can run it too.
If you have shell execute plugin enabled you can also use it in a rule like i mentioned earlier.
You can see bash as an windows .exe. This script uses variables for its final part, a cURL command.
You can see cURL as an headless browser.
The script log’s in to your fitzbox(variables) and presses the right buttons to reboot(cURL).
I can make that even easier: use when ID-KaKu-switch.state changes in your rule.
And just like that you can also use increases for positive edges and decreases for negative edges on the switch.
This works on all types of switches as receives is a Homeduino only attribute.