How to Control a Witty Cloud From Another Witty Cloud Device
by scanos in Circuits > Raspberry Pi
829 Views, 1 Favorites, 0 Comments
How to Control a Witty Cloud From Another Witty Cloud Device
This video describes how to control a Witty Cloud from another Witty Cloud device. You could use this technique say, to switch lights and on and off on multiple devices from your PC through a web browser. This shows the basis of controlling Witty Cloud and Tasmota devices in general, and is the first step before moving onto Tasmota rules and using MQTT.
About the Witty Pi
The Witty Cloud is an inexpensive ESP8266 ESP-12F wifi enabled processor which includes an RGB LED and LDR light sensor. It is easily flashed by connecting the Witty to your PCs usb port then using Tasmotizer to flash it.
Once flashed, the device will show as a Wifi Access point which when selected, prompts you to add your own wifi credentials to enrol it on your LAN.
Tasmotizer may be downloaded from https://github.com/tasmota/tasmotizer
The associated bin files may be downloaded from https://github.com/tasmota/tasmotizer
Communication Between 2 or More Witty Cloud Devices
You can access the Witty Cloud GUI simply by typing in the IP address into a web browser. From the main screen, you can toggle the LEDs on the Witty Cloud.
To communicate with other Witty devices you need to access the console menu show in the screen above and use the WebSend command, e.g. on the Witty with IP address 192.168.1.232 you can toggle the power on the Witty with IP address 192.168.1.239 by accessing the console of 192.168.1.232 and typing WebSend [192.168.1.239] POWER1 toggle.
Security
This instructable is intended to introduce you to Tasmota commands. It should not be used in production areas unless you strength the security around the configuration. The steps to do this include
1. Use a strong web admin password on the Witty / Tasmota device (From the Witty web interface go to the menu Configuration/Configure Other/ then set and enable the Web Admin Password
To use the web admin password in your scripts you will need to use the following format
curl -X GET --proto-default http "http://192.168.X.XXX/cm?user=admin&password=very_strong_password&cmnd=Rule1%20On%20switch3%20state=OFF%20do%20dimmer%20100%20endon"
Obviously you have to remember the password.
2. Do not use on a LAN which has a sensitive data. Consider partitioning the LAN for your IOT devices and use a DMZ.
3. Enable HTTPS on your Tasmota devices.
4. Ensure your scripts are OWASP compliant
5. etc
Next Step
You can use these commands on other devices such as Raspberry Pis, for example, from the RPI CLI you can use the following commands to toggle power on Witty Cloud 192.168.1.232. The respective commands are
curl -s http://192.168.1.232/cm?user=admin&password=very_strong_password&cmnd=Power%20Off > /dev/null
curl -s http://192.168.1.232/cm?user=admin&password=very_strong_password&cmnd=Power%20On > /dev/null
This is expanded through bash scripts and CCS/Javascript in another instructable https://www.instructables.com/DIY-Smart-Light-Con... In future Instructables, I will show you how to improve this further using MQTT.