We use cloud to cloud and Webhooks. The SmartApp first asks for the location and room when the device installation session is started. How can I find out which room the user has chosen? Now I only get the locationId. The roomId is missing?
This message is returned from the SmartApp to the Webhook.
Hi, @Heikki_Pirttinen!
So, did you define settings to select the location and room? I don’t see those settings included in the payload, have you checked if you receive only the values updated?
At the beginning, I choose a place and a room. The first message I get is “lifecycle”: “CONFIGURATION” and “phase”: “INITIALIZE”. This message has no location information at all. And not in the following “phase”:“PAGE” or “lifecycle”: “OAUTH_CALLBACK” messages either.
INSTALL or UPDATE messages have a locationId, but not a roomId.
I get this message after I have selected a room. The SmartApp seems to remember previous cofigs.
A SmartApp is installed on a Location level, so, I wouldn’t expect it to be bound to any room.
That’s why I asked if you had a setting where you could select the room because I’m not sure where are you currently selecting it.
But, do you want to know in which room is the device located?
The installation process first asks for the location of the device (location and room). How can I access this information? When user select the next button, we get a request to initialize our cloud. This works OK, but the room information is missing.
aaaaah, got it.
I’ll ask the team about this but, currently, I would say that info only belongs to the device itself. When we query it, it has the roomId property:
I’ve not played with this yet. Is the issue that it is down to you to install the device in the required room and you can’t do that if they haven’t told you what it is? Or does it end up in that room anyway?
The problem is that when I don’t get a roomId, the roomId is not set during the installation of the device, so the device does not go to any room. The device can be found in the SmartApp for devices without a room section. Since the roomId is not set, the roomId is also missing when reading the information from the device.
I have now worked around the problem by reading all the rooms of the user and selecting the first one. I will add this roomId to the device installation information. The problem is that the user’s choice does not matter here, but the user finds the device more easily when device even goes somewhere visible.
Ah, this doesn’t happen when we use the SmartApp SDK. You mentioned your integration wasn’t using this tool, right?
I’m not sure why but I’ll check with the team if it can be retrieved somehow.
Ok, just to clarify, there are two different approaches for Cloud Connected Services → Webhook endpoint.
One is a SmartApp Connector and the other is an ST Schema, both have their own SDK to help you with the development SmartApp NodeJS SDK and ST Schema NodeJS SDK.
What I asked before is if you were using the SmartApp SDK of the link above.
Here’s an example of a SmartApp Connector definition using the SDK:
Because we have a serverless service with a maximum instance usage time of 9 minutes. We can’t stay and listen to WebSockets. Because of this, we cannot use the SmartApp SDK.
Hi, @Heikki_Pirttinen.
Following up on your question, the team mentioned that the page where we select the location and room where the device will be installed belongs to the ST app itself, not the SmartApp, therefore, this value isn’t known by it.
I previously mentioned using the SDK the issue of the device being created in another room didn’t happen but the SDK is not the one putting the device in the correct room but the ST app.
When this happened, it was because you included the roomId in the device’s properties empty or the property was empty?
Basically, the ST app should place the device where selected. For example, I don’t assign any roomId and it worked
The team also mentioned that this process can fail, so, if you already found a workaround, you should continue using it.
Another thing you can do is create your own setting in the SmartApp definition to get the rooms list and allow the user to select one where he wants to install the device. The only inconvenience would be that the user needs to install the SmartApp before making the API request (this is to get the SmartApp Access Token).
When the user installs the device. First he/she chooses the location and the room. After this, Webhook get the first message (CONFIGURATION). Rooms cannot be requested until the user has given permission. Granting permission is the final step of the Wizard. I think this message should also include the roomId (INSTALL/UPDATE).
If I send the API command “Install a Device” without a roomId, the device does not go to any room.
My current workaround is not acceptable. Because the user’s choice is not taken into account. Are you saying there is no solution for this? Am I the first one to use the SmartApp like this? Where can I find ST app support?
As the page of the selection of the location and room isn’t part of the SmartApp, it is normal this is not included in those lifecycles (context variable)
I’ll open a report to get more info about why the app isn’t creating the device where it belongs. Just a heads up, this can take some time to be reviewed by the team.
Can you share the following information, please?
App ID of the SmartApp Connector (it’s in the Dev WS)
Replicate the error and share the mobile app’s logs:
For Android:
Go to the “calls” app on your Android phone
Dial *#9900#. It will open the Dump sys
Chose RUN DUMPSTATE/LOGCAT and wait for it to finish
Then, select COPY TO SDCARD(INCLUDE CP RAMDUMP), it takes some time as well
Connect your phone to a computer (USB cable)
Open the device (phone) in the files explorer to see its content
Find the log folder and look for the text file whose name is similar to
“DUMP_STATE_G93FXXU1DQJ3.DM_202210261516”
The last value is the current date and hour which helps you identify the correct folder.
Copy that file to the computer and share it with us Note: You can also send the file directly from your phone, but it can be hard finding the file due to its long name.
For iOS:
2. Go to Dashboard settings (hamburger icon).
3. Select “Help” (at the bottom of the menu).
4. Tap on “Report a problem” and agree to the prompt.
5. Save these logs in the storage service of your preference.
6. Download and share them with me.
For Cloud-to-Cloud integrations it’s more common for companies to use ST Schema because of its level of security (OAuth 2.0) and it doesn’t require direct requests to the API to create a device, it has a discovery process where they are created.
In this integration, the roomId isn’t included either, the app should take care of it just like in a SmartApp.
If I install several devices, the first device does not go into any room, the second device goes in the right room. The third device also goes also to the right room, but takes the previous device with it, so two devices now go to the same room even though they should go to different rooms. The fourth device also goes to the right room, but the other device follows behind, so now three devices in the same room even though they should be in different rooms. The first device stays in the “No room” section all the time. Other devices change rooms depending on which room was last selected.
We have applied for the WWST certificate. When I now add the device, selecting through our company name, the device is installed correctly. It seems that the problem is only on that test side.