logo elektroda
logo elektroda
X
logo elektroda

Controlling the ESP8266 air conditioning from anywhere via smartphone

spectral95 654 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17363320
    spectral95
    Level 6  
    Warm welcome.

    I have not found a similar question on the forum, so I am asking.
    Let's assume the following situation:
    I have an air conditioner at home controlled by an ESP8266. I want to make a system that will allow me to turn it off/on from outside the house using a smartphone. Doing this is not a problem if the ESP and the smartphone are on the same network.

    Only one idea comes to mind: the ESP scans the database every, say, 5s and checks whether the air conditioning should be switched on or not.
    I am sure there is a simpler way.
    Please give me some advice or provide helpful links.

    Thank you.
  • ADVERTISEMENT
  • #2 17363339
    simw
    Level 27  
    You can do as you stated, except that port forwarding TCP or UDP , so that you can access the local network.
    In other words, writing on the ESP you run an "entry" on the appropriate UDP or TCP port, on the router you set port forwarding , from the network outside your home.
    The internet access itself you need to be on a so called " external IP ", i.e. from the appropriate class, this property can be provided by your internet provider, currently not everyone provides this, and it is often charged extra.
    An external IP, e.g. from your mobile ISP, may not be sufficient, as it will be alternate IP , but even this can be circumvented via DDNS - Dynamic Domain Name System .

    The terms I have bolded will familiarise you with the subject.
  • #3 17363648
    krzbor
    Level 27  
    The suggestion you gave - periodically polling whether to switch the air conditioning on/off is the best. Redirecting ports from outside to inside may make sense when you have one device. With more than one it is already a problem. Everything can be organised via DDNS and a website served by a web server (e.g. Apache) and PHP. Unfortunately, this requires a separate computer (e.g. a 'Raspberry') that runs 24 hours a day. The advantage is that you can get an encrypted https connection (via the free Let’s Encrypt certificate). All commands are stored on the server and the individual ESPs check in periodically to see if there is anything to do e.g. switching on the heating, opening the gate, opening the wicket and many other things. Of course, the same server can collect data from other ESPs, e.g. temperature, status of alarm detectors, etc. Such a server acts as a 'contact box'. Of course, it can also perform other functions, e.g. FTP, or serve as a NAS.
ADVERTISEMENT