Sending SMS with Clickatell

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
LordMax
Posts: 35
Joined: Saturday 10 April 2021 21:24
Target OS: Windows
Domoticz version: 2021.1
Contact:

Sending SMS with Clickatell

Post 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
User avatar
waltervl
Posts: 5851
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Sending SMS with Clickatell

Post 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
}
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
DickNL
Posts: 5
Joined: Saturday 05 September 2020 18:18
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Sending SMS with Clickatell

Post 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....
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest