Page 1 of 1

New functionality, "Command line" notification

Posted: Tuesday 26 April 2016 9:02
by ded38fr
Hello,

Is it possible to add a "Command line" notification, in parameters.

By this way, we can send notifications to espeak, for example, and domoticz could be able to speak very simply, or to any system command/application.


Thanks in advance for your help,

Cheers :D

Re: New functionality, "Command line" notification

Posted: Thursday 29 June 2017 10:30
by lost
ded38fr wrote:Hello,
Is it possible to add a "Command line" notification, in parameters.
By this way, we can send notifications to espeak, for example, and domoticz could be able to speak very simply, or to any system command/application.
I agree this one would be interesting. Either trough notification or maybe (easier to implement?), in the switches way: By generalizing the action on/off script/http commands that already exist.

Allowing such possibility for measurement devices (as electric consumption, lux meters...) to trigger a script on thresholds would be very nice.

For instance, I already have a sensor in my garage on the side door that have PIR (that'll trigger if main car door is opened)/open-switch(pedestrian side door)/Lux (was unused for now).

I just installed a new front door with a radio command that can't be domotized without added modules. The childrens like to play with the remotes & may open the door doing so. So I'd like to be notified, for now, using Lux meter (for instance, if lux>250, espeak "Garage door may be opened").

At the moment, without scripting, I can only send a mail I'll not notice immediately (& the children will not get an immediate&easy feedback to reverse their mistake & close the door).

Re: New functionality, "Command line" notification

Posted: Thursday 29 June 2017 10:45
by Egregius
Start scripting and everything is possible.
Quite easy with pass2php to execute other scripts with variables send to them.
Only your imagination is the limit...

Re: New functionality, "Command line" notification

Posted: Thursday 29 June 2017 13:14
by lost
Egregius wrote:Start scripting and everything is possible.
Quite easy with pass2php to execute other scripts with variables send to them.
Only your imagination is the limit...
I already started scripting, in Python for more complex stuff (or running as a service & intecracting with Domoticz) & Lua when mostly dealing with Domoticz internals. But well, development is my job (even if it's on embedded telecom products) and using mostly C ans asm. Everyone does not have required skills.

That's still the best to do for functionalities closely tied to your own setup & that may not make sense for others & not worth the adding in Domoticz core.

On scripting subject, Domoticz remains quite heterogeneous : On/Off actions require shell scripts (=> must do wrappers to call Python there for instance) ; Internals = Lua is best, but the language itself is quite limited. Python, even if it's a language that have drawbacks (identation nightmare can lead to code execution that is not the one you can see editing it: That's IMO a major flaw and require being very careful with editors configuration for tabs), is the one that remains accessible & with a lot of possibilities/libraries.

But at the moment, scripting in Domotics requires mixing Lua/Shell/Python... That's sometimes a pain for me, immagine for others?!

This requirement, indeed, is just being coherent vs switches tab possibilities and a step to make Domoticz accessible to more people.

Re: New functionality, "Command line" notification

Posted: Thursday 29 June 2017 14:11
by Egregius
You forgot to mention PHP as language :lol:
My setup is quite straight forward. A lua script pushes all updates to PHP's apcu cache.
From their I'll pull them in all the scripts. Works flawless, fast and very versatile.
I don't believe that all options should be implemented natively in Domoticz. It will make the package bigger, harder to maintain and easier to have bugs.

Re: New functionality, "Command line" notification

Posted: Friday 07 July 2017 9:52
by deennoo
Why don't you use http notification ? This allow to run script. Or maybe There is something i miss understandImage