In my nice little flat I do have 20+ sensor to measure weather, temperature and plant health. Almost all of these runs of battery which unfortunately runs out once in a while.
So my idea is to add all these sensor to the group Group_Battery_Level
. So by using tips from @rlkoshak my idea is to have a rule that get triggered everytime the group receives an update, then if the battery level is below 20% then send out a warning, if below 10% starts to manipulate lights to draw attention.
-
So the first problem is that some sensor uses 0-100 others 0-5, others 0-10 as battery level, can I map number item somehow to 0-100 range?
-
Then I only want notifications once a day when I am home and time of day is after afternoon and before night. If I get an email and I am not home, I most likely will forget it…
-
When the notification is sent out I would like to also know which(might be several) sensors it was.
-
Also I would like to get notification if the state of the sensor has not been updated in the last 24hours, since this then indicates dead battery, IP adress changed,Coverage changed, API key expired etc…
Is such a generic notification scheme possible to make?
My not so well functional rule (for moisture…)
val Boolean emailSent = true
rule "Water plants"
when
Item Group_Moisture_LivingRoom changed
then
if (Group_Moisture_LivingRoom.state <10 && emailSent){
sendMail("xxxxx@gmail.com","Plant","Water plants in living room")
emailSent=false
}
else {
emailSent=true
}
end
and then the group item:
// Moisture
Group:Number:MIN Group_Moisture_LivingRoom "Minimum Moisture [%.1f ]" <temperature>
Then I simply keep adding my devices to that group…
Number Miflora_Sensor1_Moisture "Sensor1 Soil Moisture [%d %%]" <text> (gMiflora, Group_Moisture,Group_Moisture_LivingRoom) {mqtt="<[mosquitto:miflora/sensor1:state:JSONPATH($.moisture)]"}