1

I am using ESP32 and micropython to create electric blinds. I am also using MicroWebSrv with websockets to control the blinds from my phone using a web page.

I want to be able to control it using voice commands to Google Assistant.

I was able to make it work with IFTT and Adafruit.io feed. The problem is that after some time my ESP32 looses connection to the adafruit and I was not able to make it reconnect easily. It happends all the time, even when I only leave the mqtt library alone on the ESP32 and nothing else. I tried checking messages every 1sec up to 10sec (to avoid reaching the free Adafruit.io limit of 30 items per minute), made no difference.

I'd like to ask if there is some other way how can I control the ESP32, ideally without the Adafruit.io or any other third party (IFTT is fine), as this is causing me the troubles. I even have public IP address, so I can directly send for example HTTP requests to my ESP32 from the internet or something.

So is there some other way how Google Assistant can tell my ESP32 to OPEN or CLOSE the blinds?

ezpzlmnsqz1337
  • 394
  • 1
  • 5
  • 16
  • 1
    Perhaps the question you should be asking is “what’s wrong with my code that it’s losing its connection to AdafruitIO constantly”. If you’re unable to make that work it seems likely you’ll have success with other systems, also, the Adafruit limit of 30 items is a publishing limit, not a “checking messages” limit. – romkey Nov 25 '20 at 13:15
  • You are right, I just tried it now with a web page and I can check all the time and the connection will never die, even if I check every second. But my question was more about if I really need some third party at all, since I have public IP and I will not have to depend on persistent connection to Adafruit... But since the checking is free, I will probably use raspberry to do the checking and then telling it to the ESP32 over websockets. – ezpzlmnsqz1337 Nov 25 '20 at 15:09
  • It just seems really unfortunate to me that for my Google Assistant to tell something to other device/webserver in the same local network, it has to go all around the world through a third party feed where my device has to constantly check for new values with all the time open connection. When everything I really need is to send HTTP request to http://mypublicip/blinds/open or http://mypublicip/blinds/close when I tell a voice command. – ezpzlmnsqz1337 Nov 25 '20 at 15:16

1 Answers1

0

I don't know if this will help you in any way. But once you've established the time, you might be able to use some variables to update that time using this script. It's the only script I can find that is capable of using the timer. It may not be applicable at all, but I'm just trying to help everyone as much as I can.. For listening.

jsjtick=1
jsjtickb=1
def  tickjsj():
    global jsjtick
    jsjtick=jsjtick+1
    return