@kosta Nice plugin. In particular I like it also handles incoming messages. Excellent work! I’ll trial it in the next couple of days.
-
New plugin pimatic-xmpp
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
The plugin is now over the npm repository available.
I have integrated also a default destination user for messages. -
Hey guys,
i have released a new version of the plugin.
Autoupdate over the plugin manager.Now it is possible to interact with all pimatic devices.
Just use the syntax which is used in the rule action editor.
At the rule editor you can get the available commands.For example:
toggle device1
switch device2 on
set temp of heating to 28 -
@kosta Thanks, i could really use this so i installed your plugin using the ejabberd method. Didn’t try to send messages yet but i already ran into some trouble. Am i doing something wrong here?
This is from my pimatic-daemon.log:
23:34:58.140 [pimatic] error: A uncaught exception occured: TypeError: Cannot read property 'attrs' of undefined 23:34:58.140 [pimatic] error:> at XmppPlugin.readIq (/home/pi/pimatic-app/node_modules/pimatic-xmpp/xmpp.coffee:150:99) 23:34:58.140 [pimatic] error:> at XmppPlugin.readIq (/home/pi/pimatic-app/node_modules/pimatic-xmpp/xmpp.coffee:3:1) 23:34:58.140 [pimatic] error:> at XmppPlugin.rec (/home/pi/pimatic-app/node_modules/pimatic-xmpp/xmpp.coffee:84:14) 23:34:58.140 [pimatic] error:> at Client.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-xmpp/xmpp.coffee:3:1) 23:34:58.140 [pimatic] error:> at emitOne (events.js:77:13) 23:34:58.140 [pimatic] error:> at Client.emit (events.js:169:7) 23:34:58.140 [pimatic] error:> at Client._handleStanza (/home/pi/pimatic-app/node_modules/pimatic-xmpp/node_modules/node-xmpp-client/lib/Client.js:227:12) 23:34:58.140 [pimatic] error:> at Client.onStanza (/home/pi/pimatic-app/node_modules/pimatic-xmpp/node_modules/node-xmpp-client/lib/Client.js:221:8) 23:34:58.140 [pimatic] error:> at emitOne (events.js:77:13) 23:34:58.140 [pimatic] error:> at Connection.emit (events.js:169:7) 23:34:58.140 [pimatic] error:> at Connection.onStanza (/home/pi/pimatic-app/node_modules/pimatic-xmpp/node_modules/node-xmpp-client/node_modules/node-xmpp-core/lib/Connection.js:377:10) 23:34:58.140 [pimatic] error:> at StreamParser.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-xmpp/node_modules/node-xmpp-client/node_modules/node-xmpp-core/lib/Connection.js:231:10) 23:34:58.140 [pimatic] error:> at emitOne (events.js:77:13) 23:34:58.140 [pimatic] error:> at StreamParser.emit (events.js:169:7) 23:34:58.140 [pimatic] error:> at SaxLtx.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-xmpp/node_modules/node-xmpp-client/node_modules/node-xmpp-core/node_modules/@xmpp/streamparser/index.js:68:14) 23:34:58.140 [pimatic] error:> at emitOne (events.js:77:13) 23:34:58.140 [pimatic] error:> at SaxLtx.emit (events.js:169:7) 23:34:58.140 [pimatic] error:> at SaxLtx._handleTagOpening (/home/pi/pimatic-app/node_modules/pimatic-xmpp/node_modules/node-xmpp-client/node_modules/node-xmpp-core/node_modules/@xmpp/streamparser/node_modules/ltx/lib/parsers/ltx.js:37:12) 23:34:58.140 [pimatic] error:> at SaxLtx.write (/home/pi/pimatic-app/node_modules/pimatic-xmpp/node_modules/node-xmpp-client/node_modules/node-xmpp-core/node_modules/@xmpp/streamparser/node_modules/ltx/lib/parsers/ltx.js:111:18) 23:34:58.140 [pimatic] error:> at StreamParser.write (/home/pi/pimatic-app/node_modules/pimatic-xmpp/node_modules/node-xmpp-client/node_modules/node-xmpp-core/node_modules/@xmpp/streamparser/index.js:133:17) 23:34:58.140 [pimatic] error:> at Connection.onData (/home/pi/pimatic-app/node_modules/pimatic-xmpp/node_modules/node-xmpp-client/node_modules/node-xmpp-core/lib/Connection.js:310:17) 23:34:58.140 [pimatic] error:> at emitOne (events.js:82:20) 23:34:58.140 [pimatic] error:> at TLSSocket.emit (events.js:169:7) 23:34:58.140 [pimatic] error:> at TLSSocket.emit (/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:63:24) 23:34:58.140 [pimatic] error:> at readableAddChunk (_stream_readable.js:153:18) 23:34:58.140 [pimatic] error:> at TLSSocket.Readable.push (_stream_readable.js:111:10) 23:34:58.140 [pimatic] error:> at TLSWrap.onread (net.js:537:20) 23:34:58.140 [pimatic] error:> This is most probably a bug in pimatic or in a module, please report it! 23:34:58.145 [pimatic] warn: Keeping pimatic alive, but could be in an undefined state, please restart pimatic as soon as possible!
This is my config:
{ "plugin": "xmpp", "user": "butler@localhost", "password": "XXXXXX", "adminId": "admin@localhost", "defaultId": "my-account@gmail.com", "nickId": "pimatic", "keepaliveInterval": 5 }
-
New version is online. Make an update and
your error shouldn’t come anymore.For BugFix:
Please activate debug mode and send me"[xmpp recieved message:]"
after a pimatic restart.
So i can understand your problem.One hint for the config.
adminID is the jabber user who is allowed to send messages to pimatic.
defaultID ist the jabber user to whom messages are send in rules where the tojid value is not declared. -
@kosta wow, that was fast Thank you very much, that made my pimatic install send it’s first message to my local ejabber. I’m not able to send a message to my xmpp at gmail yet but that’s a matter of configuring ejabber i suppose.
BTW there’s a typo in the readme. In the config section there is a comma missing after “nickId”: “pimatic” which made my first attempt fail. And thanks for clearing up the adminID and defaultID, that was a bit confusing
-
You are welcome. I use like you a local ejabberd service on my pi,
and xabber on my phone.
I think ServerToServer forwarding is not so easy.Maybe you can use two accounts on the same public service provider.
-
@kosta yeah i’ll also give it a try with a public jabber/xmpp service and keep you posted if i run into trouble
One more question: If i don’t want anyone to be able to send messages to pimatic, can i just leave out the adminID?
-
@kosta It’s been a while, but how can i control a ButtonsDevice with pimatic-xmpp?
-
The plugin interpretes the same syntax as the rule manager.
Send a message with: “press button button-name”.
Please check if this works.The second way is to define a rule with a short command:
When received "keyword1" then press button ...
-
@kosta “press button button-name” gives me “Command not found”.
When trying to make a rule i get “Could not find an provider that decides next predicate of “received “test””.”
Am I doing something wrong here?
-
i have seen, that a i have a typo in the predicate provider.
i will create a hot fix this evening.When receiced "keyword1" then press button ...
But the “press button button-name” command should work.
What type of button device is it? A dummybuttondevice?
Please try once again with the button id from the button array. -
@kosta it’s a plain ButtonsDevice. I tried with button name, with ID,and also with the ID of the button ‘inside’ ButtonsDevice under ‘Buttons to display’ all come up with ‘command not found’.
Thanx in advance for the hotfix
-
@fregger That’s weird. It’s the same syntax as in the rule manager.
I have no errors, even when I send two commands linked together with and.
“press button tv-on and toggle Deckenlampe”In principle, all commands can be tested in the rulemanager.
the plugin uses the same action parser.From the rule manager Buttons are only accessable by the button-id inside the “Buttons to display” table.
(no names) -
@kosta ‘behind’ the button i was testing there is a rule ‘send chat tojid’. I guess it does not like that: an incoming xmpp message triggering an outgoing one. It does work with the window shutter buttons i have in place, so no worries!
-
@kosta Thanks for the update (and the plugin of course). I got rid of forementioned ButtonsDevice and made a new one. Everything is working well now