[Feature request] HTTP Event sensor
An HTTP sensor that can make a GET/POST requests in a scheduled manner that is triggered when the response body contains a specific string (will require parsing the body with regex/ simple search) or on a given response code. The scheduling can be done with the Time sensor. Example input parameters:
- method
- url
- headers
- request body
- request parameters
- authentication
- number of retries with optional delay between them
Triggers
- response code == something or
- response body equals/contains a string
- contains by simple search (fuzzy, case-sensitive or not, exact match) or regex
Usecase
- Integration with home automation systems like homeassistant
- Controlling smart home/iot devices
Hm, hm, I will looking on it. But this must be broadcast (UDP?). Yes? I must studying how internet connectivity working. :-)
HTTP/1.1 and HTTP/2 use TCP, HTTP/3 uses UDP. In general, unless you implement the actual connection, you shouldn't care. Almost all languages include rest clients in the standard libraries. I have not written Java in a long time, but a quick search brings HttpURLConnection | Android Developers or Overview - OkHttp. The latter looks more useful. Here's an example client similar to what we're trying to achieve here: Waboodoo/HTTP-Shortcuts: Android app to create home screen shortcuts that trigger arbitrary HTTP requests