Varazir wrote: Thursday 24 January 2019 10:23
waaren wrote: Saturday 19 January 2019 0:01
Varazir wrote: Friday 18 January 2019 23:54
So domoticz.NSS_HTTP('subject', 'message') should work?
No.
syntax is notify(subject, message, priority, sound, extra, subsystem)
so you should use something like
Code: Select all
domoticz.notify("subject","message", domoticz.PRIORITY_NORMAL,nil,nil,domoticz.NSS_HTTP)
I get this
Code: Select all
2019-01-24 07:26:41.700 Status: dzVents: Error (2.4.10): LightControl: An error occured when calling event handler Detection
2019-01-24 07:26:41.700 Status: dzVents: Error (2.4.10): LightControl: ...domoticz/scripts/dzVents/generated_scripts/Detection.lua:84: attempt to index global 'domoticz' (a nil value)
Code: Select all
domoticz.notify("IKEA Hallen","Stänger av Lamporna i hallen", domoticz.PRIORITY_NORMAL,nil,nil,domoticz.NSS_HTTP)
If you look at your script you will see a line starting with execute = function(
The first parameter in this line is the reference to the domoticz object with all devices, variables, constants, etc..
You can give it any valid name (also called identifier) In Lua and dzVents a name can be any string of letters, digits, and underscores, not beginning with a digit and not one of the reserved words (and, break, do, else, elseif, end, false, for, function, if, in,local, nil, not, or, repeat, return, then, true, until, while)
So if you use domoticz as name you can reference any sub object in the domoticz object using that name followed by a dot "domoticz."
for example domoticz.devices() , domoticz.log, etc
If you choose dz as name you must use that so it would become dz.devices() dz.log, etc.
in your example is would become
Code: Select all
dz.notify("IKEA Hallen","Stänger av Lamporna i hallen", dz.PRIORITY_NORMAL,nil,nil,dz.NSS_HTTP)
Hope this clarifies