notification to one phone only  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

notification to one phone only

Post 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.
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: notification to one phone only

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: notification to one phone only  [Solved]

Post 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!
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest