Search found 1361 matches

by dannybloe
Wednesday 04 July 2018 14:16
Forum: dzVents
Topic: See 'running' switchOn.after Secs/Mins/Hours
Replies: 6
Views: 197

Re: See 'running' switchOn.after Secs/Mins/Hours

Strange that you for me can decide if its matter or not. Didn't say it matters to you and I don't care if it does to be honest. I meant schedule info for switches probably doesn't change during the script execution if you have long delays set like 36 hours. Just was curious if it's possible, appare...
by dannybloe
Wednesday 04 July 2018 9:13
Forum: dzVents
Topic: See 'running' switchOn.after Secs/Mins/Hours
Replies: 6
Views: 197

Re: See 'running' switchOn.after Secs/Mins/Hours

I guess it's somewhere in the database. And it wouldn't matter much in your case but you can do complex scheduling like switchOn().afterSec(3).forSec(5).repeat... etc. Then it would matter.
by dannybloe
Wednesday 04 July 2018 7:54
Forum: dzVents
Topic: See 'running' switchOn.after Secs/Mins/Hours
Replies: 6
Views: 197

Re: See 'running' switchOn.after Secs/Mins/Hours

That's correct. It is not possible. I guess the information would be inaccurate anyway as it is possible that a timer goes off during script execution.
by dannybloe
Sunday 01 July 2018 8:28
Forum: Bugs
Topic: At 'active = false,' the script is still monitored for errors
Replies: 1
Views: 111

Re: At 'active = false,' the script is still monitored for errors

Yes, I know what you mean but it can't be done. Lua loads all the scripts as a Lua module and at that moment it is parsed and evaluated as well. There is nothing I can do about that other than writing my own parsers in Lua and that makes everything horribly slow. So, there are two options: make sure...
by dannybloe
Sunday 01 July 2018 8:24
Forum: dzVents
Topic: 'General purpose' timers
Replies: 22
Views: 588

Re: 'General purpose' timers

No, that's not possible like this. dzVents doesn't have any state between script runs. It is started by Domoticz and when it is finished there is nothing that keeps running. So your delayed function doesn't live on when the script is finished (and the scope with all your variables is gone too). No, ...
by dannybloe
Friday 29 June 2018 15:57
Forum: dzVents
Topic: 'General purpose' timers
Replies: 22
Views: 588

Re: 'General purpose' timers

Yes but you are misusing the httpRequest here. But it indeed works.
by dannybloe
Friday 29 June 2018 14:23
Forum: dzVents
Topic: 'General purpose' timers
Replies: 22
Views: 588

Re: 'General purpose' timers

Now well, that is certainly an interesting idea! I'll consider it...
by dannybloe
Friday 29 June 2018 12:58
Forum: dzVents
Topic: 'General purpose' timers
Replies: 22
Views: 588

Re: 'General purpose' timers

dzVents is a pure slave of Domoticz. If there is no event then nothing happens. So you need something that triggers the event system.
by dannybloe
Friday 29 June 2018 12:07
Forum: dzVents
Topic: 'General purpose' timers
Replies: 22
Views: 588

Re: 'General purpose' timers

Just create one dummy switch with it's own event script for these purposes. And set it in whatever script with an .afterXXX().
by dannybloe
Friday 29 June 2018 11:46
Forum: dzVents
Topic: 'General purpose' timers
Replies: 22
Views: 588

Re: 'General purpose' timers

Eh... use the timer trigger?
by dannybloe
Thursday 28 June 2018 12:29
Forum: dzVents
Topic: Error: attempt to index global 'domoticz' (a nil value) [Solved]
Replies: 6
Views: 228

Re: Error: attempt to index global 'domoticz' (a nil value) [Solved]

You are mixing two worlds of scripting. Your trigger code for Button1 is classic Lua and not dzVents. There is no domoticz object in classic Lua there. Rewrite your trigger code using dzVents and it should work.
by dannybloe
Tuesday 26 June 2018 7:12
Forum: dzVents
Topic: can I do forEach on a table in global_data?
Replies: 1
Views: 154

Re: can I do forEach on a table in global_data?

That's correct. forEach is a dzVents construct that is implemented for the various collections. So for other stuff you will have to do a standard Lua for loop.
by dannybloe
Monday 25 June 2018 21:45
Forum: dzVents
Topic: dzVents 2.4.6. script not working anymore [Solved]
Replies: 7
Views: 325

Re: dzVents 2.4.6. script not working anymore [Solved]

Check the dump and inspect the value for the state.
by dannybloe
Monday 25 June 2018 21:06
Forum: dzVents
Topic: dzVents 2.4.6. script not working anymore [Solved]
Replies: 7
Views: 325

Re: dzVents 2.4.6. script not working anymore [Solved]

You can dump all attributes of the device in the log: device.dump(). Perhaps then you can see what’s wrong.
by dannybloe
Thursday 21 June 2018 8:36
Forum: Bugs
Topic: [solved] Checking persistent data with history, while the script initializes, gives an error [SOLVED]
Replies: 3
Views: 193

Re: Checking persistent data with history, while the script initializes, gives an error [SOLVED]

getLatest() returns a data table or nil if there is no data. Your check is not correct:

Code: Select all

local latest = counter.getLatest()
if (latest == nil) then
    ...
You can also check the size:

Code: Select all

if (counter.size == 0) then
   ...
by dannybloe
Monday 18 June 2018 18:20
Forum: dzVents
Topic: Persistent (global)data save Time()
Replies: 5
Views: 277

Re: Persistent (global)data save Time()

Yes but it is not needed as I explained above. You can however extract the raw time string and store that and feed that back into Time() when you need it again.
by dannybloe
Monday 18 June 2018 14:47
Forum: Suggestions
Topic: DzVents: Make rooms available as device groups
Replies: 18
Views: 803

Re: DzVents: Make rooms available as device groups

Or use the description field and use that in your scripts.
by dannybloe
Monday 18 June 2018 14:26
Forum: Suggestions
Topic: DzVents: Make rooms available as device groups
Replies: 18
Views: 803

Re: DzVents: Make rooms available as device groups

All the type information is already on the Device object so that should not be so hard.
by dannybloe
Monday 18 June 2018 12:37
Forum: dzVents
Topic: Persistent (global)data save Time()
Replies: 5
Views: 277

Re: Persistent (global)data save Time()

Don't save the Time object but just the raw value. If you use historical=true with persistence you automatic get a time stamp on your data. So, define your persistent variable with history = true and maxItems = 1 and simply store the state value in there. Then you can easily read the time stamp of t...
by dannybloe
Monday 18 June 2018 7:19
Forum: Suggestions
Topic: DzVents: Make rooms available as device groups
Replies: 18
Views: 803

Re: DzVents: Make rooms available as device groups

Yes, it is already on my list. Maybe for 2.5.