Google Home API.IA for private use on own Home - private

I have created a Google Home agent to control my thermostat. Of course I want to be the only one using and controling it. So I dont want to publish the app.
There is a small tutorial for extending the use of the simulator and even an update for V2. But the V2 update I can't seem te get to work, I get to following error:
Unable to parse action package: invalid character ',' after top-level
value
Did someone else get this to work?
This is the tutorial (scroll down for the update by #dadykhoff)
Make google actions development project preview persist longer

Related

How to create custom AR button

Does someone have any examples how to generate AR URL?
Reading Web SDK documentation, seems that there is no functionality to do that.
Found https://github.com/Roomle/roomle-button but not sure that`s still way to go since it has not been updated for 2 years.
If you are using the Roomle SDK you can use saveCurrentConfiguration to get the configuration id (hash) of the current configuration. Not sure what you used at the moment to obtain a configuration id but you need to call this in order to save it on the Roomle server and open it in another place.
Also make sure to set the configuratorId URL param when linking to the AR site.

TextRotation angle is never set in Google Sheet API

I'm using Google Sheets API v4 from Java Client. I'm trying to get format from Cell class. Everything goes fine.
TEXT ROTATION
I'm succeed in getting TextRotation element with Vertical property set but, angle property is never set, what ever I put on source Google Sheets document.
Whatever the angle value selected in Google Sheet App, angle property is never set.
I've tried to inspect returned JSON, to know if the issue is in Java Client.
But JSON REST API also never returns this property.
Current Result:
.
Expected Result:
Issue and workaround:
When I saw CellFormat of the official document, I thought that the value of textRotation can be retrieved by the fields of sheets(data(rowData(values(userEnteredFormat(textRotation))))) when the method of "spreadsheets.get" is used. But when I tested this, no values are returned. So I thought that this might be a bug. And, when I searched this at the Google issue tracker, I found https://issuetracker.google.com/issues/146274218. From this situation, in the current stage, it seems that the values of textRotation cannot be retrieved by the method of "spreadsheets.get" of Sheets API.
When you want to retrieve the value of textRotation using a script, as a current workaround, you can achieve it using the Web Apps created by Google Apps Script as a wrapper. In this answer, I would like to propose the workaround.
When this workaround is reflected to the flow for your situation, it becomes as follows.
Usage:
1. Create new project of Google Apps Script.
Sample script of Web Apps is a Google Apps Script. So please create a project of Google Apps Script.
If you want to directly create it, please access to https://script.new/. In this case, if you are not logged in Google, the log in screen is opened. So please log in to Google. By this, the script editor of Google Apps Script is opened.
2. Prepare Web Apps side. (server side)
Please copy and paste the following script (Google Apps Script) to the script editor. This script is for the Web Apps. This Web Apps is used as an API.
Server side: Google Apps Script
function doGet(e) {
const key = "sampleKey";
const id = e.parameter.spreadsheetId;
const sheetName = e.parameter.sheetName;
if (e.parameter.key != key || !id || !sheetName) {
return ContentService.createTextOutput(JSON.stringify({message: "Error."})).setMimeType(ContentService.MimeType.JSON);
}
const sheet = SpreadsheetApp.openById(id).getSheetByName(sheetName);
const textRotations = sheet.getDataRange().getTextRotations().map(r => r.map(c => ({angle: c.getDegrees(), vertical: c.isVertical()})));
return ContentService.createTextOutput(JSON.stringify(textRotations)).setMimeType(ContentService.MimeType.JSON);
}
3. Deploy Web Apps.
On the script editor, Open a dialog box by "Publish" -> "Deploy as web app".
Select "Me" for "Execute the app as:".
By this, the script is run as the owner.
Select "Anyone, even anonymous" for "Who has access to the app:".
Of course, you can use the access token for this situation. But in this case, as a simple setting, I use the access key instead of the access token.
Click "Deploy" button as new "Project version".
Automatically open a dialog box of "Authorization required".
Click "Review Permissions".
Select own account.
Click "Advanced" at "This app isn't verified".
Click "Go to ### project name ###(unsafe)"
Click "Allow" button.
Click "OK".
Copy the URL of Web Apps. It's like https://script.google.com/macros/s/###/exec.
When you modified the Google Apps Script, please redeploy as new version. By this, the modified script is reflected to Web Apps. Please be careful this.
3. Testing.
As a simple test, when it requests to the Web Apps using a curl command, it becomes as follows. Please set the spreadsheet ID and sheet name. When the Web Apps is correctly deployed, the values are returned.
$ curl -L "https://script.google.com/macros/s/###/exec?spreadsheetId=###&sheetName=Sheet1&key=sampleKey"
Result:
The data range is used for retrieving the values. So for example, when the values are set to the cells "A1:C3" in "Sheet1", the following result is returned.
[
[{"angle":30,"vertical":false},{"angle":0,"vertical":true},{"angle":0,"vertical":false}],
[{"angle":30,"vertical":false},{"angle":30,"vertical":false},{"angle":0,"vertical":false}]
]
In this case, the cells "A1, A2, B2" have the text rotation with 30 degree. And, the cell "B1" has the vertical direction.
Note:
When you modified the script of Web Apps, please redeploy the Web Apps as new version. By this, the latest script is reflected to Web Apps. Please be careful this.
References:
CellFormat
getTextRotations()
Web Apps
Taking advantage of Web Apps with Google Apps Script
Finally, I've written a JS Library : screen-rotation.js to manage all this stuff.
screenorientation().change(function(){
// My event management
});
It supports iOS, Android & desktop browsers

Pentaho 5.0.1 CE Adding folder to pentaho-solutions directory

How do I get a folder to appear in the browser after adding it to \pentaho-solutions in Pentaho 5.0.1 CE. The documentation I read does not seem to work with this new version.
1. Create a new directory in /pentaho/server/biserver-ee/pentaho-solutions/.
Use underscores instead of spaces in the solution directory name. Ensure that the directory has the appropriate user
and group ownership to be writable from the BI Platform.
2. Using an XML-aware text editor (or Design Studio), create a file named index.xmlin your new solution directory.
3. Copy the following text into the index.xml file, changing the content accordingly:
***<index>
<name>Example Solution</name>
<description>This solution contains examples I created while learning to
work with action sequences.</description>
<icon></icon>
<visible>true</visible>
<display-type>icons</display-type>
</index>***
4. Save the file and close the text editor.
5. Log into the Pentaho User Console as an administrator.
6. Refresh the solution repository cache by going to the Toolsmenu, then selecting the Refreshsubmenu, then
clicking on Repository Cache.
You now have a new solution directory. It will show up in all file dialogues in the Pentaho User Console as well as the
Solution Browser in the left pane.
Every time you add or edit an action sequence to your solution directory, you must refresh the repository cache as
explained above. Each user currently logged into the Pentaho User Console must also refresh their session cache; this
is best done by re-logging into the Pentaho User Console.
I am using Pentaho design studio to develop an xaction sequence script. I followed this procedure:
1. In Design Studio, go to the Filemenu, then select New, and click on Other...in the sub-menu.
The Newwindow will appear.
2. In the Newwindow, click the triangle next to Pentaho, select New Action Sequence Wizard, then click Next.
3. In the File namefield, type hello_world.xaction.
4. Select Hello Worldfrom the Templatedrop-down box, then click Finish.
The wizard will generate the new file and bring you back to the workbench.
5. Click on HelloWorldComponentin the Process Actionssection on the left.
The right side of the screen will change to show the options available for this action: Nameand Message. The
Name field controls the name of the component in the Process Actions list on the left; it doesn't do anything else of
note. The Message field contains the text that will appear on the screen when the action sequence is run. It is prepopulated with %quote, which is a token that represents a quote message in a nonexistent properties file. Pentaho
used to provide properties files for each example, but they have been removed from the standard Pentaho Business
Analytics distribution.
6. Replace the %quotewith a sufficiently inspiring message.
Alternatively, you could create a hello_world.propertiesfile and populate it with the appropriate messages and
tokens, but that has no advantage unless you intend to internationalize this action sequence.
7. Save the file.
You now have a working action sequence that prints a short text message: "Hello, World." plus whatever you typed into
the Message field. The first part of the message is determined by a message bundle packaged with the Pentaho Web
application archive.
To test the action sequence, use the Test tab if you are on Windows or OS X, or log into the Pentaho User Console and
run it from the Solution Browser.
Running the sample xaction fails with
Sorry. We really did try.
Something went wrong. Please try again
or contact your administrator.
I figure this is because pentaho cannot locate the xaction file as specified in the file path when I generate the url from within design studio. The folder I created within the solution directory does not appear in the browser directory list despite refreshing the cache. Any help?
With Version 5 the files and folders are no longer stored in "/pentaho/server/biserver-ee/pentaho-solutions/..."
It is stored now in a jackrabbit repository.
You can create folders and upload files in the user console.
I did mistake after starting biserver 5.2. Unexpectedly i deleted Public folder after configuring to jackrabbit. Now how do i create the folder so that i can see Public and Home Folders.
Sorry for getting back to this question some time later, just in case someone searches something related to Pentaho repositories management with no success, i hope this information can help.
Just to make things more clear, i'm using version 5.2.x and i'm supposing you want to create a new folder on the root directory of Browse Files screen, something that is not allowed on Pentaho5 CE Web Console.
The answers about repository management based on JackRabbit are correct, so the old way we used to configure new "solutions" folders doesn't work anymore. From version 5 on, Pentaho exposes an interesting REST api that allows you doing things not allowed in web console.
For instance, for creating a folder in root directory you should create a http REST PUT request against Pentaho Server (using tools like curl or if you appreciate Google Chrome, something like Advanced Rest Client, etc.) using the following URL:
http://localhost:8080/pentaho/api/repo/dirs/:new_directory_name?userid=admin&password=password
Pentaho repository directory REST api is documented here:
http://javadoc.pentaho.com/bi-platform500/webservice500/resource_DirectoryResource.html
It's worthy to spend some time reading REST API the documentation.

ODataConsumer create method undefined - ADT - Build: v21.1.0-569685

I'm entering the world of android development, i haven't written java since uni (some time ago now). I have written and deployed a working WCF Data Service and am now attempting to consumer that service from my android app.
i've been reading blogs and following tutorials and everything starts with
ODataConsumer c = ODataConsumer.create("http://www.tooks-net.co.uk/DataService/PublicDataService.svc/");
List<OEntity> list = c.getEntities("NewsBulletins").execute().toList();
the problem that i am getting won't even let me run the app to see if the service will connect and retrieve the list of news. The error i get in eclipse is this:
The method create(String) is undefined for the type ODataConsumer
Like i said, all documentation says to start with ODataConsumer.create and it won't let me get even that far.
What i've done so far is. Follow the the android training programme here http://developer.android.com/training/basics/firstapp/index.html until the point where i create a new activity and start that, but instead of displaying the message entered i run the above code.
What have i missed? Thanks in advance!
You have to use
ODataConsumer c = ODataJerseyConsumer.create("http://www.tooks-net.co.uk/DataService/PublicDataService.svc");
Make sure that you added the clientbundle jar (the latest is odata4j-0.7.0-clientbundle.jar).

Building Passbook Passes

I've been working on integration of Passbook for some of my apps. Right now, I've used Ray Wenderlich's tutorial on this, and it is quite frankly a pain to build even one Pass. I have to get the icon files all in place, program the JSON file, get the manifest file filled in with all the SHA1 values, and run a few lines in terminal to sign it, and then another line to zip it. Are there any online services or programs that can be used to save a pkpass file to computer, that I can then upload to my server?
There are also quite some developer tools that help you to create passes, you can find a list on wikipedia.
We provide an Objective-C SDK and a free cloud service that lets you create templates and generate passes. You can find the SDK on github (Sample App is included).
There are a number of services that can be used to generate passess. Take a look on wikipedia for a comprehensive list of providers, tools and projects.
If you want to update passes, then you will need to build a Passbook Web Service. When a pass is updated, the web service sends a new .pkpass bundle to the device. Therefore, your web service must also be capable of signing passes unless you want to manually create and upload them to your server before sending out a push request.
Using our service, PassKit, you can create a template using WSIYWIG editor then create a pass directly on your server via a simple API call. You can also update passes and push updates to passes via our API. If you just want to get hold of the .pkpass bundle, then you can append /d to the pass URL (the one beginning with r.pass.is), or use PassKit API in your User Agent string.
you should also check out Apple's Passbook Support Materials here:
https://developer.apple.com/passbook/
They have a simple XCode project called SignPass that you can use to easily create your own Passes.
Note: you need to be a member of Apple's Developer program to access these materials ..
There's lots more Passbook related info here:
http://www.flonsolutions.com
Andrew

Resources