Thanks DUT for an amazing Embeded Conference!
The source code can be found here for the Arduino AZ3166 waterer: https://github.com/apead/az3166arduinogrower
As promised here is the content shared.
Happy gardening!
Thanks DUT for an amazing Embeded Conference!
The source code can be found here for the Arduino AZ3166 waterer: https://github.com/apead/az3166arduinogrower
As promised here is the content shared.
Happy gardening!
Woohoo!! So excited my Azure Percept arrived. Time to do some playing. ๐
Learning Resources
Azure Percept DK and Vision device overview https://docs.microsoft.com/en-us/azure/azure-percept/overview-azure-percept-dk
Azure Percept sample AI models https://docs.microsoft.com/en-us/azure/azure-percept/overview-ai-models
AI @ the Edge https://www.youtube.com/channel/UCa8_TsUuotIMuzkLzGNQPIg
Azure Percept Audio Overview- set up and use your voice assistant https://www.youtube.com/watch?v=K9HfwsDGVnU
Azure Percept | Build & Deploy to edge AI devices in minutes https://www.youtube.com/watch?v=zSBNsEqU5NA
Azure Percept showing Edge Computing and AI in the Agriculture https://youtu.be/1H-U8psvxYE


I hope you enjoyed the Microsoft Developer Cloud Summit today! Thank you very much for attending my session: Automating your home or office with IoT Central and Power Apps” It was a lot of information in 30 min, so here’s the content, resources and source code.
This whole session was done using Home Automation devices combined with OBS. Camera Scene changes were controlled with a standard home remote control. So automation doesn’t have to be traditional garage doors or lighting, you can control you PC life too! ๐ Controlling your OBS Scenes with a Home Automation device
Link to Presentation: Microsoft Developer Cloud Summit 2021 Presentation
Connecting a Pimoroni Environment Monitor to IoT Central
Connecting Azure IoT Central to Power Apps and Power Automate
Arduino Smart Watering Kit with Azure IoT Central
Building an Azure IoT Central โGatewayโ using Node-RED
Flashing Sonoff Devices with TASMOTA
Controlling your OBS Scenes with a Home Automation device
Installing Node-RED in a Container
Installing Eclipse Mosquitto in a Container
IoT Central
https://azure.microsoft.com/en-us/services/iot-central/
Power Apps
https://powerapps.microsoft.com/en-us/
Node-RED
Tasmota
https://tasmota.github.io/docs/
Environmental Monitor
https://www.pishop.co.za/store/enviro–for-raspberry-pi?keyword=enviro&category_id=0
Sonoff
I came across this Smart Watering Kit by Elecrow. It was really great, but one thing missing is internet conectivity. We all know that we can’t grow plants without the “I” in IoT! So let’s see what we can do about that!


The kit comes with everything you need to water four different plants automatically.
The box contains
The kit is very comprensive and includes and LCD display which can show at a glance the conditions of your plants.


The board unfortunately does not have built in wifi connectivity. But what it does have is a serial port. That’s perfect, so what we could do is use that to send telemetry out to another device that is internet / wifi enabled.
A good device for that is a good old (and cheap) 8266 board. I had a NodeMCU in my box of tricks, so I decided to use that.
Parts List

First step is to make it work on a breadboard.
Parts List

Once working, the next step is to build that onto a more permanent solution. I decided to use just veroboard as it was quick and easy.

Device Templates

Create device capabilities for the moisture sensors as telemetry (Moisture1, Moisture2, Moisture3, Moisture4). [Device Definition json file is in the github repository along with the source code]
Create properties for the 4 relay states for each of the 4 valves. [Device Definition json file is in the github repository along with the source code]
Create a property for the pump state. [Device Definition json file is in the github repository along with the source code]
Publish the template and create an instance of the template as a device.

Note the “connection” information for the new device instance.

Take note of the following:

Update the iotcserialrelay.ino file with the:
Deploy iotcserialrelay.ino to NodeMCU.
Deploy watering_kit.ino to the Arduio Smart Watering Board.

Once deployed and connection is made, telemetry starts appearing within IoT Central’s dashboard.

Source code: https://github.com/apead/SmartWateringKit
Product Information: https://www.elecrow.com/arduino-automatic-smart-plant-watering-kit.html
Where to buy? https://www.robotics.org.za/AAK90039K
You can easily set up a standard 433 Mhz remote control that you use every day in your home to control scenes in OBS (Open Broadcast Software) if you don’t own a fancy Stream Deck.
All you need is a remote, a 433 Mhz Wifi Bridge and some Node-RED magic.

Flash the bridge using these instructions: https://explorationspace.co.za/2021/02/10/sonoff-rf-bridge-433-tasmota/


Install the OBS Websocket plugin: https://github.com/Palakis/obs-websocket/releases/tag/4.9.0

The 433 Mhz Bridge when it detects a signal, it publishes a message with it’s contents via MQTT. These will have codes attached to them and in the case of a remote, that code / data that is sent via the message payload translates to the button pressed. You can “train” your solution with the remotes you have. These can be standard house-hold remotes.

The switch statements routes the flow based on the button data to a specific function.

The function sends a message with the “scene-name” with the parameter of the scene created in OBS.

For additional commands refer to the protocol document:
https://github.com/Palakis/obs-websocket/blob/4.x-current/docs/generated/protocol.md
Happy streaming! ๐
Sonoff RF Bridges are great to take every day houshold remotes, alarm systems, passive IR seasons etc , and pass the codes they transmit via MQTT messages.
These bridges can also be flashed with the Tasmota open-source firmware used for Home Automation.




Follow the instructues in this post to flash with the Tasmota Firmware (using the TX, RX, VDD, GND configuration pins) above: https://explorationspace.co.za/2020/12/10/flashing-sonoff-devices-with-tasmota/
The Pimoroni Environmental monitor is an amazing piece of hardware. I recently purchased a few to monitor air quality around the house. https://shop.pimoroni.com/products/enviro?variant=31155658457171

Packed into the HAT for a Raspberry Pi Zero you will find:

Device Definition json file is in the github repository along with the source code. This can be imported into Azure IoT Central and the views generated.


Source code: https://github.com/apead/Pimoroni-Env-Monitor-IoT-Central
Product Information: https://shop.pimoroni.com/products/enviro?variant=31155658457171
Where to buy?
Azure IoT Central makes it easy to connect, monitor, and manage your IoT devices at scale. With the IoT Central V3 connector, you can trigger workflows when a rule has fired, and take actions by executing commands, updating properties, getting telemetry from devices, and more. Use this connector with your Azure IoT Central V3 application.
Url: https://docs.microsoft.com/en-us/connectors/azureiotcentral/
The connector is available to be used in

Power Apps
Due to the dynamic nature of Azure IoT Central, using the connector is not quite straight-forward. To use the Azure IoT Central connector in Canvas apps you need to enable two features in the settings of the application.
These are:
Enabling these two features allows Power Apps to understand the resulting schema from a call to IoT central. “Capture Schema” will be enabled on the formula bar.



Power Automate
Power Automate is a lot simpler to get to work. It automatically understand the dynamic schemas of IoT Central.

I control a few devices from the Internet, but I don’t want all devices exposed and connected to IoT Central. One solution is to build a gateway locally which routes request messages to switch things on or off to the correct device locally.
In this post we will look at how to send commands from IoT Central and route them using Node-RED to the automation device via MQTT.

This architure uses Node-RED as a gateway, and then uses Eclipse Mosquito as a MQTT server. The Grow Light and Air Conditioner in the diagram is an off the shelf Sonoff POW-R2 device flashed with Tasmota.
Installing Eclipse Mosquitto in a Container
Installing Node-RED in a Container

With Node-RED you can visually map the flow / sequence of events. Node-RED supports Azure IoT Hubs and Azure IoT Central, so it’s perfect for this job to do quickly and easily without having to write code.

In Azure IoT Central we have a single device linked with a command. The command accepts a parameter, which will be the device name / topic name on the local MQTT server.

The diagram above shows the command with the parameter.

The Node-RED Azure component supports Direct Methods. These are commands that you can directly invoke on a device. In this case, the device is the gateway itself created within Node-RED.
It supports two methods (as per Azure IoT Central template)

With a Node-Red switch statement we can controll the flow with whichever method name was invoked from IoT Central.

If it’s the “DeviceOn” flow, then the device parameter name (payload) is used to build up the topic for the Sonoff device via MQTT. The payload of the message will be “on”.

If it’s the “DeviceOff” flow, then the device parameter name (payload) is used to build up the topic for the Sonoff device via MQTT. The payload of the message will be “off”.
The Sonoff devices are great, but I prefer to use everything within my home and home automation setup to be fully under my control. Tasmota is a great way of doing just that.
I found the easiest way of flashing devices with Tasmota is using a raspberry pi. I’ve done a quick writeup on how to do this.
Installing ESPTool
Start with installing via the installer script
pip install esptool
Clone from the GitHub repository
git clone https://github.com/espressif/esptool.git
Preparing the Raspberry Pi
sudo raspi-config





Connect the Raspberry Pi to the Sonoff Device

The TXD (Transmit) and RXD (Receive) pins are marked on the raspberry pi. We can use these to communicate serially with the Sonoff Device to flash it with the Tasmota firmware.

Each Sonoff device has pins allocated to reflash the device. These boards usually don’t have headers attached. Here I soldered one to the board.
The important pins are VDD, TX, RX and GND.

Connect VDD to an external power supply. The Raspberry Pi will not be able to power the device off it’s own pins. I used an external bench power supply. Ensure the voltage is 3.3V.
Connect the GND on the power supply to both the Raspberry Pi Ground Pins and the Sonoff device’s GND pin
Connect the TXD on the Raspberry Pi to the RX Sonoff pin and connect the RXD on the Raspberry Pi to the TX Sonoff pin.
Download the Tasmota Firmware
curl http://ota.tasmota.com/tasmota/ --output tasmota.bin
This terminal command will download the latest firmware from the Tasmota site to the Raspberry Pi.
sudo ./esptool.py --port /dev/ttyS0 erase_flash
Start by erasing the devices Flash memory
The port to use on a Raspberry Pi 3 or 4 is /dev/ttyS0.
sudo ./esptool.py --port /dev/ttyS0 write_flash -fm dout 0x0 tasmota.bin
Flash the device with the dowloaded firmware.
Once flashed, reassemble the device and power it on. It should appear as an access point on the network as Tasmota-xxxx if all went well.
You can also follow the Tasmota getting started guide to continue the setup: https://tasmota.github.io/docs/Getting-Started/