-
Notifications
You must be signed in to change notification settings - Fork 7
Common ESPEasy Setup
Before using ESPEasy you need to flash and configure it.
Steps for the setup:
Go to the ESPEasy Wiki and follow the instructions how to download and flash it to your device. There are also a number of Youtube videos explaining it in detail. If you are brave you could try ESPEasyMega which is in beta.
After flashing the device you should connect it to normal power. After a few seconds the Wifi network ESP_0
appears - password is configesp
. Connect to it and then launch your browser to http://192.168.4.1/ - select your home network from the list and enter your Wifi password. After 20 seconds the device should have joined your home network and you should see the IP address it has on your network displayed on the page. In case the IP is not displayed you may have to check your wifi router/access point for a device named newdevice
. Others used the Smartphone app Fing
to locate it. Rejoin your home network and use our browser to go to the IP of the device. Using a Fritzbox you may use http://newdevice.fritz.box/ or just try http://newdevice/.
Select the Config link and adjust the name to your needs. Best practice: Just use letters (lower case), numbers and dashes - it should adhere RFC 952. Adjust the Unit number if you need that and any of the other settings too. A static IP is useful to not hunt changing IPs.
Select the Tools
link and then select Advanced
. Setup NTP - some routers can be used as NTP server, for example a recent Fritzbox has this feature. If you don't have NTP in your local network, find a server that is close to you in the NTP.org Server List. The time is UTC so you need to adjust the offset and potentially select DST (Daylight Saving Time). You must also select Rules
. Adjust the rest to your needs.
Using MQTT to switch things on and off remotely or receive values requires only little more configuration. Note: Using Domoticz you need to set an additional IDX / Var
value for the configured devices.
If you are using ESPEasy or ESPEasyMega you'll find the Controller configuration on the Config link or as separated Controller link. I am using Mosquitto MQTT together with HA-Bridge. Non-integrated MQTT servers should be configured as OpenHAB MQTT
which sounds a little misleading but OpenHAB has no integrated MQTT and uses some external one. You need to provide IP or DNS-name and user and password. That's it. Depending on your needs you may adjust the pub/sub patterns but the default should be sufficient.
Depending on the MQTT you use, you can already send messages to trigger things like a relay. For example if your device is named sonoff-s20
and you use a Mosquitto MQTT server a mosquitto_pub -h mosquitto-server-name-or-ip -t /sonoff-s20/gpio/12 -m 1
will switch the relay on.
You can enable/disable the publishing of device states. I suggest to only publish the relay state.
Independently of MQTT you can always use HTTP like so http://sonoff-s20/control?cmd=GPIO,12,1. Or http://sonoff-s20/control?cmd=event,RelayOn in case you configured an event rule named RelayOn
for GPIO12 doing the trigger - this is a clever way to standardize interfaces and use easy to remember names.