Google Home Report State for LIGHT issue - google-home

When I send the reportState I am getting this error:
{"error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT"}}
For the following request:
{
"requestId":"b09aa527-e8ec-4374-8d0b-742ba61bbfe3",
"agentUserId":"5d8f3dd42ce05140dc1c6a20",
"payload":{
"devices":{
"states":{
"5e3679c9130c053f48888114":{
"brightness":67,
"colorModel":"rgb",
"spectrumRGB":31655,
"on":true
}
}
}
}
}
This is the sync request response:
{
"requestId":"4439574979535065527",
"payload":{
"agentUserId":"5d8f3dd42ce05140dc1c6a20",
"devices":[
{
"id":"5e3679c9130c053f48888114",
"type":"action.devices.types.LIGHT",
"traits":[
"action.devices.traits.Brightness",
"action.devices.traits.ColorSetting",
"action.devices.traits.OnOff"
],
"name":{
"defaultNames":[
"lamp"
],
"name":"lamp",
"nicknames":[
"lamp"
]
},
"willReportState":true,
"roomHint":"Living Room",
"deviceInfo":{
"manufacturer":"Sinric Pro",
"model":"SR2",
"hwVersion":"1.0",
"swVersion":"1.0"
},
"attributes":{
"colorModel":"rgb",
"colorTemperatureRange":{
"temperatureMinK":2000,
"temperatureMaxK":9000
},
"commandOnlyColorSetting":false
}
}
]
}
}
If I remove
"colorModel":"rgb", "spectrumRGB":31655,
seems to success.
Any idea why and how to fix this? It would be nice if Google APIs can return a better response than this

I found the reason. The response was missing color. Hope this will be helpful for someone else :D
{
"requestId":"956cf9d4-6ac2-407d-b683-e04224303de6",
"agentUserId":"5d8f3dd42ce05140dc1c6a20",
"payload":{
"devices":{
"states":{
"5e3679c9130c053f48888114":{
"brightness":67,
"color":{
"spectrumRGB":4915330
},
"on":true
}
}
}
}
}

Related

GraphQL parameters for an exists filter in API Platform

I have setup an exists filter for an entity:
#[ApiFilter(ExistsFilter::class, properties: ['firstName', 'lastName'])]
I can then run the query just fine:
query accounts {
accounts(exists: {firstName: true}) {
edges {
node {
id
}
}
}
}
But I would like to parameterize the exists filter. The closest I have got is this:
Query
query getAccounts($exists: [AccountFilter_exists]) {
accounts(exists: $exists) {
edges {
node {
id
}
}
}
}
Parameters
{
"exists": {"firstName": true}
}
But I get this error message:
{
"errors": [
{
"message": "Variable \"$exists\" got invalid value {\"firstName\":true}; Expected type AccountFilter_exists to be an object at value.firstName.",
"extensions": {
"category": "graphql"
},
"locations": [
{
"line": 1,
"column": 19
}
]
}
]
}
Does anyone know where I am going wrong?
Thanks for your help.
You actually need to provide the exists filters in this format:
{
"exists": [{"firstName": true}]
}
https://api-platform.com/docs/v2.7/core/graphql/#syntax-for-filters-with-a-list-of-key--value-arguments
Hope this helps.

INDEXER Lake Framework - outcome.status.failure not showing execution error

The following transaction
https://explorer.near.org/transactions/CkZYiXB3BEoXNuLDqcn5GjErkXghKGCB47yPyyze4kTf#BPYU8T3o5mdsU4ewG3JdCLRe8ivpsGTehKxkifFAsboD
failed whith the following error:
{
"type": "action",
"error": {
"type": "functionCallError",
"error": {
"type": "executionError",
"error": "Smart contract panicked: The contract is not initialized"
}
}
}
But what I got on the indexer is the following:
{
"outcome":{
"executionOutcome":{
"blockHash":"8NP4Z2i7CBQzRUxa8CfuummnYZvwfZaCFmif4d6mcgyB",
"id":"CkZYiXB3BEoXNuLDqcn5GjErkXghKGCB47yPyyze4kTf",
"outcome":{
"executorId":"test1.csandi.near",
"gasBurnt":2428211671420,
"logs":[
],
"metadata":{
"gasProfile":null,
"version":1
},
"receiptIds":[
"GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc"
],
"status":{
"SuccessReceiptId":"GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc"
},
"tokensBurnt":"242821167142000000000"
},
"proof":[
{
"direction":"Left",
"hash":"BWhmGBmvzbX3WBP1RZQ59DB749sHSV2xS5pNyF6xAbbh"
},
{
"direction":"Right",
"hash":"H4YMDcd9Fh68KTwyPTwYuFb89KhfdGUoxRbBYzDcNAze"
},
{
"direction":"Right",
"hash":"9jv152euKvurdVkDYS5FKiiT4ej6xL1gRYTHoNbjwEZi"
},
{
"direction":"Right",
"hash":"BqQFHzSYzqDE8tMQkJT8PHFGxLmQrkFBcuTqFP4nTjx7"
}
]
},
"receipt":null
},
"transaction":{
"actions":[
{
"FunctionCall":{
"args":"eyJpbml0aWFsX3ByaWNlIjoxLjksInNwYWNpbmciOjIsImFscGhhX2lkIjoidXNuIiwiYmV0YV9pZCI6IndyYXAubmVhciIsInN3YXBfZmVlX3JhdGUiOjAuMDAzLCJwcm90b2NvbF90b2xsIjowLjAxfQ==",
"deposit":"0",
"gas":200000000000000,
"methodName":"create_new_pool"
}
}
],
"hash":"CkZYiXB3BEoXNuLDqcn5GjErkXghKGCB47yPyyze4kTf",
"nonce":75627675000007,
"publicKey":"ed25519:85yAx5mY8DinTWQfMn47cZTHMhZtLRAWZLpazYmetwno",
"receiverId":"dev-cliquidity-perk-jorge.near",
"signature":"ed25519:1CieS8AUSc7Y3S8By8adJaEXXydXcjvSA1uVXPgrdhkmGPpf5ykA7XWqJGZnDhMtymkp6eWDBEQzsBXkhybAbUV",
"signerId":"test1.csandi.near"
}
}
So I would like to know if there is anyway to get the failure message from the indexer?
Look in the next blocks for the corresponding receipt from the SuccessReceiptId (id GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc), and in its execution outcome you will find that status.
I cannot recommend more to watch or read the Data Flow in NEAR
FYI, just to follow up and clarify for anyone with this question, after following the above response by "Vlad Frolov", in order to get the Receipt Status, I had to check
shard.receiptExecutionOutcomes
which will provide the results of the receipts, so I started to track the receipts that I am interested in, in this case for
SuccessReceiptId (GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc)
"executionOutcome":{
"blockHash":"59F5pES9Myc2VT4JkppE95epCwtGAXYux9okbzpsh95K",
"id":"**GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc**",
"outcome":{
"executorId":"dev-cliquidity-perk-jorge.near",
"gasBurnt":2824274578054,
"logs":[
],
"metadata":{
"gasProfile":[
{
"cost":"BASE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"1323840555"
},
{
"cost":"CONTRACT_LOADING_BASE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"35445963"
},
{
"cost":"CONTRACT_LOADING_BYTES",
"costCategory":"WASM_HOST_COST",
"gasUsed":"106584645000"
},
{
"cost":"READ_MEMORY_BASE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"5219726400"
},
{
"cost":"READ_MEMORY_BYTE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"136847988"
},
{
"cost":"READ_REGISTER_BASE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"2517165186"
},
{
"cost":"READ_REGISTER_BYTE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"11334630"
},
{
"cost":"STORAGE_READ_BASE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"56356845750"
},
{
"cost":"STORAGE_READ_KEY_BYTE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"154762665"
},
{
"cost":"TOUCHING_TRIE_NODE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"193223471112"
},
{
"cost":"UTF8_DECODING_BASE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"3111779061"
},
{
"cost":"UTF8_DECODING_BYTE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"9038994849"
},
{
"cost":"WASM_INSTRUCTION",
"costCategory":"WASM_HOST_COST",
"gasUsed":"11928316488"
},
{
"cost":"WRITE_MEMORY_BASE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"2803794861"
},
{
"cost":"WRITE_MEMORY_BYTE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"313233780"
},
{
"cost":"WRITE_REGISTER_BASE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"2865522486"
},
{
"cost":"WRITE_REGISTER_BYTE",
"costCategory":"WASM_HOST_COST",
"gasUsed":"437179860"
}
],
"version":1
},
"receiptIds":[
"BPYU8T3o5mdsU4ewG3JdCLRe8ivpsGTehKxkifFAsboD"
],
**"status":{
"Failure":{
"ActionError":{
"index":0,
"kind":{
"FunctionCallError":{
"ExecutionError":"Smart contract panicked: The contract is not initialized"
}
}
}
}**
},
"tokensBurnt":"282427457805400000000"
},
"proof":[
{
"direction":"Left",
"hash":"5j1RhLnf5jGChUPxU9CPNbAGwSn6VnzBw7taJe5vSnYD"
},
{
"direction":"Right",
"hash":"AJ2kARUcYAkzsL3xmw4jAETZ61jtQuswf7RvhSxscKCR"
},
{
"direction":"Left",
"hash":"9vXQjFdTaQw5XjUKsRK6N3WFCg5zMVca5Ze2Qqznn3AM"
}
] }, "receipt":{
"predecessorId":"test1.csandi.near",
"receipt":{
"Action":{
"actions":[
{
"FunctionCall":{
"args":"eyJpbml0aWFsX3ByaWNlIjoxLjksInNwYWNpbmciOjIsImFscGhhX2lkIjoidXNuIiwiYmV0YV9pZCI6IndyYXAubmVhciIsInN3YXBfZmVlX3JhdGUiOjAuMDAzLCJwcm90b2NvbF90b2xsIjowLjAxfQ==",
"deposit":"0",
"gas":200000000000000,
"methodName":"create_new_pool"
}
}
],
"gasPrice":"346069590",
"inputDataIds":[
],
"outputDataReceivers":[
],
"signerId":"test1.csandi.near",
"signerPublicKey":"ed25519:85yAx5mY8DinTWQfMn47cZTHMhZtLRAWZLpazYmetwno"
}
},
"receiptId":"GrXdFKA9byvCmxGiQkGc9iaFn88FfePk4tfJhvcTGMwc",
"receiverId":"dev-cliquidity-perk-jorge.near" } }
And as you can see in the json response,the following status:
"status":{
"Failure":{
"ActionError":{
"index":0,
"kind":{
"FunctionCallError":{
"ExecutionError":"Smart contract panicked: The contract is not initialized"
}
}
}
}
Anyway to fully understand how transactions/receipts work this document helped a lot.

"Requested entity was not found" when writing on Google Home Graph

I'm trying to update the state of a device using Google Home Graph API, but I'm getting this reply and I don't understand why:
{
"error": {
"code": 404,
"message": "Requested entity was not found.",
"status": "NOT_FOUND"
}
}
This is the first part of my SYNC reponse:
{
"requestId": "reqId",
"payload": {
"agentUserId": "myAgentUserId",
"devices": [
{
"id": "myDeviceId",
...
}
and this is what I'm sending to
https://homegraph.googleapis.com/v1/devices:reportStateAndNotification
{
"agentUserId": "myAgentUserId",
"payload": {
"devices": {
"states": {
"myDeviceId": {
"on": true
...
}
As you can see, both myAgentUserId and myDeviceId in Home Graph's request are the same to the ones returned to the SYNC request.
What am I doing wrong?

GraphiQL 404 page not found

Based on this Shopify documentation, I'm trying to execute this GraphQL query:
query getDiscount($code: DiscountCodeSortKeys) {
priceRules(first: 1) {
edges {
node {
discountCodes(first: 1, sortKey: $code) {
edges {
node {
code
id
}
}
}
}
}
}
}
In GraphiQL in my Shopify admin page I get this output:
{
"data": {
"priceRules": {
"edges": [
{
"node": {
"discountCodes": {
"edges": [
{
"node": {
"code": "discount_code_1",
"id": "gid://shopify/PriceRuleDiscountCode/1888888"
}
}
]
}
}
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 6,
"actualQueryCost": 6,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 994,
"restoreRate": 50
}
}
}
}
However, when I execute the same query in GraphiQL IDE after editing the HTTP headers and putting the GraphQL endpoint (https://my_domain.com/api/graphql), I get a html code with the title of 404 page not found as you can see in the picture below:
The problem was in the selected method "GET", it worked when I selected the "POST" method.

How to fix Fastlane supply missing_email

Fastlane ends up giving me this error:
/root/.rubygems/gems/googleauth-0.6.6/lib/googleauth/json_key_reader.rb:39:in `read_json_key': [!] missing client_email (RuntimeError)
Here's my google-services.json:
{
"project_info": {
"project_number": <number>,
"firebase_url": <firebase_url>,
"project_id": <project_id>,
"storage_bucket": <storage_bucket>
},
"client": [
{
"client_info": {
"mobilesdk_app_id": <mob_app_id>,
"android_client_info": {
"package_name": <package_name>
}
},
"oauth_client": [
{
"client_id": <client_id>,
"client_type": <client_type>
}
],
"api_key": [
{
"current_key": <current_key>
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
I tried to search for where the client_email key would sit but I couldn't info on the format of this son file. Or at least what I found did not match the format I have at all.
Questions:
1) Where must I insert the client_email in the JSON to get it working?
2) Does the email have to match something in the Google Play account?

Resources