Hello
I have looked at the wiki for DzVents and can't find how domoticz.notify works.
I like to send a custom http action notification.
TIA
Daniel
WIKI: domoticz.notify ? [Solved]
Moderator: leecollings
- Varazir
- Posts: 487
- Joined: Friday 20 February 2015 22:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
WIKI: domoticz.notify ?
Raspberry PI 4 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Several IKEA devices/z-wave devices
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: WIKI: domoticz.notify ?
notify in dzVents:
notify(subject, message, priority, sound, extra, subsystem): Function. Send a notification (like Prowl). Priority can be like domoticz.PRIORITY_LOW, PRIORITY_MODERATE, PRIORITY_NORMAL, PRIORITY_HIGH, PRIORITY_EMERGENCY. For sound see the SOUND constants below. subsystem can be a table containing one or more notification subsystems. See domoticz.NSS_xxx types.
so for http use domoticz.NSS_HTTP as notification subsystem. What the HTTP notification does is defined in the domoticz settings -> notifications page and not controlled by dzVents.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- Varazir
- Posts: 487
- Joined: Friday 20 February 2015 22:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: WIKI: domoticz.notify ?
So domoticz.NSS_HTTP('subject', 'message') should work?waaren wrote: Friday 18 January 2019 21:22notify in dzVents:
notify(subject, message, priority, sound, extra, subsystem): Function. Send a notification (like Prowl). Priority can be like domoticz.PRIORITY_LOW, PRIORITY_MODERATE, PRIORITY_NORMAL, PRIORITY_HIGH, PRIORITY_EMERGENCY. For sound see the SOUND constants below. subsystem can be a table containing one or more notification subsystems. See domoticz.NSS_xxx types.
so for http use domoticz.NSS_HTTP as notification subsystem. What the HTTP notification does is defined in the domoticz settings -> notifications page and not controlled by dzVents.
Raspberry PI 4 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Several IKEA devices/z-wave devices
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: WIKI: domoticz.notify ?
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)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- Varazir
- Posts: 487
- Joined: Friday 20 February 2015 22:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: WIKI: domoticz.notify ?
When you say it you are ofc rightwaaren wrote: Saturday 19 January 2019 0:01No.
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)
Thanks will try
Raspberry PI 4 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Several IKEA devices/z-wave devices
- Varazir
- Posts: 487
- Joined: Friday 20 February 2015 22:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: WIKI: domoticz.notify ?
I get thiswaaren wrote: Saturday 19 January 2019 0:01No.
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)
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)Raspberry PI 4 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Several IKEA devices/z-wave devices
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: WIKI: domoticz.notify ? [Solved]
If you look at your script you will see a line starting with execute = function(Varazir wrote: Thursday 24 January 2019 10:23I get thiswaaren wrote: Saturday 19 January 2019 0:01No.
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)
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)
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)Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest