Page 1 of 1

domoticz.notify double message in Telegram

Posted: Friday 27 October 2017 16:20
by woody4165
Hi

in a script where I use the domoticz.notify command I see that message sent to Telegram (defined in the Domoticz->Settings) appears twice.
I have also defined Pushbullet as notification system and I get only one message there.

Anyone with this issue?
Any suggestion?

Thanks

This is my simple code:

Code: Select all

return {

	active = true, -- set to false to disable this script

	on = {

		timer = {
			'at sunset'
		}
	},

	execute = function(domoticz)
        if domoticz.devices('Living Lamp').state == 'Off' then 
    		if domoticz.devices('IsAtHome').state == 'On' then
                	domoticz.devices('Living Lamp').switchOn().checkFirst()
		    	domoticz.notify('Light info', 'Qualcuno è a casa ed è sera. Accendo la piantana!', domoticz.PRIORITY_NORMAL)
                end
        end
end
}

Re: domoticz.notify double message in Telegram

Posted: Friday 27 October 2017 16:31
by dannybloe
I think that's a domoticz issue. You can check if indeed only one command is sent back to Domoticz (turn debug mode on and see what the commandArray is after the scripts are completed).
I must say that I have created a couple of global_data.helpers function that do the notification instead of Domoticz (only works for GET requests). That gives me a lot more control over the notification. But that as a side-node.

Re: domoticz.notify double message in Telegram

Posted: Friday 27 October 2017 16:51
by woody4165
Thanks @dannybloe

Is it correct this to activate debug in domoticz?

I've added

Code: Select all

DAEMON_ARGS="$DAEMON_ARGS -loglevel 3 -debug -verbose -log /home/linaro/domoticz/domoticz.log"
in domoticz.sh and made

Code: Select all

sudo service domoticz.sh stop
sudo service domoticz.sh start
But I don't see nothing more in the Log monitor.

Re: domoticz.notify double message in Telegram

Posted: Friday 27 October 2017 17:22
by dannybloe
No. It’s the log level setting in Domoticz gui. Settings, others, dzVents.

Re: domoticz.notify double message in Telegram

Posted: Friday 27 October 2017 17:31
by woody4165
Ok, get it, thanks

This is the only debug message that should relate to

Code: Select all

2017-10-27 17:26:03.612 dzVents: Debug: [3] = SendNotification: Light info#Qualcuno è a casa ed è sera. Accendo la piantana!#0#pushover##
Now that you suggested me that could be a domoticz issue, I tried to define a notification directly in a device and leave the two notification systems I have in the script (but also if I define only Telegram) and I get the notification twice.

Then, I will open a bug in domoticz thread.

Thanks again

Re: domoticz.notify double message in Telegram

Posted: Friday 27 October 2017 19:19
by dannybloe
Good luck.