Battery levels BUT


#1

1) Give a description of the problem
I found some great pistons that give warning if battery levels are below X or between X and Y
those are great but I am struggling with something else (very new webcore user by the way)
I want to get a LIST of the devices WITH the battery levels.
ie:
IF battery Control switch is turned ON
Send email/sms

and the email is something like this:
Main Door Motion Sensor : 76
Garage Door Open Close Sensor : 85

2) What is the expected behavior?
I want to see each devices battery levels.

Any ideas?

Thank you so much for your time.
Ike


#2

Try this

That will populate the variable ‘battery report’ with the info you are looking for. From there add the if switch on send email/sms Stuff after it. Also you might want to change to every minute to every day at a certain time. That’s up to you how often you want to refresh the battery repory


#3

Hi Gopack2
Yessss
Thank you so much for the piston…
Worked great…

I have about 40-50 battery operated sensors, (I just tested the piston with 4)
is there a variable limit to device count? Should I split them into two groups or even if there is a limit 50 is not it :))))

Once again thank you so much.
Ike


#4

That is very cool! If you had included the notification part this amateur webcore guy could use it. :slight_smile:


#5

Good point…

There you go…


#6

Thank you so much! :slight_smile:


#7

That IF could be anything you want…
A simple Simulated switch, a light bulb, motion sensor or even automated by date.

I just prefered getting the report by pushing a button.


#8

Thanks again! That answered my latest question.


#9

And it actually works! Great teaching tool. Is there a way that the report could be made more reader friendly? As in one device per line?


#10

Himmmm
Maybe it’s not one device per line due to SMS messaging system???
I tried emailing it and also comes in the same back to back format.

I am sure it’s as easy as "Hey add “this symbol” at the end of the line:)))))
But I am also a newby here:)))
Lets wait for one of the advanced users to jump in and help us…

One device per line sounds really good.


#11

#12

Thanks, however after reading the posts I’m still not sure how to do it… :frowning:


#13

I’ve also tried different things after reading that post but still no luck…
Lets research LINE BREAK…I believe that is the key…


#14

A new line is:
\n
such as:

temp

I do not have a piston I can test it on, but maybe try after the comma, and before the final quote, such as:

(It is normally found inside plain text quotes…)


#15

EDIT :
There should be no limit on how many devices you add to the list

Thank you @ady624


#16

I think I have figured out how to get a new line in SMS messages…

Here is my received text:
temp

and the code to get this result:

For some reason, \n wasn’t working in SMS, so I just forced in a new line in the expression box.
(it’s only visible while editing that line)

(I had to move the SMS command outside the "for each" block to prevent multiple texts being sent… I also moved the battery numbers to the front of each line so I can scan the SMS list a bit quicker)


Newline in string varaible
Reporting the lowest battery level
Creating a list via Text String. Need Carriage Return/Line Feed/Enter
#17

There should be no limit on how many devices you add to the list. However, you may find the SMS to limit you on the number of characters. You can always look for only devices below a certain threshold - and also can set the piston up so that it updates its own state with a nice formatted list of the devices. There’s a task called Set Piston State - then set the piston state to manual in the piston’s settings. You can get something like this:

Ignore the negative signs (shame)

This is that piston, if you want to go this route.


#18

Why was I thinking there was a 16 device limit? I could have sworn I have seen that talked about time and time again…


#19

It may be that SMSs expect \r\n, not just \n. Or maybe \r. But new lines in the expression editor work too :slight_smile:


#20

Nah, I got a fuel stream piston that has more than 16 devices, I counted 34: