I have two mysensors sensors which used to work pretty well. After one of last updates (0.44) door sensor changed behavior. It stopped showing battery level and all details that were previously available. How can get all mysensors information available again?
Also you can check my code for sending battery level that was working for 4 months:
void sendBat()
{
// get the battery Voltage
int sensorValue = analogRead(BATTERY_SENSE_PIN);
#ifdef MY_DEBUG
Serial.println(sensorValue);
#endif
// 1M, 470K divider across battery and using internal ADC ref of 1.1V
// Sense point is bypassed with 0.1 uF cap to reduce noise at that point
// ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts
// 3.44/1023 = Volts per bit = 0.003363075
int batteryPcnt = sensorValue / 10;
#ifdef MY_DEBUG
float batteryV = sensorValue * 0.003363075;
Serial.print("Battery Voltage: ");
Serial.print(batteryV);
Serial.println(" V");
Serial.print("Battery percent: ");
Serial.print(batteryPcnt);
Serial.println(" %");
#endif
if (oldBatteryPcnt != batteryPcnt ) {
sendBatteryLevel(batteryPcnt);
oldBatteryPcnt = batteryPcnt;
}
}
As I tried to explain in my post above, the missing attributes, including battery level, was just a frontend issue for binary sensors and has been fixed in the dev branch. The fix will be included in the next release.
I was asking @anilet about what the problem was about reporting battery.