Gladys Assistant 4.23 : Live camera streaming & Calculations in scenes

Hello everyone,

New Gladys release — and it’s a big one!!

The main feature is live camera streaming on the dashboard, but that’s not all :wink:

Check out all the new features in this YouTube video:

Or read the recap on the blog:

Don’t hesitate if you have any questions/feedback.

5 Likes

Hi @PhilippeMA, I just saw that you tried to stream a camera via Gladys Plus about an hour ago, and you got an error because the stream was too large!

For info, there is currently a limit of 10 MB per video chunk.

Out of curiosity, what kind of camera do you have and what settings did you use locally? What resolution is your stream in?

Another great update, even though my favorite thing is the confetti :smiley:

2 Likes

Is it possible to access the live stream of a webcam connected to the Pi running Gladys? (/dev/video0)
On my setup, it doesn’t work but I don’t know if there’s something to enable…

Hello @pierre-gilles, the cameras are TP-Link Tapo C210 and C310 running at 1080p; I can’t find the number of fps but it’s at least 15 fps.

Indeed, I get an error message on every launch. By pressing the stream button a second or even third time, it eventually displays.

I have two Tapo devices and I didn’t have any issues with the live stream.

Maybe it’s a matter of installing an RTSP server?

Hello,

I don’t know if this topic has been addressed/discussed.
But following the last update, I realized that my scenes no longer worked. Having had other things to do, I only just checked a bit and it turned out the issue was with Zigbee2MQTT.

The interface ****:8080 was no longer reachable. The logs indicated that it was looping. To resolve the problem, you absolutely must select the dongle type in the configuration (new parameter to facilitate future setups).
Is it normal that it didn’t automatically pick up this parameter for people who already had it configured and working? Or am I the only one who had this problem?

Have a nice evening and a good first day back tomorrow! :slight_smile:

On a Sonoff -P, no problem :slight_smile:

It’s my favorite too :grin:

Normally yes, are you sure that this USB port is visible from inside Gladys?

Ok, interesting that it’s « only » 1080p, because for the record you’re the only one having these errors. Are you on « low » latency?

In fact the size of each chunk depends on what the stream displays. If the stream doesn’t change much, the video size can shrink and be accepted by Gladys Plus; it’s a bit of luck in your case.

I’ll see what I can do to limit the stream size.

That’s a regression! Not normal. What dongle do you have? Did you have to do any specific configuration?

I set it up as in the docs :


But…

That said, I only have one stream out of the six cameras that works, but I put that down to the poor performance of the other host RPis (it works with the RPi 2 but not the RPi Zero or the Orange Pi Zero)

No problem for me either, Tube’s USB key on RPI3 64 disk SSD. Par contre j’ai constaté que dans les scènes avec « Continue only if » si la valeur est définie sur zéro, celui-ci a disparu, sur certaines scènes cela n’a pas d’incidence sur d’autre elle ne fonctionnait plus.

Are you talking about existing scenes? Can you describe how to reproduce the bug?

Re-reading the frontend code, indeed I have the impression there are places where implicit conversions create bugs! It’s my fault, I didn’t pay enough attention during the review of this feature.

cc @bertrandda be careful with implicit conversions, I hadn’t paid attention in the frontend but for example at this line:

At this line too:

At this line too:

If the value is 0, the condition is therefore false and the UI doesn’t perform the expected behavior!

Ok, I admit I’ve never tested this possibility in real life. Do you have some experience with ffmpeg?

You should basically test directly on your Pi to fetch the video stream and save it as an mp4 file, to see if it works or if it’s not supported…

Example tutorial to do that:

We use ffmpeg on the Gladys side so that’ll give an idea of if it works or not at all :slight_smile:

That’s for sure it will never work; live video streaming requires a somewhat beefy CPU to decode/encode/compress/encrypt the video stream. If the CPU is underpowered, it can’t keep up ^^ I also think it’s a question of the « video function » available in the CPU

Yes, I confirm that all the cameras are set to ‹ low › latency.

@PhilippeMA I just deployed performance improvements on Gladys Plus that allowed me to increase the size limit per chunk (while waiting to see how to reduce these chunks)

Can you re-test and tell me if it works this time? :slight_smile:

Thanks @pierre-gilles. I just tested and the result is the same (I changed browsers to Chrome + Firefox, it’s the same).

Is there anything I can do to help you diagnose?

Yes, on an existing scene — notably one with a Sonoff push-button to turn the light on or off. Two identical scenes with « Continue only if » = 0 and the other « Continue only if » = 1.
In the scene with the 0, the zero had disappeared.
I could turn it on but not turn it off.
So I took the opportunity to migrate to the new light

Several questions:

  • Does it work locally? (not via Gladys Plus)
  • What hardware are you using to run Gladys? If you run « htop » in the command line while you start a live, what do you see? (CPU/RAM, is everything okay?)
  • Is your network good? (Fiber/ADSL?), what is the ping and what speed?
  • If you open the inspector (right-click on the page → inspect element), « Network » tab, then « Fetch/XHR ». You clear the view then start a camera live, what do you see?

What do you mean by « had disappeared »?

I also have a scene that tests a value at 0 and the zero disappears after saving the scene.
I noticed this because my scene to close a shutter stopped working after the update!

So here’s what I do in my scene

I test that the shutter position is greater than 0. If yes then I close the shutter.

When I save the scene there is no error. I then go back and if I open the scene again the 0 has disappeared.


And so the scene doesn’t work