Scenes: retrieve a state type from all devices (e.g.: battery type)

Very illustrative example:

  • I have 20 battery-powered devices
  • I want to check if one of my devices has less than 25% battery

Currently, I have to create a scene with x20 « Retrieve the last state » boxes, followed by x20 tests on these states (I was too lazy, there are only 9):


Description

What I propose as a new feature is the ability to retrieve all values of a certain type.
So here, all the battery levels of all the sensors and check if one of them is below 25%. In this specific case, a message can be sent to me with the name and room of the sensor.

One can imagine a multitude of applications: all temperature values, battery levels, brightness, power consumption of outlets, etc.

1 Like

Mmmm not stupid, I agree on the problem then I’m not sure if the solution is to do this in the scenes :slight_smile:

For the battery story, I think it would be something we might want « natively » in Gladys. Like Gladys warning you, without your intervention, that some of your devices have less than 25% battery :slight_smile:

Same for devices that are turned off, receiving an alert in « sensor XX has not sent data for 24 hours » mode

That’s exactly what I was saying to @cicoub13 last night, in my opinion as a native user, we should:

  • manage battery levels
  • manage turned off or inactive equipment
  • manage reception levels (poor Bluetooth or Zigbee links for example)
  • manage presence (via Bluetooth) without creating a scene, since a device is already linked to a user

I agree with that :slight_smile:

I’m less in agreement with that.

First, a device is not linked to a user (maybe we’re not talking about the same thing?), and moreover, I think presence management is a specific case for each individual and is difficult to generalize.

For example, you might want to manage presence through multiple factors: Wi-Fi presence + Bluetooth presence + OwnTracks (GPS smartphone) + who knows what!

And doing it via scenes allows you to be infinitely flexible, and above all, it’s more understandable/transparent for the user; it’s not something magical.

I understand your point of view, and perhaps it is not the right solution after all.
However, I find that it is still not intuitive when using the presence detection service via Bluetooth.

At a minimum, it would be necessary to explain that you need to create the scene, or even provide an example of a scene?
This way, the basic need is covered (detecting my presence with Bluetooth), but the scene can be modified for advanced users or needs.

@lmilcent Ah, maybe some things are missing in the doc?

Or just a link to the doc in Gladys otherwise :slight_smile:

It would be at least the link to the documentation, yes :slightly_smiling_face:

1 Like

I am in favor of it being native to Gladys and that a message indicates it in the chat with the name and battery level.

Thanks for your support :folded_hands:
The more of us who vote, the more important this feature request will be and the more likely it is to be developed by @pierre-gilles or one of the community developers!

Oh, but this feature is not the same as the one described in the title.

Is there a feature request for the low battery alert/ lost device?

I just realized that I made the same scene @lmilcent.
I just integrated 6 sensors and this can be really tedious if there are many more sensors/actuators.
Has anyone started developing this feature?

To my knowledge :slight_smile:

Too bad :smiling_face_with_tear:, this could be useful when you have many sensors that run on batteries!
I’ll look for another solution in the meantime.

Hello everyone,

I worked a bit on this topic :slight_smile:
Here is the result :

Does this match your expectations @_Will_71, @lmilcent, @ArMour85 and @pierre-gilles ?

The PR draft :

6 Likes

@Lokkye That’s really nice and it’s exactly what’s needed :slight_smile:

Maybe there should be an option to disable this setting (if you’re on vacation and it spams you every day :stuck_out_tongue: )

As for the frequency, we’ll see what to set.

Could be once or twice a week?

Thanks @Lokkye yes that works for me.

1 Like

Great!
@pierre-gilles is right, we need to see whether to notify once or regularly.

To avoid spamming, I’d propose:

  • A configurable info threshold (30%)
  • A configurable alert threshold (10%)
  • A final alert when the sensor is no longer accessible, or reaches 0%

That way we have 3x alerts per product, no more and especially not every day!

1 Like

And a button for the 10 !! :slight_smile:


I took the liberty of putting it in a separate « box ».
What do you think?
What would you say about putting the settings in separate « boxes » to distribute them across the 2 columns?

For now, I set it to every hour; I can change it to 1 or 2 times per week or even make it configurable (I don’t know if that’s possible)

That’s a good idea, but I don’t know if that’s possible. For the moment, I went with a system that « checks » the battery level every day. But if I take your idea, I’d need to notify when the device changes level and therefore « listen » to each change in battery level to check whether it has dropped below 30% for example. I’m not sure if I’m being clear :slight_smile:

Can you just check without adding a listener and verify at intervals?

Actually, whether your device is at 26 or 30 doesn’t matter, but when your cron runs you notify those between 30 and 20, between 20 and 10, and <10.

That avoids having a listener on every battery event ^^

Excellent!

That works very well for me, we’ll see how it looks in practice but in principle I agree!

I think we can keep it simple for now: once a week at a fixed date/time, like Saturday at 9am for example? (that allows for a notification at the start of the weekend when the user is potentially available to take care of it?)

We should just specify that in the feature description so it’s clear :slight_smile:

I prefer your approach @Lokkye!

I like the idea of doing it at a fixed interval, so if we have 5 sensors that start to weaken, we don’t get 5 random notifications during the week but a batch of notifications on a day that makes sense, so the user can tell themselves « Ah, there are 5 devices that are almost dead, I’ll place an order for 5 batteries »

1 Like