I will stop the thing a few hours and it will work in the evening.
I stopped mobile alerts for 3 hours but always get the error:
But ive I put it into browser I get the right answer:
At REST-API documentation they wrote:
API Rate Limits
Rate limiting is considered on a per sensor basis. Allowed are up to 3 calls for
a sensor within one minute. If more than 3 calls are made within one minute
further calls are blocked for 7 minutes.
If rate limiting is applied the server returns the HTTP response code â429 Too
Many Requestsâ.
My settings in OH 3 are these und didnât change them and it works until wendsday:
Invalid call blocking
To prevent misuse, if more than 5 calls with invalid parameters are made from
the same ip address within 15 minutes, further calls from the same ip address
within the 15 minute time window will be blocked.
If invalid call blocking is applied the server returns the HTTP response code
â403 Forbiddenâ.
Problem solved!
I wrote an email to mobile alerts. I didnât get an answer, but since friday 16-04-2021 12.00 everything works fine.
In the past a friend of me made a small app for doing this. But suddenly it stopped working.
I tried to build the same solution with the HTTP-Binding and RegExp / JS on my Openhab3.
But, I always get now on the Request of the URL a 403 Forbidden.
My code looks like:
UID: http:url:MobileAlerts
label: MobileAlerts
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: http://measurements.mobile-alerts.eu/Home/SensorsOverview?phoneid=xxxxxxxx
delay: 0
stateMethod: GET
refresh: 60
commandMethod: GET
timeout: 12000
bufferSize: 2048
channels:
- id: Windgeschwindigkeit
channelTypeUID: http:number
label: Windgeschw
description: ""
configuration:
stateTransformation: JS:GetWind.js
Did it stop working before or after you moved to using OH3 and the OH3 binding?
What happens if you put your URL into a web browser?
It seems I found the route cause. The Request needs to have a user-agent information. I tried it with wget wget --user-agent=âMozillaâ https://measurements.mobile-alerts.eu/Home/SensorsOverview?phoneid=xxxxxxx and it works.
But I am too stupid to configure a headers information in the thing. Who can help me here?
You canât change the user-agent
Oh. Thankâs for the information. Bad situation.
Does it work still on your setup? It looks like, there is now way to use it anyway.
I have the same behavior. It was working for a full year and suddenly stopped working since a week or so.
Can we perhaps change some settings in http.cfg to fix the issue?
For me it sounds like, there is now way to do this with the HTTP-Binding.
Thatâs why I tried it with EXEC and CURL.
https://community.openhab.org/t/re-oh3-http-binding-regexp-js/124348/2?u=roman_e
This is a clue itâs the other end that has changed, has become more picky about what user-agents it serves i.e. rejecting bots etc.
Thatâs interesting. I couldnât open the link though; it seems to be broken.
I decided to use Exec and Curl too. Used -A option to indicate agent. Took me about 10 minutes to relink items. All seems to be working fine again. Thanks!
Hey,
I moved to a new appartement, stopped OH3 at my old appartement installed everything in my new appartement without changing anything an restated OH 3.
Everything works without Mobile Alerts.
The error at the log likes like this:
If I try directly inside browser with:
https://measurements.mobile-alerts.eu/Home/SensorsOverview?phoneid=XXXXXX
it works without any problems.
I`ve restarted OH 3 2 times.
Does anyone knows what to do?
Thanks, Ansgar
Hey,
can you show, how you get it work?
Link of Roman_E doesn`t work.
Thanks.
Sure, create a shell script like
getMobileAlertsHTML.sh:
#!/bin/bash
curl https://measurements.mobile-alerts.eu/Home/SensorsOverview?phoneid=XXXXXXXXX -A Mozilla
Then create a âThingâ in OpenhabUI for âExecâ binding as follows:
and thatâs pretty much it. Your webpage data will now start coming in the output of this âThingâ. You can create channels, just like you would otherwise have done for using regular expressions to get the data.
Hard to explain. Is there anything else in the logs? Can you enable TRACE logging, so we see what is actually send and received?
Thanks,
thing created and running:
But I canât find where to create own channels:
At the old way it was no problem:
Apologies for the delay as I was busy.
It is similar. Here is my screenshot of how I added the channels.