Gladys 4 Beta is available! 🚀

Ok, I think I understand what’s wrong

@bertrandda used global « sinon Â» in his tests, and @AlexTrovato’s PR resets the global sinon in other tests.

When we run the Caldav tests individually, it works perfectly. When we run all the tests, sinon is reset by upstream tests and it breaks at the caldav level.

I’ll try to fix it..

:heart_eyes:

I’ve spent the morning on this and so far I can’t get your PR to work @AlexTrovato :confused:

  1. The mosquitto container starts fine, but Gladys doesn’t fill the mosquitto.passwd file
  2. When editing the password in the UI, sometimes Gladys manages to fill the file

I think it’s a race condition, the mosquitto container is never « ready Â» when Gladys tries to edit the mosquitto.passwd file. I think this is because the Docker restart API doesn’t return « ok Â» when the container is actually restarted, but just when the command has been sent to Docker. We need to find a way to ensure the container is ready

Anyway, the PR is great, I think after fixing this small bug it should work wonderfully! Well done :clap:

Well, I found the first source of the bug, the system.exec function has a small operational bug:

The second parameter of this function is not « data Â» according to the docs, but a stream

So we need to wait for this stream to finish to confirm that the code has actually executed. The current resolve(true) happens too early, before the code has executed.

We need to do:

executable.start((err, stream) => {
      if (err) {
        reject(err);
      } else {
        stream.on('end', () => {
          resolve(true);
        });
        this.dockerode.modem.demuxStream(stream, process.stdout, process.stderr);
      }
    });

In order to really confirm that the code has executed.

This resolves the race condition, but I still have bugs. I’ll continue investigating :slight_smile:

Edit: This fix isn’t magic either, as pointed out in this GitHub issue:

https://github.com/apocas/dockerode/issues/534

It was a big chunk, but it’s merged finally!

Thanks @AlexTrovato and @VonOx for the work :folded_hands:

There was some great work in this PR :slight_smile:

All the credit goes to @AlexTrovato :clap:

And this new MQTT integration with built-in broker is live in Gladys Assistant v4.0.0-beta-9 :)!

Your instances will update automatically!

Thanks to you for taking the time to fix that. Great job.

New feature of the day, coming in the next release, the ability to finely select the devices displayed on the dashboard!

:warning:Warning, we are still in beta, and this feature is breaking. Those who have instances running currently will need to make a quick visit to their dashboard to display the features they want to display :slight_smile:

New feature, MQTT integration becomes easier to use with a clearer feature selector that allows searching :slight_smile:

https://github.com/GladysAssistant/Gladys/pull/849

Gladys v4.0.0-beta-10 is available, and includes all the new features developed this week! :slight_smile:

Your instances will be updated in the next few hours.

Don’t hesitate if you have any questions :slight_smile:

Thanks to you and the team for the work done


Personally, I will wait for the Bluetooth to set up Gladys in the house, well I know it’s not for now but it’s okay.

Hello!
Sorry if the question is a bit heavy

Do these updates include the production deployment of the Zigbee2mqtt integration?
Initially, it was Reno who was on it, but I understood that @AlexTrovato also got involved
 so I’m checking for updates :smiley:

It’s really broken :sweat_smile:

Unable to edit the dashboard

@VonOx damn, do you have something in your browser logs?

I need to check this on PC as I’m having this issue on mobile (Gladys Plus and local as well)

Edit: Here’s what the console returns

Uncaught (in promise) TypeError: t.box.device_features is undefined
    at DevicesInRoomsBox.jsx:58
    at DevicesInRoomsBox.jsx:57
    at DevicesInRoomsBox.jsx:56
    at Preact 11
        S
        y
        __k
        p
        h
        y
        __k
        p
        h
        y
        d
DevicesInRoomsBox.jsx:58:18

Edit 2: I had to quickly click the EDIT button before the page loaded (before the error, I think)

I was able to edit the boxes, but there’s an issue with the Hue devices list. For each device, the features of other devices are listed, and each line is duplicated (or tripled) and highlighted.

EDIT 3: The demo site is also broken.

Well spotted!
I sent an express fix this morning for the important bug, for the story of the duplicated Philips Hue I won’t be able to look into it now (client mission). Could you post the JSON result of the GET /api/v1/room/TA_PIECE?expand=devices

? :slight_smile: Thanks!

Yep

{
   "id":"939c2efd-d09f-4f17-b7b2-01b1ab70073e",
   "house_id":"12cfd62e-2a2c-4856-a5e5-47581e0b6cac",
   "name":"Salon",
   "selector":"salon",
   "created_at":"2020-01-10T14:38:50.439Z",
   "updated_at":"2020-01-10T14:38:50.439Z",
   "devices":[
      {
         "name":"Canapé",
         "selector":"philips-hue-light-001788286ece-2",
         "features":[
            {
               "name":"Canapé On/Off",
               "selector":"philips-hue-light-001788286ece-2-binary",
               "category":"light",
               "type":"binary",
               "read_only":false,
               "unit":null,
               "min":0,
               "max":1,
               "last_value":0,
               "last_value_changed":"2020-08-11T21:36:54.179Z"
            },
            {
               "name":"Canapé Color",
               "selector":"philips-hue-light-001788286ece-2-color",
               "category":"light",
               "type":"color",
               "read_only":false,
               "unit":null,
               "min":0,
               "max":0,
               "last_value":null,
               "last_value_changed":null
            },
            {
               "name":"Canapé Brightness",
               "selector":"philips-hue-light-001788286ece-2-brightness",
               "category":"light",
               "type":"brightness",
               "read_only":false,
               "unit":null,
               "min":0,
               "max":100,
               "last_value":null,
               "last_value_changed":null
            },
            {
               "name":"Canapé Temperature",
               "selector":"philips-hue-light-001788286ece-2-temperature",
               "category":"light",
               "type":"temperature",
               "read_only":false,
               "unit":null,
               "min":153,
               "max":500,
               "last_value":null,
               "last_value_changed":null
            }
         ]
      },
      {
         "name":"Plafonnier",
         "selector":"philips-hue-light-001788286ece-4",
         "features":[
            {
               "name":"Plafonnier On/Off",
               "selector":"philips-hue-light-001788286ece-4-binary",
               "category":"light",
               "type":"binary",
               "read_only":false,
               "unit":null,
               "min":0,
               "max":1,
               "last_value":0,
               "last_value_changed":"2020-08-08T21:29:12.695Z"
            },
            {
               "name":"Plafonnier Color",
               "selector":"philips-hue-light-001788286ece-4-color",
               "category":"light",
               "type":"color",
               "read_only":false,
               "unit":null,
               "min":0,
               "max":0,
               "last_value":null,
               "last_value_changed":null
            },
            {
               "name":"Plafonnier Brightness",
               "selector":"philips-hue-light-001788286ece-4-brightness",
               "category":"light",
               "type":"brightness",
               "read_only":false,
               "unit":null,
               "min":0,
               "max":100,
               "last_value":null,
               "last_value_changed":null
            },
            {
               "name":"Plafonnier Temperature",
               "selector":"philips-hue-light-001788286ece-4-temperature",
               "category":"light",
               "type":"temperature",
               "read_only":false,
               "unit":null,
               "min":153,
               "max":500,
               "last_value":null,
               "last_value_changed":null
            }
         ]
      },
      {
         "name":"LivingColors",
         "selector":"philips-hue-light-001788286ece-1",
         "features":[
            {
               "name":"LivingColors On/Off",
               "selector":"philips-hue-light-001788286ece-1-binary",
               "category":"light",
               "type":"binary",
               "read_only":false,
               "unit":null,
               "min":0,
               "max":1,
               "last_value":0,
               "last_value_changed":"2020-08-10T01:17:09.304Z"
            },
            {
               "name":"LivingColors Color",
               "selector":"philips-hue-light-001788286ece-1-color",
               "category":"light",
               "type":"color",
               "read_only":false,
               "unit":null,
               "min":0,
               "max":0,
               "last_value":null,
               "last_value_changed":null
            },
            {
               "name":"LivingColors Brightness",
               "selector":"philips-hue-light-001788286ece-1-brightness",
               "category":"light",
               "type":"brightness",
               "read_only":false,
               "unit":null,
               "min":0,
               "max":100,
               "last_value":null,
               "last_value_changed":null
            }
         ]
      }
   ]
}

I’m bouncing a bit on this old message, zigbee2mqtt should, in my opinion, be part of the RC because let’s be honest, the number of integrations is quite poor and/or incomplete. (no criticism, we all do our best :wink: )

To complete the milestone (sorry @pierre-gilles I really didn’t have the time before)

ZWAVE

It must be perfect, normally the PR of @link39 resolves many issues at the compatibility level (switch for raising/lowering the shutters for example)

ZIGBEE2MQTT

PS: All this concerns my personal need and therefore the « missing Â» features to go to « prod Â» at home. There is a frustrating side of being able to lower the shutter but not raise it etc
 which can discourage new users.

What does « the RC Â» mean to you? :slight_smile:

I get the impression that for many people, I will release the RC and then that’s it, Gladys will be « finished Â» and there will be no more evolution.

It’s the complete opposite! Software development is iterative and never-ending: I release a new version of Gladys almost every week as features are added. The software improves continuously, and it will never stop.

The RC is mainly a name change, we remove the « beta Â» from the tag and build versions on the v4 tag, that’s more or less it
 It’s a signal to tell developers « that’s it, Gladys’ API, the documentation, the build system, the tests, everything is in place, stable, it doesn’t change anymore, you can develop integrations without everything changing every other morning Â» :slight_smile:

I agree, Zigbee2mqtt is a great integration and I would love for this service to be available today. After all, I’m also realistic, the service has been in development for 10 months and unfortunately the developers of this integration have been less available in recent months, which I completely respect, it’s the ups and downs of open-source, everyone has their own availability :slight_smile:

Not mastering this part, it is difficult for me to include it in my planning
 I know my availability and I can estimate my development times on Gladys, but for the rest I am a « spectator Â» of the developments.

It seems strange to me to block the entire project’s progress for an integration, don’t you think?

It’s included in the milestone :slight_smile: Z-Wave, I master it so I included it. On the other hand, I think that @link39 is on vacation at the moment, and I don’t have much information about this PR whose tests are not passing. I asked the question on the PR 15 days ago but no answers yet. @link39 if you see this message, I’m interested in any information that would allow me to take over the PR and merge it! :smiley:

I understand, for me the RC must be « perfect Â» on the existing features. So if you think of specific bugs, don’t hesitate, I will fix them before the RC.

Of course, and I completely understand! Believe me, I’ve been working on v4 for a year and a half, and I would love to have the level of integration we had in v3
 But v3, we developed it in 5 years (2014-2019), it’s complicated to recreate such a rich ecosystem in such a short time.

I’m putting this schema from my article 2019 review:

The first services started to be written in September 2019, so the community has only had access to v4 for developing services for about 11 months. Many people in the community have never worked with React, there is a small learning curve.

That’s my vision, after all I might be wrong and everything is up for discussion :smile: Don’t hesitate to contradict me if you disagree.