Search found 808 matches

by dannybloe
Friday 22 September 2017 8:49
Forum: Other questions and discussions
Topic: Vacation-mode
Replies: 14
Views: 506

Re: Vacation-mode

So, I thought of making some kind of thingy that would turn on my HUE lights at Sunset during my vacation, and also a light in my office during at a random time. It isn't that easy as I thought it would be. Thankfully I've enough time to try something out, as I won't go on vacation before the end o...
by dannybloe
Friday 22 September 2017 8:42
Forum: dzVents Lua Framework
Topic: dzVents 2.0 getting started video
Replies: 13
Views: 1570

Re: dzVents 2.0 getting started video

Nope. You can prefix the name with a $ then they don't show up in the GUI but are available in dzVents.
by dannybloe
Thursday 21 September 2017 19:55
Forum: dzVents Lua Framework
Topic: dzVents Error
Replies: 5
Views: 256

Re: dzVents Error

It should show that version in the About of Domoticz. I'm curious about these scripts actually.
by dannybloe
Tuesday 19 September 2017 7:46
Forum: Show your projects
Topic: Domotics touchscreen remote
Replies: 5
Views: 491

Re: Domotics touchscreen remote

This is awesome! I do like the star trek one the best. Didn't know about that display. Cool stuff.
by dannybloe
Tuesday 19 September 2017 7:36
Forum: dzVents Lua Framework
Topic: Write in description Case
Replies: 2
Views: 179

Re: Write in description Case

For what I know is that you have to use the GUI api to do so as there is no other way that I know of: This is how I do it in my dzVents integration tests: function updateSwitch(idx, name, description, switchType) local url = "type=setused&idx=" .. tostring(idx) .. "&name=" .. name .. "&description="...
by dannybloe
Monday 18 September 2017 20:49
Forum: dzVents Lua Framework
Topic: Persistent data error
Replies: 2
Views: 121

Re: Persistent data error

You have to define the data section as a sibling of the on-section. Not inside the on-section.

😀
by dannybloe
Monday 18 September 2017 7:39
Forum: dzVents Lua Framework
Topic: Where does the "domoticz url" setting come from?
Replies: 3
Views: 180

Re: Where does the "domoticz url" setting come from?

That's weird indeed. I'd expect it to be 8080 (by default). dzVents gets that value from the event-system. Reading the C++ code it seems it gets it from the settings: our_listener_port = web_settings.listening_port;
by dannybloe
Monday 18 September 2017 7:30
Forum: dzVents Lua Framework
Topic: dzVents Error
Replies: 5
Views: 256

Re: dzVents Error

Mm, that's interesting indeed. Normally you will have this error if the script tries to execute an http call and wait for the results. If there's no response from the call, then you might pass the 10s boundary. But in your example nothing special happens. Please dig a bit deeper indeed.
by dannybloe
Sunday 17 September 2017 12:00
Forum: dzVents Lua Framework
Topic: Check dead devices help
Replies: 3
Views: 161

Re: Check dead devices help

I think you could try to change the last if-statement to:

Code: Select all

if (message ~= "") then
. I suspect Lua evaluates an empty string as true. The idea of the script above is that a message is constructed in the loop and that if there is something in the message it will be emailed.
by dannybloe
Thursday 14 September 2017 14:55
Forum: dzVents Lua Framework
Topic: .filter pattern and functions
Replies: 1
Views: 106

Re: .filter pattern and functions

You have to turn it around. First you do the filter and with the filtered results you do the forEach: domoticz.devices() .filter(function(device) return (device.name:sub(1,4) == 'NUT_') end .forEach(function(device) -- do something with device end The filter function returns list that you can use in...
by dannybloe
Wednesday 13 September 2017 19:55
Forum: Other questions and discussions
Topic: use IDX with devicechanged and/or otherdevices
Replies: 3
Views: 174

Re: use IDX with devicechanged and/or otherdevices

Of course it does! It's trivial with dzVents!
by dannybloe
Wednesday 13 September 2017 19:54
Forum: Bugs and Problems
Topic: Lua scripts and Blocky events not working after beta update 3.8392
Replies: 8
Views: 492

Re: Lua scripts and Blocky events not working after beta update 3.8392

This was a very necessary UI fix as the switch was very confusing (double negatives). Guess the migration to the new (inverted) state didn't work out wel for everybody.
by dannybloe
Tuesday 12 September 2017 21:26
Forum: dzVents Lua Framework
Topic: problem with Time object
Replies: 2
Views: 164

Re: problem with Time object

Good catch! I fixed it in the documentation.
by dannybloe
Tuesday 12 September 2017 7:23
Forum: Suggestions
Topic: "Set xx FOR" seconds instead of minutes
Replies: 3
Views: 380

Re: "Set xx FOR" seconds instead of minutes

It is already possible

Code: Select all

On FOR 3 SECONDS AFTER 1 MINUTE REPEAT 2 INTERVAL 5 SECONDS
by dannybloe
Monday 11 September 2017 19:41
Forum: dzVents Lua Framework
Topic: Compare 'domoticz.time' with '20 minutes after sunrise' how?
Replies: 10
Views: 428

Re: Compare 'domoticz.time' with '20 minutes after sunrise' how?

Code: Select all

return ((domoticz.time.secondsSinceMidnight/60) +20) == domoticz.time.sunriseInMinutes)
Something like that?
by dannybloe
Monday 11 September 2017 12:03
Forum: dzVents Lua Framework
Topic: Compare 'domoticz.time' with '20 minutes after sunrise' how?
Replies: 10
Views: 428

Re: Compare 'domoticz.time' with '20 minutes after sunrise' how?

In the upcoming 2.3 you can do this:

Code: Select all

	on = {
		timer = {
			'between 05:45 and 180 minutes after sunrise'
		}
	}	
Until then you'll have to solve it in your execute block or create a timer function:

Code: Select all

	on = {
		timer = {
			function(domoticz) 
				-- timer logic here.
			end
		}
	}	
by dannybloe
Saturday 09 September 2017 15:21
Forum: dzVents Lua Framework
Topic: dzVents Using a Function From Another Event
Replies: 4
Views: 224

Re: dzVents Using a Function From Another Event

What about (domoticz.time.secondsSinceMidnight / 60)?
by dannybloe
Saturday 09 September 2017 10:30
Forum: dzVents Lua Framework
Topic: dzVents Using a Function From Another Event
Replies: 4
Views: 224

Re: dzVents Using a Function From Another Event

Well, that's what you get if you declare stuff in the global namespace. Hence my advice: always declare everything locally: local function getMinutes() end local myVar = 'bla' Even if you need a variable inside your code somewhere!! Use local. You have no idea what is already loaded and defined. Whe...
by dannybloe
Wednesday 30 August 2017 8:21
Forum: dzVents Lua Framework
Topic: afterSec(x)
Replies: 13
Views: 798

Re: afterSec(x)

Taking longer than expected as quite some changes have to made in the Domoticz event systems. Still working on that.
by dannybloe
Wednesday 30 August 2017 8:20
Forum: dzVents Lua Framework
Topic: Attempt to call field 'for_min' (a nil value)
Replies: 4
Views: 273

Re: Attempt to call field 'for_min' (a nil value)

for_min was the old syntax prior to 2.0.