Page 1 of 1

Sending SMS with Clickatell

Posted: Monday 19 July 2021 17:08
by LordMax
Hi!

I am trying to setup clickatell with domoticz. I cannot get it to work. It works perfecly via clickatells website but not from domoticz. On the Domoticz Wiki it is stated that it needs 5 fields to fill in but I only have 2.. I will attach a file of my setup (hidden my real number ofc). Thanks beforehand!

Best regards Max

Re: Sending SMS with Clickatell

Posted: Monday 19 July 2021 22:08
by waltervl
I also could not get it to work.
In the end I made a dzVents script doing the task.

Code: Select all

return {
	on = {
		devices = {
			121, 145, 148, 149 --- Rookmelders
		}
	},
	execute = function(domoticz, device)
		if domoticz.devices(121).state == 'On' or domoticz.devices(145).state == 'On' or domoticz.devices(148).state == 'On' or domoticz.devices(149).state == 'On' then 
		      domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
		      local url1 = "https://platform.clickatell.com/messages/http/send?apiKey=Xxxccc==&to=316xxxxxxx&content=BRANDMELDING+ROOKMELDER+THUIS"
		      local url2 = "https://platform.clickatell.com/messages/http/send?apiKey=xxxxxxxxxxxxx==&to=31xxxxxxxxx&content=BRANDMELDING+ROOKMELDER+THUIS"
            domoticz.openURL(url1)
            domoticz.openURL(url2)
        end    
		
	end
}

Re: Sending SMS with Clickatell

Posted: Saturday 21 October 2023 21:42
by DickNL
I have it working for 13 smoke detectors and 4 persons (tenants) to be SMS'ed in case of alarm.
Make a script for each smoke detector essentially doing: (I use Blocky)
if smoke on, do message box URL:
https ://platform.clickatell.com/messages/http/sendapiKey=Xxxccc==&to=316xxxxxxx&content=BRANDMELDING+ROOKMELDER+THUIS
(space added after https only for readability here, leave out in the string you compose and paste.)

Do NOT use the message "http://"- box! Because you need 'httpS' and that's in the clickatell-link but not in the http-box. It took me a day to realize.
So, use the URL-box. That executes the link the right way.
If you need to SMS/text more people, add a copy of the URL-box with content as above (with appropriate phone number!) to the execution part of the script. Make sure you have no spaces in the clickatell-link. I had one before the phonenumber. Also took me a day to find out...

Good Luck! PS. Clickatell.com proves not to be the fastest SMS-gateway/provider....