This is a more practical integration requirement. Thingboot's open interface design is quite standard, and the device can be controlled through HTTP requests, so it is not complicated to integrate this 5W speaker into an unattended scenario.
Below I have compiled a solution for you, which is more practical and I hope it can give some reference to friends in development or selection.
Unattended space voice prompts: 5W speaker integration solution based on Thingboot open interface
1. What pain points do we want to solve?
In unattended scenarios (such as unmanned convenience stores, self-service charging pile areas, shared conference rooms, and even unmanned company tea rooms), the most feared thing is that users will be "confused."
For example: the user scans the code and the pile is activated, but the car is not charged and he does not know it, so he waits there for half an hour; or he enters the conference room to tinker with the projector for half a day, only to find that there is no reservation at all.
Pain pointsLack of "two-way interaction" guidance.The user may not necessarily read the words on the screen, but if someone suddenly speaks, he will definitely listen.
Our goals are:When the system detects a specific event (such as successful code scanning, equipment failure, illegal break-in), it immediately allows the 5W speaker on the wall to "speak" through the API to guide the user in real time.
2. Protagonist device: Intelligent 5W wall-mounted remote control voice speaker
This device has several features that make it suitable for unattended scenarios:
Small size, flexible installation: After all, it’s only 5W. It doesn’t take up much space when hung on the wall or ceiling. It uses 2.4G Wi-Fi to connect to the Internet. There is no need for additional wiring and signal lines, as long as there is a socket..
"Text-to-speech" is the core: The best thing about it is that you don’t need to record and upload it in advance. You can send a text directly through the interface, and it will read it using AI voice. It supports male and female voices and can adjust the volume..
The interface is open and not locked: Supports the standard HTTP API, which means that whether your backend is written in Java, Python, or the frontend is directly adjusted, or even a low-code platform like Node-RED, you can directly "feed" instructions to it..
3. Integrated "handshake": understand Thingboot’s interface protocol
To connect the speaker to your project, you actually need to send a specific HTTP request. The interface logic of Thingboot is very clear, mainly focusing on these two:
Core command: issue commands to the deviceThis is the most commonly used. Whatever you want the speaker to do (talk, adjust volume, shut up), use this.
Request address
http(s)://api.thingboot.com/{your AppID}/device/control/Must carry
device: The ID of the speaker (can be seen on the device or in the background).
order: This is the key point. Specific commands are written in it, such as
{"play:gbk:16":"welcome"}.
Auxiliary capabilities: group executionIf your uninhabited area is large and you have several speakers installed (such as a large factory building), you can use the "grouping" function. In the event of an emergency (such as a fire alarm), send an instruction to have "all the speakers in the East District" call everyone to evacuate at the same time, instead of calling them one by one.
4. Key actions: How to make it "open" and "shut up"?
According to Thingboot’s device documentation, we need to remember several of the most commonly used command formats
1. Let it speakThis is the core. For example, if someone opens the door of an unmanned warehouse, you want to remind him to "please do the safety check first."
Command format:
{"play:gbk:16":"Fill in the text you want to say here"}Notice: This device natively supports Chinese, just write Chinese characters directly. If there are numbers in it, such as "employee number 10086", it will read it intelligently, but when you use code to splice strings, convert the numbers into strings and pass them over to avoid strange pauses.
2. Shut it up (emergency stop)If the system gives false alarms, or if the chanting continues like a sutra, the user will be very annoyed. There must be logic for a "stop" button.
Command format:
{"stop":"1"}(This should stop everything and mute the sound immediately).
3. Environment adaptation (volume/speech speed)Unattended areas may be noisy during the day and quiet at night. If the light sensor detects that no one is around, is it possible to turn down the volume to save power?
Adjust volume:
{"volume":"7"}(Generally 0-9, the larger the value, the louder).speed regulation:
{"speed":"5"}(Normal speaking speed).
5. Practical drill: voice prompts for unmanned parking lots
Suppose we are building an "unattended self-service car wash" or "scan QR code charging pile". Business logic is usually:User scans QR code -> payment -> device startup.
Step 1: The user scans the QR code to pay successfullyAt this time, the backend received the payment callback. In addition to giving the charging pile an instruction to turn it on, the speaker also needs to "say something" to confirm and give the user a clear feedback.
Backend code logic
Receive payment success callback.
Assemble JSON data:
{"device":"YY_Spk_001", "order":{"play:gbk:16":"The device has been started, please take out the charging gun and start charging"}}Calculate the signature (Sign), please pay attention to this step: the authentication of Thingboot is
md5(md5(AppSecret) + ts), timestamps should be aligned.Send a POST request.
Step 2: Anomaly detectedIf the charging pile reports a "Fault: Poor grounding".
Linkage logic: The system immediately sends instructions to the speaker:
{"play:gbk:16":"Equipment failure, please change parking space or contact customer service"}.Experience improvement: If the user is about to swipe his card at this time, and hears this, his work will not be in vain.
Step 3: User operation timeout (anti-addiction/anti-occupancy)If the car is full, it won't drive away for 15 minutes.
Level reminder
First 3 minutes: giving instructions
{"volume":"3"}+{"play:gbk:16":"Your car is full, please move the car in time"}(Volume is lower).After 15 minutes: Turn up the volume
{"volume":"7"}+{"play:gbk:16":"If the space is occupied overtime, additional occupancy fees will be charged"}.
6. Pitfalls and Optimization (Pitfall Avoidance Guide)
About concurrency and frequency limitsThe Thingboot interface has a frequency limit, it seems"1 time/second"restrictions. If your business volume is very large (for example, hundreds of orders per second during Double Eleven), be sure not to instantly adjust the API hundreds of times to "talk" in a loop, otherwise your traffic will be limited. Add a"Message Queue", let the broadcasting tasks be queued up one by one, and a maximum of one command can be sent per second.
Asynchronous features of HTTPCall interface returns
code:200, it only means "the cloud received the command", it does not mean "the speaker really rang". If the speaker is disconnected (for example, the Wi-Fi is disconnected), it will show success on your side, but there will be no sound in the scene.Countermeasures: Xinsyn has an asynchronous message push mechanism. It is best to subscribe to the status push of the device. If the speaker is offline, your background should record it and try again or notify the administrator through SMS/App push.
Play conflict (don't let it chant)Unattended spaces may trigger multiple events at the same time. For example, "someone passing by" triggers "Hello", and "temperature is too high" triggers "Alarm". Without logical control, these two sentences would be mixed together and no one could hear them clearly.
: Set in business logic"priority".
superlative: Fire alarm, malfunction, emergency stop (interrupt all current playback).
sub-high: Payment successful, important reminder.
Ordinary level: Welcome, warm reminder.
If a high-priority request is currently being broadcast and a new low-priority request comes, it will be discarded directly; if a high-priority request comes, one will be sent first.
{"stop":"1"}Clear the current one and send a new one.
7. Summary
Integrating Thingboot's 5W speakers into unattended projects is essentially a"Event->Trigger->Call HTTP API"process.
The biggest advantage of this plan is thatQuick landing——The speaker is plugged in and connected to the Internet. Your developer spends half a day reading the interface documentation and writing dozens of lines of code to adjust the API, and the scene comes alive. Compared with having people stare at a screen, listening with ears is a more direct and human way of interaction.