MA10100 Temperature sensor
MA10001 Temperature probe
MA10421 Temperature/Humidity station
I have them all in Openhab and charted with Grafana using either web page caching or API call and then using Regex to extract the relevant data. With the API you also get the low battery information and loss of connection.
I wish they did a barometer but they dont so now I am building one from RPi and sensor
edit⦠Update I did build my barometer and it works great. Stepper motors drive the dials for pressure and rate of change. No need to tap this barometer to see which way its going It sends data via MQTT to Openhab and then on to Influx and Grafana. In the meantime Mobile Alerts updated the app to accomodate a barometer. I have not yet seen it for sale.
I havenāt checked the battery messages by now.
My last state of information was that the rest API only works on pro devices and not for the non pros?
Would you mind of sharing your sensor ids with me for testing purposes?
Hi folks,
i've read and reread all post, but i don't get into it...
I have multiple MA-Sensors. I got one Sensor working - the first in the list by using
`sensorCache.url=http://measurements.mobile-alerts.eu/Home/SensorsOverview?phoneid=xxx
sensorCache.updateInterval=60000`
But i donāt get the way to implement all the other sensors from the listā¦
Can anyone provide me a step by step tutorial for getting all Temp/Hum sensors to work?
(actually i donāt now where to put all the above listet codeingsā¦)
Hi, Sorry forgot about your question re sharing. What are the risks if any?
Also, I recently notified mobile alerts of an issue over the Christmas period. Non pro devices were not showing latest data in the App from 2 to 8am. Also, the sensor overview web page was unavailbale during this time. Later in the day the App caught up with the data. So, the data wasnāt lost but delayed. Annoying that the app and website both showed the last bit of the data in the history as the current data with the current time⦠even though it wasnāt.
Mobile alerts aknowledged there was an issue and have now said they have fixed itā¦
Maybe only I noticed it but in your charts you might see an unusually stable period in the early hours or even time slipped data.
ps Got my barometer built: Bosch sensor + MQTT for openhab input + stepper motor dials for fun display. RPi to the rescue again
In a nutshellā¦cache the sensor page (and or use API call if you have pro devices) and the use transform file and regex to extract the data. I identify each sensor with its id. That way when I want to add a new sensor I just copy paste the regex and only need change the sensor id part for new sensorsā¦
Hi, first of all I want to thank everybody for the good information in this thread.
I tried the examples but have encountered a problem.
I create an item that should display the status of 2 garage door contacts, the channels are defined like this
the problem is that i only get one item displayed, and where the second should be, I see de complete HTML code of the page.
The transformation is done like this
(function(i) {
var re = new RegExp('xxxxxxxxxx[\\s\\S]*?Contact Sensor[\\s\\S]*?<h4>([a-zA-Z]+)');
var out = i.match(re)[1];
return out;
})(input)
they are both identical, only the ID in the regex does change
Any ideas concerning this problem ? I also would like to find where the syntax of the channel line is documented, as I do not understand why it starts with a < tag
For testing that the regex works as expected I extracted the source code from sensor web page and then used one of the free regex test sites to test my expression. You may need to remove on the \ from double \ in your expression to work with the rest site.
I now have all Mobile Alert sensors as items in Opemhab and charted via Influx and Grafana. What was missing was some indication when a sensor had stopped working.
I could have used API call for the āProā devices but wanted something that would work for ALL my devices. So, I used web caching (need HTTP binding for this) to extract each sensor time stamp and a rule to check the time since a sensor was last seen. It took quite a bit of work determining the best method to do the task and then more wok in getting the types correct.
Details are below:
Time stamp Item⦠String HeatPumpReturnTemperatureTimestamp "Heat Pump return sensor time stamp [%s]" { http="<[sensorCache:60000:JS(getTimestamp.js)]" }
JS transform with REGEX to extract the time stampā¦
(function(i) {
var re = new RegExp('Sensor_ID_goes_here[\\s\\S]*?Timestamp[\\s\\S]*?<h4>([0-9]+/[0-9]+/[0-9]+ [0-9]+:[0-9]+:[0-9]+ [A|P]M)</h4>');
var out = i.match(re)[1];
return out;
})(input)
Rule to check when a sensor was last seenā¦
import java.text.SimpleDateFormat
rule "Heat pump return temperature time stamp check"
when
Item HeatPumpReturnTemperatureTimestamp received update
then
val String timestamp_str = HeatPumpReturnTemperatureTimestamp.state.toString //from http cache and REGEX transform
val SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a")
val DateTime timestamp = new DateTime(formatter.parse(timestamp_str))
val Number elapsedtime = (now.millis - timestamp.millis)/60000
if (elapsedtime > 30) { // 30mins since last seen
sendNotification('your email address','Heat pump return sensor not seen for ' + elapsedtime + 'minutes')
logInfo("Mobile Alerts" , "Time now = " + now)
logInfo("Mobile Alerts" , "Heat pump return sensor time stamp = " + timestamp)
logWarn("Mobile Alerts" , "Heat pump return sensor not seen for " + elapsedtime + " minutes")
}
end
(function(i) {
var re = new RegExp('02512688AC27[\\s\\S]*?Temperature[\\s\\S]*?<h4>([0-9]+.[0-9]+) C');
var out = i.match(re)[1];
return parseFloat(out);
})(input)
Message at openhab.log:
org.openhab.core.transform.TransformationException: An error occurred while executing script.
at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:67) ~[210:org.openhab.core.compat1x:2.4.0]
at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:194) [246:org.openhab.binding.http:1.13.0]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144) [210:org.openhab.core.compat1x:2.4.0]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166) [210:org.openhab.core.compat1x:2.4.0]
2019-03-12 19:12:52.924 [WARN ] [ab.binding.http.internal.HttpBinding] - Transformation āJS(getTemperatureout.js)ā threw an exception. [response=
did you test the regex on the sensor web page? eg regex101. Goto sensor web page , view source and copy the code. Paste into regex101. The regex expression will need the double backslash changing to one backslash. You can play around with the regex and you should see it match something.
Hello to everyone,
I found the solution for the sensor MA10101:
The item:
string MobileAlerts_Indoor_Water "Wassersensor Küche [%s]" <water> (mobilealerts) {http="<[mobileAlerts:60000:JS(gettrockenin.js)]"}
Javascript:
(function(i) {
var re = new RegExp('SENSOR-ID[\\s\\S]*?Wassersensor[\\s\\S]*?<h4>([a-zA-Z]+)');
var out = i.match(re)[1];
return out;
})(input)
Rule:
rule "Wasser"
when
Item MobileAlerts_Indoor_Water changed from Trocken to Feucht
then
sendTelegram("BOT-Name", "Wasser!")
end
Create a new or edit your existing items file and add the following items:
Number MobileAlerts_AirQuality "Air Quality[%d ppm]" { http="<[mobileAlerts:300000:REGEX(.*?([0-9]+) ppm.*)]" }
String MobileAlerts_Outside_TemperatureString "Outside Temperature [%s]" { http="<[mobileAlerts:300000:REGEX(.*?Temperature Outdoor.*?\\s.*?(-*[0-9]+,[0-9]+) C.*)]" }
Number MobileAlerts_Outside_Temperature "Outside Temperature [%.1f °C]"
String MobileAlerts_Indoor_TemperatureString "Indoor Temperature [%s]" { http="<[mobileAlerts:300000:REGEX(.*?Temperature Indoor.*?\\s.*?(-*[0-9]+,[0-9]+) C.*)]" }
Number MobileAlerts_Indoor_Temperature "Indoor Temperature [%.1f °C]"
Number MobileAlerts_Indoor_Humidity "Indoor Humidity [%d %%]" <humidity> (Raumklima, Wohnzimmer) {http="<[mobileAlerts:300000:REGEX(.*?Humidity Indoor.*?\\s.*?([0-9]+)%.*)]"}
I DONT NO WHAT I NEED TO CHANGE by this file.
Step Three:
To convert the ā,ā to ā.ā in the temperature readings and save the values as numbers define two rules as follows:
I DONT NO IN WHICH FILE I NEED TO COPY this text
I hope someone can help me.
also how I can build a lot of sensors. Badroom, kitchen,ā¦