Search found 17 matches

by Zweef
Tuesday 21 March 2017 22:23
Forum: LUA
Topic: Switch on/off when someone entering/leaving home (Ubiquiti)
Replies: 38
Views: 18904

Re: Switch on/off when someone entering/leaving home (Ubiquiti)

I already had the shell script updated, so if someone still want's to use this one, this is the updated code: ...... device.sh #!/bin/sh ..... I'm playing with/adapting your nice script and do have some progress with it. I'm just started to use Domoticz and (bash) scripts, so just be patient with ...
by Zweef
Tuesday 14 March 2017 20:29
Forum: LUA
Topic: [Noob, so help needed] Sending Telegram message when variable has changed
Replies: 14
Views: 3109

Re: [Noob, so help needed] Sending Telegram message when variable has changed

Okay!

Learning all the time, learning all the time.... 8-)

Thanks a lot, Jos!
by Zweef
Tuesday 14 March 2017 19:46
Forum: LUA
Topic: [Noob, so help needed] Sending Telegram message when variable has changed
Replies: 14
Views: 3109

Re: [Noob, so help needed] Sending Telegram message when variable has changed

The variable is updated by the Fibaro HC2 controller (through Domoticz API-command, JSON call ). If your script is in LUA, maybe you should remove all the ; you put everywhere ? ;) Agree it isn't needed but it shouldn't cause any issues either. I do this to because in the LUA early days it was ...
by Zweef
Sunday 12 March 2017 23:12
Forum: LUA
Topic: [Noob, so help needed] Sending Telegram message when variable has changed
Replies: 14
Views: 3109

Re: [Noob, so help needed] Sending Telegram message when variable has changed

Hmm, somehow my code is not triggered (yet).. commandArray = {} -- ------------------------------------------------------------------------------------------ -- ℹ Initialisation of user settings (change if necessary) ...
by Zweef
Sunday 12 March 2017 23:01
Forum: LUA
Topic: [Noob, so help needed] Sending Telegram message when variable has changed
Replies: 14
Views: 3109

Re: [Noob, so help needed] Sending Telegram message when variable has changed

It does but let me help a little: To retrieve the value of variable TestVariable: uservariables['TestVariable'] To set the variable to a new value: commandArray['Variable:TestVariable']='Some value' Have fun yet with scripting :-) Jos I do have fun, it's like all learning it again from scratch ...
by Zweef
Sunday 12 March 2017 22:03
Forum: LUA
Topic: [Noob, so help needed] Sending Telegram message when variable has changed
Replies: 14
Views: 3109

Re: [Noob, so help needed] Sending Telegram message when variable has changed

Thanks.

But it doesn't mention how to get the content from an user variable, as I read right.... :?
by Zweef
Sunday 12 March 2017 21:40
Forum: LUA
Topic: [Noob, so help needed] Sending Telegram message when variable has changed
Replies: 14
Views: 3109

Re: [Noob, so help needed] Sending Telegram message when variable has changed

Clear.

What is the command for getting the contents from a user variable?

In the lua example it's stated:
-- uservariables['yourvariablename'] = 'Test Value'
but that is used to write a content. Do I need
-- userContent = uservariables['yourvariablename']
to get the content?
by Zweef
Sunday 12 March 2017 21:15
Forum: LUA
Topic: [Noob, so help needed] Sending Telegram message when variable has changed
Replies: 14
Views: 3109

Re: [Noob, so help needed] Sending Telegram message when variable has changed

Just add an if that looks something like this: if uservariablechanged['variablename'] then -- your logic goes here end Jos That simple, huh! Thanks Jos. Just another another question, the commandArray = {} can this be inserted underneath the code-header instead of as first command? (ie what is this ...
by Zweef
Sunday 12 March 2017 20:27
Forum: LUA
Topic: [Noob, so help needed] Sending Telegram message when variable has changed
Replies: 14
Views: 3109

[Noob, so help needed] Sending Telegram message when variable has changed

Hi2UAll! I'm just starting with lua and need some (= a lot) assistance with this. So, please be patient to me! :mrgreen: Because the best way to learn is to have a goal. So, this is my first goal: When a variable is changed, send a Telegram message with the content from that variable. Variable name ...
by Zweef
Sunday 12 March 2017 19:38
Forum: LUA
Topic: [Noob Question] How to start with lua scripting?
Replies: 9
Views: 2252

Re: [Noob Question] How to start with lua scripting?

Okay, clear enough, Jos.

I will start with my first lua coding. I will make a new topic for that. Thanks.
by Zweef
Sunday 12 March 2017 19:24
Forum: LUA
Topic: [Noob Question] How to start with lua scripting?
Replies: 9
Views: 2252

Re: [Noob Question] How to start with lua scripting?

Thank you, Jos!

I saw some scripts published, but when to insert them in lua-events, I have error warnings.

Looks like variables like $test is not accepted. It should be without the $-sign. Does this mean this is one of the difference between lua-events and lua-scripts?
by Zweef
Sunday 12 March 2017 18:46
Forum: LUA
Topic: [Noob Question] How to start with lua scripting?
Replies: 9
Views: 2252

Re: [Noob Question] How to start with lua scripting?

Just another noob question though:

Whats the difference between lua scripts and lua code in events --> lua?
by Zweef
Sunday 12 March 2017 15:11
Forum: LUA
Topic: [Noob Question] How to start with lua scripting?
Replies: 9
Views: 2252

Re: [Noob Question] How to start with lua scripting?

DanM wrote:Print sends info to the domoitz log page.
Allright, clear! thanks.
by Zweef
Sunday 12 March 2017 14:13
Forum: LUA
Topic: [Noob Question] How to start with lua scripting?
Replies: 9
Views: 2252

Re: [Noob Question] How to start with lua scripting?

Hello, I would advice to check the wiki. There are sample scripts. You don't have to install additional software to use lua scripting. Thank you Hans for replying. I just noticed that scripts can be inserted in 'Events'. Can you tell me how I can debug new lua scripts? If a print-function is used ...
by Zweef
Saturday 11 March 2017 1:01
Forum: LUA
Topic: [Noob Question] How to start with lua scripting?
Replies: 9
Views: 2252

[Noob Question] How to start with lua scripting?

Hi! Can anyone explain how to use lua scripting? I'm just starting to use Domoticz. I do have some experience with lua (I use an Fibaro HC2 Z-wave controller at this time with self made lua scripts). Because I'm really fed up with Fibaro lack of transparency and closed source approach, I ...
by Zweef
Sunday 05 March 2017 23:03
Forum: Blockly
Topic: Update a text block with status of home from a variable
Replies: 1
Views: 1720

Re: Update a text block with status of home from a variable

Found it! Let me share..... It's possible by using Domoticz API . 1 - Enable access with no protection by adding 127.0.0.* in System Setup --> Local Networks (no username/password) 2 - Restart (in my case the Raspberry Pi 3) 3 - Add in Blocky --> Messages --> Open Url: with http:// 4a - Text-sensor ...
by Zweef
Sunday 05 March 2017 2:16
Forum: Blockly
Topic: Update a text block with status of home from a variable
Replies: 1
Views: 1720

Update a text block with status of home from a variable

Hi to you all! I'm quite new with Domoticz. So I have a really noob question. :mrgreen: I have made a variable with a string which represent the status of my home (Home, Sleeping, Away etc). I want to show it in a text (or alert?) utility virtual device. How can I do that? It seems I can't use ...