Page 1 of 1

notification to one phone only

Posted: Thursday 24 September 2020 14:06
by snellejellep
Hi all,

i want to send a notification to my phone when my 3d printer is done and use this script:

Code: Select all

return {
	on = {
		devices = {
			'3d printer energy'
		}
	},
	execute = function(dz, device)
	    local energy        = dz.devices("3d printer energy")
	    local notify        = dz.devices("notify 3d printer")
	    
	    if energy.actualWatt < 10 and energy.actualWatt ~= 0 and notify.lastUpdate.minutesAgo > 60  then
	        dz.notify('3d printer', 'de 3d printer is klaar', dz.PRIORITY_NORMAL, '', '824', dz.NSS_GOOGLE_CLOUD_MESSAGING)
	        notify.switchOn()
        end
	end
}
this script should send a notification to only my phone but it sends it to all users with the android app installed which is annoying them.
is it possible that it only sends a push notification to my phone only?
i hope someone will have an answer.

Re: notification to one phone only

Posted: Thursday 24 September 2020 15:08
by waaren
snellejellep wrote: Thursday 24 September 2020 14:06 is it possible that it only sends a push notification to my phone only?
From the dzVents wiki:
"extra is notification subsystem specific. For NSS_FIREBASE you can specify the target mobile (‘midx_1’, midx_2, etc..)."
( NSS_FIREBASE and NSS_GOOGLE_CLOUD_MESSAGING ) are synonyms for the sane notification subsystem

Implementation example in this post

Re: notification to one phone only  [Solved]

Posted: Thursday 24 September 2020 15:48
by snellejellep
waaren wrote: Thursday 24 September 2020 15:08
snellejellep wrote: Thursday 24 September 2020 14:06 is it possible that it only sends a push notification to my phone only?
From the dzVents wiki:
"extra is notification subsystem specific. For NSS_FIREBASE you can specify the target mobile (‘midx_1’, midx_2, etc..)."
( NSS_FIREBASE and NSS_GOOGLE_CLOUD_MESSAGING ) are synonyms for the sane notification subsystem

Implementation example in this post
I totally missed that, thank you!