how to automate or verify smart home devices - python

Automation of Smart Home devices
To verify smart home devices like end-to-end (from mobile App to smart home devices).
what are the automation framework you suggests.
Mobile App - developed Appium with python and Robot
Product - REST
API calls. Smart Devices - Verification of lights ON/OFF, color
change, etc
Can you please suggest or add any better methods to verify end-to-end.
EG: Image comparison, any other method.

Actually it depends on two things:
1- How the devices are calling each other. And whats is the main controller.
2- Whats you purpose of testing? Testing the devices themselves or testing the functionality of the control panel and softwares?
About CP and softwares:
If the system using API > Of course api-testing is required
If there are a panel and you can access it with browser> Using selenium for desktop and chromedriver for mobile browser
If there are a mobile app, using Appium
etc.
For the system itself, it is completely another field and responsibility of the electronic and robot engineers. And depends on hardwares. But the general way is I/O checking. Means that engineers check the input signal with device actions and vice-versa.
Hope this helps.

Related

How would I allow my IOS app communicate with my python script

I'm developing a product where it shows information about stuff, the product involves a raspberry pi which automatically runs a python program on boot. When it's the users first time using this product they will have to set it up (log into their account etc.). I'd like it for the IOS app to recognize that the product is nearby and allow the user to enter the necessary data (WiFi information, login credentials, etc.) for that product through the app on their phone.
Basically, what I'm trying to ask is that is there any way where I can exchange data between my IOS app and my python program, running on my raspberry pi? I can't do anything through databases since there would be no way of knowing which device needs to connect to what, so I'm guessing something like Bluetooth, just to send the first bits of data (like Wifi information) to get the two linked?
MORE INFO:
An example would be setting up a device like Alexa, how does Alexa connect to your devices to obtain Wifi information so that it can do everything else by itself?
Thanks, Nathan.
If you want to prototype a solution quickly, try Blynk. I've managed to do this type of link using NodeJS and a Raspberry Pi with Blynk previously but their web page suggests you could also use Python or MicroPython. The downside is that, beyond doing basic UI elements, you need to pay for it.
Another approach is to set up a WiFi access point with a web-based system that supports configuration. An example of a device that does this is the open source energy monitor. It might be the case that you can look at how they set up their AP and web server as it is all open source.

Enable Google Assistant in Windows

I am trying to do some automations using Google Assistant. Is it possible to integrate the mobile google assistant app with python? For example if I say open edge in my PC in my mobile and I am able to fetch the same from a python app running on my PC, I can create custom actions based on that. Can anyone help me with how can that be possible?
At the highest level, Google Assistant is able to be programmed using "Actions on Google". Actions on Google takes your audio input and drives a service called "Dialog Flow". Dialog Flow parses your natural language looking for an "intent" (what you are asking for). When an intent is matched, a "Webhook" can be called to process the request.
If you have an application running on your Windows PC that is listening for an incoming REST request and can process the payload content, then the Webhook specified in Dialog Flow can be used to invoke your Windows application (REST app) that can perform the work.
Wiring all this up does take some skills. Some good reading to start with would be:
https://assistant.google.com/
https://www.youtube.com/channel/UC1EXoqvR9VrmWnM9S47SfVA
https://cloud.google.com/dialogflow-enterprise/docs/

Upload stock images Appium iOS Simulator

My application allows for users to upload a picture of themselves. The iOS simulator comes with stock images. How would I go about using one of those stock images for the image upload?
After clicking on the element that allows for users to upload images I receive the iOS popup:
I select "Album" but when using the Appium inspector it does not allow any access to these images, I am not able to select any (as seen in the screenshot)
I doubt if its possible to parse this screen since its already other app: Photos app.
With Appium you can interact only with the app that is signed same certificate as WebDriverAgent. At least its valid for real devices, but since you are not able to parse with Appium Desktop my guess its still the same for simulator.
You might try to use TouchAction/tap by coordinates (less stable, but quick way to go) or have integrate image recognition library, e.g. sikuli in your code (more work, but clearly more stable) to select images in Photos app

Does Video.io support Xamarin forms

I want to integrate a video and text chat for web (python) and mobile (xamarin). The requirement is to make customers able to communicate across platforms i.e mobile to web and vice versa.
Mobile application will be developed using Xamarin technology and the website will be in Python.
Is video supported by both platforms?
Yes it does, check out the vidyo.io Xamarin sample on github - https://github.com/Vidyo/VidyoConnector-xamarin
Note that vidyo.io SDK runs on the client end. That means it will either run on your mobile device (using native libraries or in your case using Xamarin), or in case of web sites it will use javascript. You do not need to integrate vidyo.io SDK on the server side.
On your server, what you will need, is to generate "tokens" whenever your client device or website wants to connect to a video conference.
Since you are using python you can take a look at their sample token generator at https://static.vidyo.io/4.1.16.8/utils/generateToken.py
You can learn more about tokens on their website -
https://developer.vidyo.io/documentation/4-1-16-8/getting-started#Tokens

How to send command to receipt printers from Django app?

I have created a simple POS application. I now have to send a command to the receipt printer to print the receipt. I don't have any code related to this problem as I don't know where to start even. My questions are:
1) Is Windows a good choice for working with receipt printers as every shop I went to use a desktop application on Windows for POS?
2) Is it possible to control the receipt printer and cash register/drawer from a web app?
3) Is there a good reading material for developing POS systems by myself?
For a web app to use a device on the client, it has to go through the browser. I may be wrong, but I seriously doubt this is a built-in feature for receipt printers. I see three options:
1) Find/make a normal printer driver that works with your receipt printer, put it on the client box, and just use the normal print js commands.
2) Find/make a browser plugin that talks to the printer and exposes an API.
3) Find/make a simple web app that talks to a server-connected receipt printer (probably via native code execution or script call), and install it on each POS, with CORS to allow remote origin; then just post to that on 127.0.0.1:whatever from the webapp client script.
Side note: I seriously discourage connecting a POS to anything resembling a network any more than absolutely necessary. Every outbound network request or trusted network peer is a potential attack vector. In short, I would never use django or any other web app for physical POS software.

Categories

Resources