In Linux I’m able to send an SMS using Pushbullet with the following command:
curl --header 'Access-Token: o.XXxxxXXXXxxxxXXXXxxx' --header 'Content-Type: application/json' --data-binary '{"push":{"conversation_iden": "+336XXXXXXX", "message": "SOME TEXT TO SEND WITH SMS ON THE MOBILE", "package_name": "com.pushbullet.android", "source_user_iden": "xxxXXXxxXX", "target_device_iden": "xxXXxxxXXXxxxxXXX", "type": "messaging_extension_reply"},"type":"push"}' --request POST https://api.pushbullet.com/v2/ephemerals
I would like to use executeCommandLine to run the same command in a rule. Does anyone have a good idea on how I can escape the double quotation marks (just adding \ does not work)? The double quotation marks are lost if I use @@, and I’m not quite sure where to put them in any case…
If you can use a json builder, it would look even neater without the double quote escapes.
I don’t know off the top of my head which json library is available in OpenHAB without having to install any additional package. Maybe someone else can jump in and provide this info?