Page 4 of 5

iMessage Indigo Plugin [New Plugin]

PostPosted: Mon Jan 14, 2019 9:32 pm
by GlennNZ
bjones wrote:
GlennNZ wrote:
bjones wrote:
Hello! Is there a ways to enable full disk access on macOS Sierra?
If not, is it safe to say this is not compatible with older versions? Thanks!


Not sure. Didn’t think it {full disk access change} was needed - as the restricted disk access part of increased security in High Sierra and above..

Quick google should answer...

Would think should work fine on older versions - but remains untested by me.

Glenn



Sent from my iPad using Tapatalk


Hey Glenn, the only issue I am having is my inbound messages don't seem to register. I can send outbound messages just fine. I'm wondering if these are being blocked somehow.

Any suggestions? Thanks!


Might be disk access issue equivalent - as would have that effect
Turn debug logging on and pm me the result, and I’ll google disk access Sierra when I stop
moving ....

Glenn


Sent from my iPhone using Tapatalk

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Mon Jan 14, 2019 11:28 pm
by GlennNZ
Hi

Quick google - think Sierra and below need to alter 'permissions' given lack of full disk access.

For

Code: Select all
~/Library/Messages/

particularly the file
Code: Select all
~/Library/Messages/chat.db


This is the sql messages database the plugin reads (only reads) to get incoming messages and attachments (the mp4 audio files)

Should only need to be read access.
https://support.apple.com/kb/PH25287?locale=en_US

Someone with more Mac OS experience than me might like to chime in.. but give this a go in the first instance.

Glenn

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Sat Jan 19, 2019 7:30 am
by bjones
Sorry for the delay, Glenn!

I added the permissions to the items enclosed in the messages folder at your recommendation, restarted the plugin, and can't seem to receive messages (I've been able to send from indigo to my buddy device).

It does confirm that it connects to the database, I wonder if something is off with my config but I believe I've followed all of the steps correctly. Thanks!

Here's the log:

Code: Select all
 iMessage Plugin Debug           Restarting/or error. Stopping  thread.
   iMessage Plugin Debug           connectsql() method called.
   iMessage Plugin Debug           Removing Trigger Test iMessage Trigger (1978200985)
   iMessage Plugin Debug           shutdown() method called.
   Stopped plugin "iMessage Plugin 0.1.4"
   Starting plugin "iMessage Plugin 0.1.4" (pid 83849)
   iMessage Plugin                 
   iMessage Plugin                 ================================================ Initializing New Plugin Session =================================================
   iMessage Plugin                 Plugin name:                   iMessage Plugin
   iMessage Plugin                 Plugin version:                0.1.4
   iMessage Plugin                 Plugin ID:                     com.GlennNZ.indigoplugin.iMessage
   iMessage Plugin                 Indigo version:                7.2.0
   iMessage Plugin                 Python version:                2.7.10 (default, Feb  7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
   iMessage Plugin                 Python Directory:              /System/Library/Frameworks/Python.framework/Versions/2.7
   iMessage Plugin                 ==================================================================================================================================
   iMessage Plugin Debug           logLevel = 5
   Started plugin "iMessage Plugin 0.1.4"
   iMessage Plugin Debug           Starting Plugin. startup() method called.
   iMessage Plugin Debug           Adding Trigger Test iMessage Trigger (1978200985) - commandReceived
   iMessage Plugin Debug           connectsql() method called.
   iMessage Plugin Debug           ConnectSQL: Filename location for iMsg chat.db equals:/Users/brandonjones/Library/Messages/chat.db
   iMessage Plugin Debug           Connect to Database Successful.
   iMessage Plugin                 Connection to iMsg Database Successful.
   iMessage Plugin                 iMessage: Update Checking. Your Current version is: 0.1.4
   iMessage Plugin Debug           Current version is: 0.1.4
   iMessage Plugin Debug           Getting latest release from ghawken/iMessagePlugin...
   iMessage Plugin Debug           GET /repos/ghawken/iMessagePlugin/releases/latest
   iMessage Plugin Debug           HTTP Err result:  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  2790  100  2790    0     0   8875      0 --:--:-- --:--:-- --:--:--  8857

   iMessage Plugin Debug           ReturnCode:0
   iMessage Plugin Debug           Json results:{u'body': u'# 0.4.0\r\n\r\n# Wit.Ai Processing {Optional}\r\n\r\n![](https://github.com/Ghawken/iMessagePlugin/blob/master/DocumentPics/icon.png?raw=true)\r\n\r\n## Changelog:\r\n\r\n## 0.4.0\r\n\r\nUpdates to Plugin Config to show current status of requests/Updates/Delete/Generate\r\nCorrectly shows new App Access_token/App_ID\r\nSome bug fixes to deal with app creation errors\r\nRename Wit.Ai App to username+Indigo-iMessage (to allow multiple wit.ai apps for multiple Indigo installs, with one wit.ai access code only) (side-effect - makes development easier!)\r\nAs Plugin accesses app via Access_code only and not name, new name will only happen with deletion/creation of current app. 0.4.0 - Bug fix for this.\r\nLog Current Status in Menu - updates - useful for bug checking\r\nBeta: Device_Status intent - can ask \r\n"What is the status of {device_name}?"  \r\nAutomatically Updates wit.ai App when new version Plugin Installed\r\n\r\n', u'assets_url': u'https://api.github.com/repos/Ghawken/iMessagePlugin/releases/14547941/assets', u'name': u'0.4.0', u'published_at': u'2018-12-14T22:21:13Z', u'author': {u'following_url': u'https://api.github.com/users/Ghawken/following{/other_user}', u'events_url': u'https://api.github.com/users/Ghawken/events{/privacy}', u'avatar_url': u'https://avatars2.githubusercontent.com/u/6187293?v=4', u'url': u'https://api.github.com/users/Ghawken', u'gists_url': u'https://api.github.com/users/Ghawken/gists{/gist_id}', u'html_url': u'https://github.com/Ghawken', u'subscriptions_url': u'https://api.github.com/users/Ghawken/subscriptions', u'node_id': u'MDQ6VXNlcjYxODcyOTM=', u'repos_url': u'https://api.github.com/users/Ghawken/repos', u'received_events_url': u'https://api.github.com/users/Ghawken/received_events', u'gravatar_id': u'', u'starred_url': u'https://api.github.com/users/Ghawken/starred{/owner}{/repo}', u'site_admin': False, u'login': u'Ghawken', u'type': u'User', u'id': 6187293, u'followers_url': u'https://api.github.com/users/Ghawken/followers', u'organizations_url': u'https://api.github.com/users/Ghawken/orgs'}, u'url': u'https://api.github.com/repos/Ghawken/iMessagePlugin/releases/14547941', u'created_at': u'2018-12-14T21:58:26Z', u'target_commitish': u'wit.ai', u'tarball_url': u'https://api.github.com/repos/Ghawken/iMessagePlugin/tarball/0.4.0', u'html_url': u'https://github.com/Ghawken/iMessagePlugin/releases/tag/0.4.0', u'zipball_url': u'https://api.github.com/repos/Ghawken/iMessagePlugin/zipball/0.4.0', u'tag_name': u'0.4.0', u'node_id': u'MDc6UmVsZWFzZTE0NTQ3OTQx', u'draft': False, u'prerelease': False, u'upload_url': u'https://uploads.github.com/repos/Ghawken/iMessagePlugin/releases/14547941/assets{?name,label}', u'id': 14547941, u'assets': []}
   iMessage Plugin Debug           Latest release is: 0.4.0
   iMessage Plugin                 iMessage: Update Checking. The Github Latest release is: 0.4.0
   iMessage Plugin                 iMessage: Update Checking. Please visit the Plugin Store to Download
   iMessage Plugin Error           iMessage: Update Checking.  Update is Available.  Please check Store for details/download.

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Sat Jan 19, 2019 2:43 pm
by GlennNZ
bjones wrote:
Sorry for the delay, Glenn!
I added the permissions to the items enclosed in the messages folder at your recommendation, restarted the plugin, and can't seem to receive messages (I've been able to send from indigo to my buddy device).
It does confirm that it connects to the database, I wonder if something is off with my config but I believe I've followed all of the steps correctly. Thanks!


Thanks.
Can you either post or PM me the same debug log (with all debug options on)when you receive a message?

Glenn


Sent from my iPad using Tapatalk

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Sat Jan 19, 2019 7:45 pm
by bjones
That's actually the issue -- when I send to my indigo iMessage userI don't get any sort of log for a new message received, but it is of course received in iMessage.
GlennNZ wrote:
bjones wrote:
Sorry for the delay, Glenn!
I added the permissions to the items enclosed in the messages folder at your recommendation, restarted the plugin, and can't seem to receive messages (I've been able to send from indigo to my buddy device).
It does confirm that it connects to the database, I wonder if something is off with my config but I believe I've followed all of the steps correctly. Thanks!


Thanks.
Can you either post or PM me the same debug log (with all debug options on)when you receive a message?

Glenn


Sent from my iPad using Tapatalk

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Sat Jan 19, 2019 8:44 pm
by GlennNZ
bjones wrote:
That's actually the issue -- when I send to my indigo iMessage userI don't get any sort of log for a new message received, but it is of course received in iMessage.


Hmm
Even with all the debug options on?

Check the Plugins/Imessage Plugin/Show Current Status menu & post

+

PM me a long debug long with a few incoming messages - with all debug options on.
The log will be in
"Show Event Logs Folder" - from Log Window
/Library/Application Support/Perceptive Automation/Indigo 7.2/Logs/com.GlennNZ.indigoplugin.iMessage/plugin.log

G

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Sun Jan 20, 2019 9:17 am
by bjones
PM Sent!
GlennNZ wrote:
bjones wrote:
That's actually the issue -- when I send to my indigo iMessage userI don't get any sort of log for a new message received, but it is of course received in iMessage.


Hmm
Even with all the debug options on?

Check the Plugins/Imessage Plugin/Show Current Status menu & post

+

PM me a long debug long with a few incoming messages - with all debug options on.
The log will be in
"Show Event Logs Folder" - from Log Window
/Library/Application Support/Perceptive Automation/Indigo 7.2/Logs/com.GlennNZ.indigoplugin.iMessage/plugin.log

G

iMessage Indigo Plugin [New Plugin]

PostPosted: Sun Jan 20, 2019 9:38 pm
by GlennNZ
Hi all,

To follow this up - turns out that apple changed the date time format they were using between Sierra and High Sierra and above. It appears they always used a from 2001-01-01 custom UTC date time, with Mojave using Nanoseconds...

This was the problem above which with the help of bjones we tracked down in record time.

Have a new version 0.4.1 on github wit.ai branch fixing the issue for those on Sierra and below.
https://github.com/Ghawken/iMessagePlugin/tree/wit.ai

Those on Sierra and below will likely need to update their folder permissions for the iMessage Database, located here:
Code: Select all
~/Library/Messages


Glenn



Sent from my iPad using Tapatalk

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Wed May 22, 2019 2:18 pm
by whmoorejr
GlennNZ wrote:
Those on Sierra and below will likely need to update their folder permissions for the iMessage Database, located here:
Code: Select all
~/Library/Messages


That resolved the error message I was getting when receiving messages. I've only been using the plugin for about 5 hours now... but loving every minute of it.

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Sat Nov 09, 2019 1:24 pm
by t-star
pardon the newbie. I am trying to replace using AppleScript for all my messaging. I have loaded the plugin and it works good using the built in UI features. I want a little more control and want to start using the python code to call it and to send messages. I am new to python as well. Can someone post a python script that just sends a message using this plugin and that includes the current time in the message?

Thanks a ton!!

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Wed Dec 18, 2019 6:38 pm
by GlennNZ
Hi

Sorry been away, and not sure that teaching python via PM/forum ideal. :P
But can probably do most of what you what with the device or variable substitution power of Indigo.

Pretty sure the Messages Plugin Supports - if not I'll add. (sorry will look at code to confirm support, most of my plugins support it)

But basically if you send a message like

As you can see - supports Device and Variable Substitution
%%d:241092027:temperature%%

This means Device ID 241092027 and field - Temperature.
Before being sent will change to the actual Device field eg. 24.3 degrees.
Likewise can do the same for variables.

See Here:
https://wiki.indigodomo.com/doku.php?id ... bstitution

So could have standard message:
Using variable for time

OR - to use Python

It is documented on the bottom of readme
https://github.com/Ghawken/iMessagePlugin

Code: Select all
    imessageID = 'com.GlennNZ.indigoplugin.iMessage'
    imsgPlugin = indigo.server.getPlugin(imessageID)
    imsgPlugin.executeAction('sendQuestion', props={'message':'The question you wish to ask', 'buddyId':'example@email.com', 'lastBuddy':False, 'timeout':600,'confirmedimsg':'All done.','actiongroup':ActionGroupIDtoRunwhenConfirmed})
    return;


This bit will call the plugins executeAction question code.

Alternatively to use send a message using python
Code: Select all
    imessageID = 'com.GlennNZ.indigoplugin.iMessage'
    imsgPlugin = indigo.server.getPlugin(imessageID)
    imsgPlugin.executeAction('as_sendmessage', props={'message':'The message you want to send ', 'buddyId':'example@email.com'})


Obviously above would remove 'The message you want to send' with a string variable and change to whatever.
To get current datetime, use a python datetime function like time - which would need to be imported

Code: Select all
import datetime
now = datetime.now()
 # dd/mm/YY H:M:S
dt_string = now.strftime("%d/%m/%Y %H:%M:%S")
# and add togther the message you want to send
messagevariable = dt_string + " was the time this was sent"
imessageID = 'com.GlennNZ.indigoplugin.iMessage'
imsgPlugin = indigo.server.getPlugin(imessageID)
imsgPlugin.executeAction('as_sendmessage', props={'message':messagevariable, 'buddyId':'example@email.com'})


Like above - sorry can't test this currently, so maybe some formatting errors (I do a lot of C# stuff, so sometimes my brain/syntax is in the wrong language!) But think this will be okay.

Glenn

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Wed Dec 18, 2019 10:07 pm
by t-star
Getting the error below

Script Error embedded script: plugin does not have a <CallbackMethod> specified for action id as_sendmessage
Script Error Exception Traceback (most recent call shown last):

using this code

Code: Select all
imessageID = 'com.GlennNZ.indigoplugin.iMessage'
imsgPlugin = indigo.server.getPlugin(imessageID)
imsgPlugin.executeAction('as_sendmessage', props={'message':"test", 'buddyId':'example@example.com'})

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Sat Dec 21, 2019 1:19 am
by GlennNZ
Code: Select all
import datetime
now = datetime.datetime.now()
 # dd/mm/YY H:M:S
dt_string = now.strftime("%d/%m/%Y %H:%M:%S")
# and add togther the message you want to send
messagevariable = dt_string + " was the time this was sent"
imessageID = 'com.GlennNZ.indigoplugin.iMessage'
imsgPlugin = indigo.server.getPlugin(imessageID)
imsgPlugin.executeAction('sendMessage', props={'message':messagevariable, 'buddyId':'me@myemail.com'})


Sorry - this works - helps if I'm by a computer when I answer!

Glenn

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Sun Dec 22, 2019 9:28 am
by t-star
got it thanks!

Re: iMessage Indigo Plugin [New Plugin]

PostPosted: Wed Dec 06, 2023 11:01 am
by stewkenly
I just installed the new update and see an error upon launching. I am running the latest edition of Sonoma and Indigo 2023.1

thanks for the help

Stopping plugin iMessage Plugin (pid 18267)
Stopped plugin iMessage Plugin
Upgrading plugin iMessage Plugin to newer version 0.7.12 (previous version moved to trash)
Loading plugin "iMessage Plugin 0.7.12" using API v3.0.0
Starting plugin "iMessage Plugin 0.7.12" (pid 92308)
iMessage Plugin Error Error in plugin execution InitializeMain:

File "plugin.py", line 26, in <module>
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/iMessage.indigoPlugin/Contents/Server Plugin/openai/__init__.py", line 9, in <module>
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/iMessage.indigoPlugin/Contents/Server Plugin/openai/api_resources/__init__.py", line 1, in <module>
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/iMessage.indigoPlugin/Contents/Server Plugin/openai/api_resources/audio.py", line 4, in <module>
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/iMessage.indigoPlugin/Contents/Server Plugin/openai/api_requestor.py", line 21, in <module>
type: No module named 'aiohttp'

Stopping plugin "iMessage Plugin 0.7.12" (pid 92308)
Stopped plugin "iMessage Plugin 0.7.12"