Enable Sonos microphone via API - sonos

Is there any way to enable/disable the microphone on Sonos One (2. Gen) via API calls? E.g. on the openhab binding for sonos I can track the state of the microphone, but can't change it. However when adding any voice assistant the microphone is turned on automatically at the Sonos One so it is possible via software, right?

Microphone access is very limited indeed due to privacy concerns. I am not aware of any way of accessing it directly.

Related

Is there a way to trigger rateItem API as a Sonos control device?

We currently use the Sonos Control REST API to communicate with the players. We would like to trigger the SMAPI rateItem for the currently playing item (like the Sonos APP does).
Is it possible by using only the Control API?
or is there a chance to get the SMAPI URL of the service by the serviceId used by the Control API, so that we can send the rateItem request directly to that service?
Is there also a JSON REST API available for the SMAPI or is it still only SOAP?
Thanx in advance
No
is the way to go, but you need to have figured out the auth secrets etc in order to get the url of the service, as well as the user credentials.
The devices only do SOAP APIs. JSON APIs are only used for the cloud API (and for the local, private version of that).
I have never taken my SMAPI support as far as the rating stuff. Older versions of my apps did support the Pandora Like button, but that was when Sonos used the old Pandora API, before they switched it over to SMAPI.

Sonos API - Is it possible to play specific song via API

I'm currently integrating the Sonos Control API into our platform.
I successfully integrated "simple" commands related to play/pause, skipToNextTrack, skipToPreviousTrack but is it possible to access associated music provider to the sonos account through the Control API ?
I don't want to integrate a "simple" remote control for Sonos speakers. I would like to use the Spotify, Deezer or whatever associated provider account to search and play a song. Is there a way to do that?
Thanks for any reply :-)
This is not currently a possibility with the Control API. We'll bring your request back to the dev team.

How do I retrieve the catalog of a music service?

I am building an app that integrates nicely with Sonos speakers.
I would like to provide the user the ability to select the container (playlist/stations/...leafs of the tree here) of the music service provider. Say Amazon or Spotify...
I managed to understand the vast majority of the SOAP calls however, I could not figure out how to query the user's selected service (devicelink) and provide the same list that the Sonos controller show.
How do I do that?
thanks!
This is not currently supported by the Sonos APIs and many music services take steps to ensure that only Sonos controllers can browse their catalog.
Sonos decided that access to music services should no longer be allowed by third-party-apps some time ago.
I figured out how it works and made a complete walkthrough here, https://Sonos.svrooij.io/music-services.html
It makes a second connection to the specific music service, just for browsing the catalog.
get some data from the Sonos device
Request an auth code for the service
Let the user login
If the user responded, request an access token and a refresh token.
Save these tokens in your Sonos system (optional)
Use the tokens to talk to the music service
Save and use the new access token if it is expired (optional)
You can also use my sonos-ts library, which has support for music services that require authentication.

GCM in Android wearable

Can we create an app that will receive push notification from a server, like in Phones and Glass
Since we have WiFi enabled Watches available now, we can connect to internet, but does it support push from external entity(Server)?
That is not possible AFIK.
You need to push the message to the phone and forward the message via the Data API. You need to keep in mind that the WiFi connection is only a fallback when the bluetooth connection is not available.
You can do it now from Android Wear 2.0 Developer Preview. Android can wear can directly make own network calls and same old FCM/GCM will work.
Under Network Access and Cloud Messaging
Android Wear apps can make their own network requests. When a watch has a Bluetooth connection to a phone, the watch's network traffic is proxied through the phone. When a phone is unavailable, Wi-Fi and cellular networks are used, depending on the hardware. The Wear platform handles transitions between networks. A watch's network access thus does not require the Wearable Data Layer API.
For sending notifications, apps can directly use Firebase Cloud Messaging (FCM), which replaces Google Cloud Messaging, or continue to use GCM.
No APIs for network access or FCM are specific to Android Wear. Refer to the existing documentation about connecting to a network and cloud messaging.
More details - https://developer.android.com/wear/preview/features/standalone-apps.html#network_access

How to use Webrtc api for video chat

I need to use Webrtc api for video and audio call between two users.Actually i have a Elearning learning management system with many users recently i have developed a chat system so that users logged in LMS can chat each other using simple php,ajax and jquery.Now i have implemented only text chat.
I need to develop video chat also like Google hangout and facebook video chat.Users registered in my system are having different email domains means some one have gmail account ,yahoo account etc.
Expecting quick reply
Thanks
To get started with WebRTC, I would suggest to first have a look at the following tutorial on WebRTC fundamentals.
You can then start to implement the native WebRTC API but be aware that you won’t be able to establish a video call if you don’t add a signaling server which does not come built-in with the WebRTC API.
Also if the caller and callee are connected to two different networks, you’ll often need ICE, STUN and TURN servers. Video chat is more complex to implement than text chat and if you don’t have the time and the resources to learn the fundamentals and deploy servers, I would suggest you give a try to a WebRTC Platform that already have an up and running cloud infrastructure to which you can access through an API.
It is the type of WebRTC Platform that we offer at Weemo.