Do sensors report battery level?
-
Hi, haven't seen this info anywhere yet..... Can sensors report their battery level back to the Vera like other z-wave sensors do?
-
Yes, it is possible. You'll find the API here:
http://www.mysensors.org/build/sensor_api#the-full-apivoid sendBatteryLevel(int batteryLevel);
If you want a battery-powered sensor to report its battery level use this method. The value is a percentage (0-100).
Here is info on how to measure battery level:
http://www.mysensors.org/build/battery#measuring-and-reporting-battery-level
-
Testing v1.4 beta.
I'm already getting a very precise Tension value for Lipo batteries where stopping draining it at 3.2V (at max) could be crucial.
The problem is, tension wise and under load:
3.5V = 3.125 %
3.4V = 1.25%
3.3V = 0.2%
3.2V = 0%I'm already interpolating for any value of tension (for middle values).
As we can see, it drops and drops fast at the very ending, but for a low discharge scenario as we get with 328p, 1% for a 2000mAh still means many many days of use (maybe months).
As tension calculation occurs before percentage on the node i could and should cut off at the node side based on tension.
But for controller this means many days of use at 0% starting near below 3.38V because actually a percentage like 0.98% is truncated and sent like 0% because we are sending an uint8_t value.
I'm trying to change that in MySensor::sendBatteryLevel changing 8bit integer to something like double/float, but i get compile errors.
Is double/float supported for internal messages?
-
For normal messages float/double will be converted to strings as found no c-standard standard way of sending then serialized OTA. If you want decimals I would suggest sending them *10 or *100 and divide result on receiving side. Floats in the AVR platform is very memory consuming anyway so try to avoid it.
-
@hek Thank you very much Henrik! I will try it!
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
[mysensors] Not a valid message: invalid literal for int() with base 10: '\x00\x000'
Development • 18 Sept 2024, 20:34 • kiesel 20 Sept 2024, 08:28 -
MQTT GW on ESP8266 supporting SSL/TLS?
Development • 4 Jun 2024, 10:21 • bgunnarb 27 Jun 2024, 13:53 -
Saving last known good state, but not in EEPROM
Development • 30 Jan 2024, 18:46 • OldSurferDude 15 Jan 2025, 08:51 -
Radio waking up for no reason.
Development • 4 Jul 2020, 21:09 • Sasquatch 15 Jan 2025, 08:33 -
Sending offset to node
Development • 24 days ago • bsl88k 19 days ago