Can not receive battery status and Name of Nest protect - nest-api

From past few days the nest protect devices created using nest simulator tool are not responding properly. All of the nest protect are having same name Entryway and the battery status field is not updating in the Json response of Rest streaming . Is there anything I can do to fix this issue .
NOTE :previously I was able to get all the update properly
Following is the response I'm receiving:
{
"structure_id": "5vPPJJbCkUvNlf6JiLSY6eQaHKjf2iMd5YO4LsWuakUUiiU_M0jqKg",
"where_id": "45oC0YSjNKW13CclRc5F5DMrlsCCmp4VKVPaF1WQMBbd2FAAO-GqMg",
"name": "Entryway",
"name_long": "Entryway Nest Protect",
"is_online": true,
"device_id": "Hqw7qr2DPBzVp6Wrqds6hs8AFPWfjT7T",
"is_manual_test_active": false
}
My permissions are Away read/write ,Thermostat read/write ,Smoke+CO alarm read.

Related

Python3 Kraken Exchange Websockets AddOrder not working

I'm trying to send orders through websockets, but I don't know how to receive the response from the websocket as to whether it was successful or not. The site (https://support.kraken.com/hc/en-us/articles/360034936531-WebSocket-API-Trading-addOrder-and-cancelOrder) says that once the order had been sent, there will be a response outlining whether it was successful or not.
I'm just testing the addOrder with the following code:
async def test():
async for ws in websockets.connect("wss://ws-auth.kraken.com/"):
try:
token = generate_token()
request = {"event": "subscribe", "subscription": {"name": "addOrder", "token": token}}
await ws.send(json.dumps(request))
confirm_connection(await ws.recv())
confirm_subscription(await ws.recv())
volume = 0.0001
leverage = 0
ID = '12345'
request = {'event': 'addOrder', 'token': token, 'reqid': ID, 'ordertype': 'market', 'type': 'buy', 'pair': "XBT/USD", 'volume': volume, 'userref': ID, 'validate': 1}
resp1 = await ws.send(json.dumps(request))
resp2 = await ws.recv()
except websockets.ConnectionClosed:
continue
It connects to the websocket, makes a request for a test trade, sends that off. Then when I try to receive a response (line with resp2 = ...) it just says the following:
'{"errorMessage":"Public market data subscriptions are unavailable on this endpoint. Try ws.kraken.com","event":"subscriptionStatus","status":"error","subscription":{"name":"addOrder","token":"X"}}'
How are you supposed to receive the response as to whether Kraken received the trade request or not?
Thanks in advance
I have no experience with kraken websockets addOrder, but I do have experience with kraken addOrder api and kraken ownTrades and openOrders websocket subscriptions.
I'm guessing here, but judging from the error message, it looks like the error message is a response to a previous websocket subscription call you made requesting to subscribe to a channel data feed (not sure which one though).
With websockets, upon connection, you should get a systemStatus response message. In it, it contains the status ("online" is what you want to check for).
Next, depending on the subscription, you may receive a snapshot message pertaining to that service if it's online. That message will contain recent trade fills (ownTrades subscription), or currently open order (openOrders subscription). I haven't touched individual asset pair subscriptions, but I'm guessing recent activity there will be communicated as well.
I have no idea if anything I've stated herein will help you, but I do know this will definitely help you...
Contact kraken support by logging into your kraken account and then click on Support. I always open a support ticket (no chat, etc.) so that I can provide them with as much detail as I can including what I'm doing, how I'm doing it, and all error messages I'm getting back from them.
To date, they have responded in less than 24 hours and they've always given me very specific answers to my questions (there have been many questions). Overall, I would rate their support minimally 4.5 out of 5 stars.
Good luck.
I figured it out after some time, so this is for anyone else who has this issue.
There were no issues with websocket subscription, it was working as intended. Kraken does a weird thing where they send an error through the websocket, but it really is just a message and can be ignored. The websocket remains open and operational afterwards, so you just need to ignore the first response from the websocket.

Azure IoT Central - Query for device group failing on creation

I'm trying to create device groups to eventually create a Job with this particular device group to send a reboot command to all the devices in it. I'm using the IoT Central API REST for this with the URL looking like this (which is how it is on their documentation): PUT https://{subdomain}.{baseDomain}/api/deviceGroups/{uuidCreatedByMe}?api-version=2022-07-31
The body on the request looks something like this:
{
description: `Pulses' group to be rebooted, created at ${DateTime.now().toISO()}`,
displayName: `Reboot group ${deviceGroupId}`,
filter: query,
}
And the query is very similar to this
SELECT * FROM devices WHERE $template = "templateId" AND $id IN ["deviceId1", "deviceId2"]
But for some reason, when I send the request, it responds with an error:
Request failed with status 500 and error: {
"code": "InternalServerError",
"message": "Something went wrong on our end. Please try again. You can contact support at https://aka.ms/iotcentral-support. Please include the following information. Request ID: requestId, Time: Tue, 06 Sep 2015 477:10:01 GMT.",
"requestId": "requestId",
"time": "Tue, 06 Sep 2022 16:10:01 GMT"
}
However, when I try to create a Job and get the list of device groups, this brings me all the device groups I have been attempting to create, but it doesn't let me see the number of devices and doesn't allow me to continue creating the Job. And then, I request through the REST API to delete such device group with one of the ids, and it deletes it just fine.
My question would be...
Is this related to the query or what exactly?...
Because according to their documentation this is a valid query
I can confirm that it is not supported yet, try to use ($id= '' OR $id = '') to work around now.

Acumatica REST API Error: Inter-Branch Transactions feature is disabled

We are using the REST API to create a Sales Order in Acumatica. For some customers we receive the below error message. Not sure why the API is complaining about “inter branch” as we target a single tenant and try to create a sales order for an existing customer under that tenant. (Not sure if branch means something else than “tenant” in this context)
I read the other post on the forum and tried to find the feature for enabling inter branch but that feature was not listed. Can someone please help with this?
Exception: An error occurred during processing of the field Allocated value False Inter-Branch Transactions feature is disabled.
PX.Data.PXOuterException: An error occurred during processing of the field Allocated value False Inter-Branch Transactions feature is disabled
We do not pass a field called “Allocated” and not sure why the API is complaining about it.
Below is a sample request we pass and it only happens for some customers and not all:
{"CustomerID":{"value":"C006089"},"Description":{"value":"Hinnershitz"},"Details":[{"InventoryID":{"value":"DESIGNER"},"LineDescription":{"value":"Kitchen - perimeter - Hampton (Pure White), Frameless, Birch Plywood, Dovetailed Wood\n"},"OrderQty":{"value":1},"UnitPrice":{"value":7105.059800000001}},{"InventoryID":{"value":"FUEL SURCHARGE"},"OrderQty":{"value":1},"UnitPrice":{"value":355.25299000000007}}]}
You must enable Inter-Branch transactions feature.

Dialogflow Webhook call failed. Error: [ResourceName error] Path '' does not match template

I am using Dialogflow ES and once I got the webhook setup, I haven't been having issues. But after a few months, I just started getting a random error. It seems to be inconsistent as in sometimes I get it for a specific web call and other times it works fine. This is from the Raw API response:
"webhookStatus": {
"code": 3,
"message": "Webhook call failed. Error: [ResourceName error] Path '' does not match template 'projects/{project_id=*}/locations/{location_id=*}/agent/environments/{environment_id=*}/users/{user_id=*}/sessions/{session_id=*}/contexts/{context_id=*}'.."
}
The webhook is in GCP Functions in the same project. I have a simple "ping" function in the same agent that calls the webhook. That works properly and pings the function, records some notes in the function log (so I know the function is being called), and returns a response fine, so I know the webhook is connected and working for other intents in the same agent before and after I get the error above.
Other intents in the same agent work (and this one WAS working), but I get this error now. I also tried recreating the intent and I get the same behavior.
The project is linked to a billing account and I have been getting charged for it, so I don't think it is an issue with being on a trial or otherwise. Though the Dialogflow itself is in "trial", but the linked webhook function is billed.
Where can I find what this error means or where to look to resolve it?
After looking at this with fresh eyes, I found out what was happening.
The issue was a mal-formed output context. I was returning the bad output context sometimes (which explained why sometimes it worked and sometimes it didn't). Specifically, I was returning the parameters directly into the output context without the output context 'name' or 'parameters'. Everything looked like it was working and I didn't get any other errors, but apparently, when Dialogflow receives a bad web response, it generates the unhelpful error above.

Browserstack reports successful even when test fails in Nightwatchjs

I just started using nightwatch with browserstack and I'm noticing that when we get a failed test, nightwatch registers the failure, but browserstack does not.
sample test I am using.
Also I am using free trial version of BrowserStack.
My question is:
Are there any ideas how to tell browserstack when a test run failed ?
From BrowserStack doc:
REST API
It is possible to mark tests as either a pass or a fail, using the
following snippet:
var request = require("request");
request({
uri: "https://user:key#www.browserstack.com/automate/sessions/<session-id>.json",
method: "PUT",
form: {
"status": "completed",
"reason":""
}
});
The two
potential values for status can either be completed or error.
Optionally, a reason can also be passed.
My questions are:
How I can get 'session-id' after test execution ?
What if I can see "completed" status in dashboard already ?
A session on BrowserStack has only three types of statuses:
Completed, Error or Timeout. Selenium (and hence, BrowserStack) does not have a way of understanding, if a test has passed or failed. Its by the multiple assertions in your tests that appear on your console, that you infer if a test has passed / failed. These assertions however, do not reach BrowserStack. As you rightly identified, you can use the REST-API, to change the status of the session to 'Error', if you see a failure in your console.
I would suggest fetching the session ID of the test as the test is being executed, since fetching the session ID after the test execution is a lengthy process. In Nightwatch, you can fetch session ID as follows:
browser.session(function(session) {
console.log(session.sessionId);
});
Yes, you can certainly change the status of the session once it is completed. That's where the REST-API comes to help!
If you came here searching for a solution in Python, you could use
requests.put(
"https://api.browserstack.com/automate/sessions/{}.json".format(driver.session_id),
auth=(USERNAME, ACCESS_KEY),
json={"status": "failed", "reason": "test failed"})

Resources