Cliff -
many thanks, much appreciated ...
will find a quiet moment later, and get stuck in ...
Chris
Cliff -
many thanks, much appreciated ...
will find a quiet moment later, and get stuck in ...
Chris
Cliff ...
many thanks, did get it to respond, but did not get useful information ...
tried all sorts, left it a day or two, and tried again - still no joy !
eg:
Ah OK .. this is good, it means you've sorted your Authentication out ... 1 last thing to do then; if you go to the "Tools" menu in Cortex, then to the "Cortex API" option, select the "Options" tab at the bottom and change the "Default API Syntax" drop-down to be "JSON" (or XML if you'd prefer) .. I assume yours is currently set to "Synapse" instead judging by your screenshot.
e655fd3e-bb7c-44e0-a374-433a67f8f8f2.jpg
Cliff -
magic ...
26660 lines of useful info' - 5.65s to produce, 883.38KB
many thanks !
Chris
Cliff -
OK, I can now (eg) switch lights on & off by sending POST requests from POSTMAN ...
but it does this without making the request it actually posts visible ...
ie: without showing the equivalent of the example you posted - which was
POST /api/v1/Objects/504?5=1 HTTP/1.1
Host: 192.168.1.254:9083
Authorization: Basic Q2xpZmZTYW1wbGVVc2VyTmFtZTpNeVNhbXBsZVBhc3N3b3Jk
I've tried all sorts, but again drawn a blank ! ... ?
PS: ah,found it - cllcking Code does it ... sorry !
So, almost there ... have downloaded the Shortcuts app onto my iPhone, and have created a URL Shortcut, which is now showing in the Library ...
but it doesn't work - because I don't know how to include Authorisation in the URL ... have tried a few ideas, but no joy ! ??
Last edited by chris_j_hunter; 6th December 2020 at 07:05 PM.
Cool - great - pretty much there now!
26k lines?! ... how many objects /modules do you have in your setup!?! ... Do you live in a 42 Bedroom mansion?
In iOS Shortcuts:
* Select "+" to create a new shortcut
* Click "+ Add Action"
* Using the search option, search for "GET" and select the "Get Contents of URL" option
* Click the elipsis (...) to rename it to something you want - bear in mind this will be the thing you speak to Siri if you want to use Siri to do this ... ie if you name it "Toggle Garage Door", it'll work with the action "Hey Siri, Toggle Garage Door" .. so name it something you don't mind saying out loud if you intend to use Siri :-D
* Click on the "URL" part to replace this with your Cortex IP / Objects URL
* Select "Show more"
* Make sure the method is set to POST
* Expand the "Headers" option by selecting the right Chevron >
* Click "+ Add new header"
* Enter the key value as "Authorization" and Text value as "Basic <your Base64 encoded Authentication value you've grabbed from Postman>"
* Make sure you've got the request body set to JSON
* Hit "Done" if you completed the 2nd step above or "Next" if you didn't, and give it a name.
It should look like this if you've followed the above
iOSShortcut.jpg
Hopefully this get you up and running - shout if you need anything else
Clearly you can include any Cortex action like this ... so there's tonnes of scope
Last edited by cliffwright; 6th December 2020 at 09:28 PM.
yes - quite a few modules, real & virtual ...
in my day job, I learnt that sensor fusion was good, and it needed plenty of inputs ...
plus our house is open-plan ... so need more to distinguish ...
iOS Shortcuts ...
after Select "+" to create a new shortcut ...
we don't see the next step - there's clearly a space to make an input, but no +, no response to tapping in the space, no way on initiating one ...
we're running iOS 12.4.9 ...
wonder if there's a bug ...
Chris
PS: our iPhones are 6+ ... and some Googling suggests they won't work with Shortcuts ...
we bought them late 2014 ...
so ... do we update our 'phones, or do we switch to something else ...
our gear is mostly Apple, but seems to me, for a while now, they are not what they were ...
Last edited by chris_j_hunter; 8th December 2020 at 12:38 AM.
Sensor fusion? Sounds interesting ... what do you mean by this?
Hmm .. I'm not sure. I'm using an iPhone 12 Pro running iOS 14.2.1. I'm no "Apple fanboy", but (and in the context that in my work, I've worked on projects developing mobile apps across both platforms, so used a wide range of devices from several flavours of tech companies) I find iOS very intuitive, whereas for whatever reason, I can't get on with Android as week and I'm a bit "tin foil hat" with Google having seen the amount of data they collect, aggregate and commoditise. I trust Apple's privacy more than Google (whilst not being naive enough to think Apple doesn't also see users' data as a commodity too).
That said, as you're experiencing, Apple devices are "run out" over time, so you are tended to be forced to upgrade every few years.
It's a personal preference clearly ..
What use-case are you trying to achieve here exactly? Is it the "having a shortcut on your phone that's simpler than having to log into the Cortex Mobile Web" or the "voice control" aspect, or something else?
OK - after some tapping around / exploring on the 'phone I've managed to enter & set all you said ... and it seems to work ...
but nothing happens (the Light that was switched from Postman is not switched) ...
running it as a test, there's a response window - it says "Invalid user or password" ...
have checked my typing, twice, but ... it has to be me having got something wrong - maybe I don't understand the format ...
So will have lunch & watch the GP (recorded last night) & check / try again ...
PS: eventually it worked - I deleted the Key & Text, and entered new ones (the Text by copy & paste from the old one) ... and, wow !
have also got Siri in on the act ...
so, phew ... and many thanks, once again !
getting a button onto the Home screen hasn't yet done what I expected - ie: it doesn't just get the light turned on or off, but gets into editing the shortcut ...
will try again ...
have also to work out how to do the authorisation part in Applescript, too - to enable RFID tags to do the same ...
Sensor fusion - meaning taking into account multiple sensors ... ie: in our case, using one or more General Logic objects to combine data from several modules to activate something or feed a virtual module or ...
eg: open plan space, so Rooms without doors, several PLH / DRB / QBI / other modules => GL object which deduces where in the space motion was detected & feeds virtual PLHs on which which Room Presence depends ...
in other words, the GL extracts something sensible from a situation in which multiple sensors were confusingly triggered ... as when a person is picked-up by a sensor in another room ...
we also use GL to give context sensitivity - eg: from a sequence of triggers, deduce what a person is intending to do, or might have forgotten, or ... to help Cortex act appropriately ...
and for having things work more conveniently - eg: operating yard gate & garage doors from button-presses in several locations, including such things as opening the gate to different degrees - for car, for bike, for people ...
as well as things like NightNight - check doors & windows, cancel lighting scenes, warn of this or that being on or open or set, gate status, outside temperature & weather forecast, lights off, medical reminders, etc ...
lots more examples ... headline statistics for our set-up are : 2858 objects, of which 799 logic objects, 259 modules, 229 virtual modules ...
iPhone12 - have just watched Apple's last October presentation of HomePod Mini & iPhone12 ... and was impressed ...
the HomePod Mini looks to be well thought-out, and am very tempted to buy a couple - to have Siri able to command Cortex in whatever ways ...
and the iPhone12 - will have to see what our budget could allow ... wife's iPad is one of the first (early adopter) - a museum piece - so that's another consideration ...
Android ... we have Android tablets around the house (for NoticeBoard display, including Met.Office weather forecasts, house data, spoken messages - in-case missed them) etc ... so have some inkling of what you mean - plus we are down to seven still working, about half the total - the failed ones all having frozen in some way, with resuscitation proving futile ... even the good ones often show messages that something or other (of no relevance to what we're running, Karam's app) has stopped working ...
Cortex Mobile ... we still use it on iPhone & Android tablets, but we were looking for something more direct, for things like your garage door, so Home Screen buttons & Siri ... we having found, since we moved to Cortex W10, that the special buttons we'd included in Cortex Mobile via Menus no longer worked, seemingly due to incompatibilities with iOS - I gave up trying to sort it, but intend to get back to it, hopefully with a fresh mind ...
Cortex e-mail - also stopped working when we moved to Cortex W10 - haven't been able to fathom it, could be an incompatibility with Google, but much of it is beyond me !
Chris
Last edited by chris_j_hunter; 8th December 2020 at 12:09 AM.
Ah good .. hopefully something simple then .. let me know how you get on.
The GP was good .. I was pleased and disappointed with the result in equal measure
Interesting points about "Sensor fusion" .. I might have to play a little. Our house isn't open plan, but the family room is large enough to have both lounging, dining and a TV / sitting areas and the kitchen a kinda L shape where I treat this as 2 zones and control the lights accordingly .. some extra logic might make it more effective.
Yes - I'd like to play with one of the Homepods too .. but earliest delivery of a mini is end of Jan at the minute ... I've not yet fully researched how it actually works. I believe the speaker in effect tells your device that hosts the shortcut to take action so I want to figure it out for sure. I've read somewhere there's support for "Multi person" context, so the speaker can know who was speaking to it and act accordingly which might offer some degree of interesting preference options.