Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Accessing pre-defined traits on Android Things #12

Open
PaulTR opened this issue May 29, 2018 · 4 comments
Open

Accessing pre-defined traits on Android Things #12

PaulTR opened this issue May 29, 2018 · 4 comments

Comments

@PaulTR
Copy link

PaulTR commented May 29, 2018

https://codelabs.developers.google.com/codelabs/androidthings-assistant/index.html?index=..%2F..%2Fio2017#5

Running into some weird issues with step 5. Enabled traits in the console, ran through the terminal commands listed and authenticated, but any time I tell the device "turn on", it says power controls is not yet supported. Normal assistant commands (like 'what time is it') work as expected, and not seeing the traits in the list command, either, though I see them on the actions console page.

(env) ➜ MachineLearningDemo git:(master) ✗ googlesamples-assistant-devicetool --project-id ptr-machine-learning-demo list --model
Device Model ID: ptr-machine-learning-demo-machinelearningdemo-dvuzw4
Project ID: ptr-machine-learning-demo
Device Type: action.devices.types.LIGHT
No traits

After a while I created a new project because I messed up some stuff trying to work via the terminal, but managed to connect a device to the assistant with one model, then updated it via this command to enable traits.

googlesamples-assistant-devicetool --project-id project_id register --model model_id --product-name demolight --device instance_id --client-type SERVICE --type LIGHT --manufacturer test --trait OnOff

Kind of wonky, and not in the code lab, but it was the only way I could get things to work.

@Fleker
Copy link
Contributor

Fleker commented May 29, 2018

When you run the devicetool command, then you correctly get a device action when you say "Turn on"? You also are able to see the traits using ... list --model after registering with the devicetool?

@PaulTR
Copy link
Author

PaulTR commented May 29, 2018

Yeah after I ran the devicetool register command, I was able to do a list --model and see the OnOff trait for the one I had just registered (though still nothing on the one that I only updated via the console UI). I did notice that if I go into the actions console page and try to download the credentials for the newly updated model, I get a message that says "Reached limit on number of clients in this project. Try in a new project." and the creation time is set to Dec 31,1969,05:00 PM :)

@bringert
Copy link

bringert commented Jun 8, 2018

I see the same issue where enabling the OnOff trait in the console still results in "power controls is not yet supported", but using googlesamples-assistant-devicetool to set the trait makes it work.

I noticed that after I use the command line tool to set the trait, the web console lists it as [my project ID].devices.traits.OnOff. And if I try to use the web console to change the list of traits, the [my project ID].devices.traits.OnOff trait disappears.

Note that I'm using the Python SDK, not Android Things, so it seems like this issue is probably not specific to Android Things.

@Fleker
Copy link
Contributor

Fleker commented Jun 11, 2018

When you do both, what happens when you want to list using the devicetool?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants