@jkandasa ok, thanks. Do you have any examples of any scripts to show what sort of thing can be done? And also any pointers as to what to do in My Controller to get them running?
Latest posts made by MTBHuw
-
RE: Converting Distance to Volume with MyController (water tank)
-
RE: Converting Distance to Volume with MyController (water tank)
@jkandasa Will I need to add the relevant code to make this work with a nrf2401l module and serial gateway etc? Sketch looks ideal, thanks.
-
RE: Converting Distance to Volume with MyController (water tank)
Thanks for the sketch. I was just wondering if it was possible to do the "conversions" in My Controller though, so that the sketch can be left as simple as possible.
-
Converting Distance to Volume with MyController (water tank)
Hi, I have set up a distance sensor to measure water level in a tank which seems to be working fine. I have kept the sketch on the sensor very simple, it just sends me the distance to the water level from the top of the tank.
Am I able to use My Controller to display/calculate the volume of water in the tank, using the tank dimensions and converting distance to water level, to depth of water?
It's easy enough to do by hand, but is it possible to display a graph for example in My Controller, rather than the "raw" distance from the sensor?
Thanks
-
RE: Adding NRF24l01 code to existing sketches
That's great thanks, I will read through that to try and make sense of it.
I have 2 projects at the moment. One is a water level/rain gauge sensor project. I've seen the My Sensors rain gauge sketch but it seems too complex for my needs although I could use it.
The other is a home "smart meter" for our electricity usage using a non invasive current sensor.
-
Adding NRF24l01 code to existing sketches
This isn't entirely MyController related, but as a complete beginner with coding, how can I go about adding the code for an NRF24l01 to a sketch for a sensor that doesn't have it? That is, enabling a sensor to communicate with my gateway.
I've read the MySensors info on setting the NRF up etc and have sensors running successfully already but I've always used sketches with the code already built in. I need to know how to add it, the "where" and "what" etc. if a sketch for a sensor doesn't have it. Thanks.
-
RE: Retrieving values table from sensor graphs
Thanks, I tried running the script:
var myImports = new JavaImporter(java.io, java.lang, java.util, java.text); with(myImports) { var sVar = mcApi.uidTag().getByUid("temp-outside").getResource(); // Get sensor variable object with UidTag api var minMaxData = mcApi.metric().getSensorVariableMetricDouble(sVar, 0,1479833863195); //(sensor-variable-object, from-timestamp, to-timestamp) }
changing "temp-outside" to my own uidTag for my sensor. It worked but seemed to return a lot more information than needed, although I see that the value (distance) is there, but among a lot of unwanted data. Is there a way of extracting just time/distance from this? Here's a sample of what was returned....
{ "sVar": { "id": 7, "sensor": { "id": 8, "sensorId": "1", "type": "S_DISTANCE", "name": "", "lastSeen": 1509978854438, "node": { "id": 10, "eui": "1", "gatewayTable": { "id": 1, "enabled": true, "name": "Serial Gateway", "networkType": "MY_SENSORS", "state": "UP", "statusMessage": "Connected Successfully", "statusSince": 1509967019993, "type": "SERIAL", "properties": { "br": 115200, "rdr": "jSerialComm", "rf": 30, "txDelay": 0, "dr": "Auto", "pn": "/dev/ttyACM0" } }, "name": "Distance Sensor", "version": "1.0", "type": "S_ARDUINO_NODE", "libVersion": "2.1.1", "state": "UP", "lastSeen": 1509978855129, "properties": { "hbTx": 1509978436346 }, "registrationState": "REGISTERED", "smartSleepEnabled": false }, "variableTypes": [ "Distance" ], "idforVariables": 8 }, "variableType": "V_DISTANCE", "metricType": "DOUBLE", "timestamp": 1509978853779, "value": "151", "previousValue": "150", "unitType": "U_DISTANCE", "readOnly": false, "offset": 0, "priority": 100, "properties": { "marginRight": 20, "color": "#ff7f0e", "interpolate": "linear", "subType": "line", "marginBottom": 60, "useGlobal": true, "type": "lineChart", "marginTop": 5, "marginLeft": 65 }, "metricsGraph": { "id": 5, "metricName": "Distance", "type": "lineChart", "interpolate": "linear", "subType": "line", "color": "#ff7f0e" } }, "myImports": {}, "minMaxData": { "variable": { "id": 7, "sensor": { "id": 8, "sensorId": "1", "type": "S_DISTANCE", "name": "", "lastSeen": 1509978854438, "node": { "id": 10, "eui": "1", "gatewayTable": { "id": 1, "enabled": true, "name": "Serial Gateway", "networkType": "MY_SENSORS", "state": "UP", "statusMessage": "Connected Successfully", "statusSince": 1509967019993, "type": "SERIAL", "properties": { "br": 115200, "rdr": "jSerialComm", "rf": 30, "txDelay": 0, "dr": "Auto", "pn": "/dev/ttyACM0" } }, "name": "Distance Sensor", "version": "1.0", "type": "S_ARDUINO_NODE", "libVersion": "2.1.1", "state": "UP", "lastSeen": 1509978855129, "properties": { "hbTx": 1509978436346 }, "registrationState": "REGISTERED", "smartSleepEnabled": false }, "variableTypes": [ "Distance" ], "idforVariables": 8 }, "variableType": "V_DISTANCE", "metricType": "DOUBLE", "timestamp": 1509978853779, "value": "151", "previousValue": "150", "unitType": "U_DISTANCE", "readOnly": false, "offset": 0, "priority": 100, "properties": { "marginRight": 20, "color": "#ff7f0e", "interpolate": "linear", "subType": "line", "marginBottom": 60, "useGlobal": true, "type": "lineChart", "marginTop": 5, "marginLeft": 65 }, "metricsGraph": { "id": 5, "metricName": "Distance", "type": "lineChart", "interpolate": "linear", "subType": "line", "color": "#ff7f0e" } } } }
-
RE: Email notification setup
Hi, yes that's how I have it set up in My Controller. I've also set gmail to allow "less secure apps". I was getting the "400: Bad Request" message but as I type this and retrying the Test Connection, it seems to be working now. I'll try it out....
Thanks.
-
Retrieving values table from sensor graphs
Another post from me I'm afraid. Is there a way to extract a table of readings from the sensor graphs, whether as a text file, csv etc.?
-
Email notification setup
Hi, I'm trying to get an email notification set up for one of my sensors. I'm experimenting (on my desk at the moment!) with a HC-SR04 sensor so that I can measure water level in a tank. The sensor is working fine, and sending consistent readings to My Controller via my Serial Gateway.
I would like it to send me an email when the water level reaches a threshold of "x"cm. I've set this up in Rules with Condition Type "threshold", trigger when value from sensor is >=50cm. Then under Operations, I've asked it to email me this.
I assume I need to set up the email account, SMTP etc under Settings, which I've tried, but I keep getting a "400: Bad Request" when I test the connection. I'm trying to use my gmail account with the following settings:
smtp.gmail.com
Port : 465
From address : my gmail
SSL Enabled
Use SSL chosen
My username and password.Any help appreciated again.