Easy Scripting App - Documentation/Example

Discussions about Z-Way software and Z-Wave technology in general
captador
Posts: 13
Joined: 02 Dec 2016 22:02

Re: Easy Scripting App - Documentation/Example

Post by captador »

Probably code/js device is enough. Haven't tried them yet.

Then EasyScripting will be left as pure event-driven JS mechanism, although If->Then with JS device might work the same way.

I guess some wiki page at github about advance use cases above typical if-then/logical-rule/scene would be nice.

update: personally i am lazy to dive into developers guides and code suggestions of easyscript is too attractive. Plus i prefer to keep logic exposed as devices/scenes to have it as visual routines instead of logic buried into a code. In simple scenarios it works better than own app or script.
For now i made a dummy toggle device that is controlled by a scene and listened by easyscript. Without much rational thinking, it looks as preferable way for now.

ridewithstyle
Posts: 124
Joined: 02 Jan 2016 01:20

Re: Easy Scripting App - Documentation/Example

Post by ridewithstyle »

Hello Poltos,

I myself am also trying to expand my usage of easy Scripting (Halloween Season demands upgrades).

Currently I am trying to react to triggered scene (motion detection) and trigger some random scene out of a predefined set, as there currently is no such mechanism as app freely available. Things I would normally use in any

/dev/urandom % no_of_secenes
case statement with enumerated scenes to trigger

So yea, listening to a scene from the easyscripting app would be awesome, also being able to trigger scenes from the app. Without I would need a dummy switch that is being triggered from the scene which triggers easyscripting which then triggers a different switch that triggers a scene. A lot of functionally redundant scene-switch-app-switch-scene translation work because easy scripting doesn't work with scenes (yet).

As foreign language develeoper, your eventually mentioned code/js is probably the best way to go forward but just as with easyscripting initially, I lack the proper kickstarter/example/template to adapt and evolve from.

regards,
rws

User avatar
PoltoS
Posts: 5956
Joined: 26 Jan 2011 19:36

Re: Easy Scripting App - Documentation/Example

Post by PoltoS »

@ridewithstyle Easy Scripting can listen for Scenes activation too - exactly like for motion sensor. So no need in additional Dummy Devices. Just enable the scene and it will trigger EasyScripting code.

BTW, instead of /dev/urandom use Math.random() < 1/N (for N % probability). I don't think you need a so good random generator for Halloween ;)))

Also check for random (in search field) on http://developer.z-wave.me/?uri=public#/web/apps

ridewithstyle
Posts: 124
Joined: 02 Jan 2016 01:20

Re: Easy Scripting App - Documentation/Example

Post by ridewithstyle »

PoltoS wrote:
26 Oct 2020 19:58
@ridewithstyle Easy Scripting can listen for Scenes activation too - exactly like for motion sensor. So no need in additional Dummy Devices. Just enable the scene and it will trigger EasyScripting code.

BTW, instead of /dev/urandom use Math.random() < 1/N (for N % probability). I don't think you need a so good random generator for Halloween ;)))

Also check for random (in search field) on http://developer.z-wave.me/?uri=public#/web/apps
Hi PoltoS,

thanks for the reply, always happy when you point out the obvious like Math.random() - no sarcasm - because I feel stupid about not knowing the JavaScript Basics. Seems like I really need to find the time for a JavaScript online course. And - btw - my Halloween setup was to be reckoned with.

Remote Doormat triggered and ESP8266 MQTT client that fed my scene into ZWay. After that, smoke machine, strobe lights, crawling Zombies, Screaming and Moving Ghosts and - my personal favourite - my Dimmer-based Audio boxes. Those Boxes pretend to be a dimmer: 0-7 is volume, 99 is reboot, everything in between is taken as index from an attached SD-Card. Hence the "random" scene need, round robin seemed too trivial.

But I digress...

Thanks!

edit: Seems I have been missing out because I use Firefox and only rely on the documentation. The fancy addition is only possible in chrome so adding

Code: Select all

### DummyDevice_1XX // your-name-here
or in my case

Code: Select all

### LightScene_1xx// your-name-here
to documentation would be nice and would have saved my question. Also

Code: Select all

console.log("yourdebug")
would've saved me some time. It might seem trivial to JavaScript-Devs but to someone coming to ZWay without that it would help. Thx


rws

malik123
Posts: 1
Joined: 20 Nov 2020 18:22

Re: Easy Scripting App - Documentation/Example

Post by malik123 »

For what reason to that? You cavern Code Device and JS Code application for this. In the event that you need it since you like EasyScripting language structure partners, indeed, a spurious scene will be the arrangement. We can improve EasyScripting to add a checkbox to make a Dummy Scene directly from the EasyScripting. Is it something beneficial?

Post Reply