Ecowatt Integration: Smart scenarios in Gladys during power grid stress!

A nice addition to the integration would be to have the day of the week before the date.

Thanks everyone for your positive feedback on the Ecowatt integration, it’s nice to read :smile:

That’s a good idea indeed! I saw the feature request:

For info, in parallel I’ve already been working for a while on an integration with Enedis to see your electricity consumption in Gladys (in kWh and in euros).

I’m a bit behind because Enedis released a major new version of their API and deprecated the API I had just integrated ( :sweat_smile: ), and there are a few bugs in the sandbox of this API for now, which delays my development.

But it’s moving forward, I’m in regular discussion with the Enedis technical team :slight_smile:

To follow the Enedis topic:

After all, this integration is just the « result Â» of your consumption afterwards, I agree with you, having the « red/white/blue Â» days would be great :slight_smile:

Darn! Indeed it’s due to the Node.js 18 LTS update.

Ok, the library must have an issue installing on the latest Docker Node 18 Alpine image on some architectures.

It’s strange because normally during the Docker build if a dependency doesn’t install, it should crash the build
 It slipped through the cracks, we need to understand why. (See: Gladys/server/cli/install_service_dependencies.js at master · GladysAssistant/Gladys · GitHub )

Thanks for the logs :pray:

For info this library (Noble) has always caused us a lot of problems, originally we used this lib for Bluetooth:

Except it’s no longer maintained for 4 years, so someone made a fork that we followed in Gladys:

Except this fork now has 114 GitHub issues, so it also has its share of problems. It is still maintained, but not actively either. The codebase must be old and not pleasant to work with ^^

@VonOx Any idea why the lib no longer installs?

Interesting yes! We need to see if on the Raspberry Pi OS image that we distribute, Gladys has the rights to stop the global system, I don’t think so because we don’t have access to the system « shutdown Â» from the container (to test).

For now there are few votes on your request ^^

Not a bad idea, I created an issue, I’ll look at it tomorrow (Monday):

For now, no idea

In my production image only one dependency is installed

image

In interactive mode it doesn’t install either (no error), I had to update the package

With 1.9.2-15 does it install + is it functional?

Strange that it doesn’t install but there is no error either! Is it a direct dependency bluetooth-hci-socket or is it a peer dependency?

Hi VonOx,
Same error here.
My logs:

2022-12-10T15:44:18+0100 \u003cinfo\u003e index.js:15 (Object.start) Starting Bluetooth service
2022-12-10T15:44:18+0100 \u003cwarn\u003e service.start.js:44 (Service.start) Unable to start service bluetooth Error: Cannot find module '@abandonware/bluetooth-hci-socket'
Require stack:
- /src/server/services/bluetooth/node_modules/@abandonware/noble/lib/hci-socket/hci.js
- /src/server/services/bluetooth/node_modules/@abandonware/noble/lib/hci-socket/bindings.js
- /src/server/services/bluetooth/node_modules/@abandonware/noble/lib/resolve-bindings.js
- /src/server/services/bluetooth/node_modules/@abandonware/noble/index.js
- /src/server/services/bluetooth/lib/commands/bluetooth.start.js
- /src/server/services/bluetooth/lib/index.js
- /src/server/services/bluetooth/index.js
- /src/server/services/index.js
- /src/server/lib/index.js
- /src/server/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Function.Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.\u003canonymous\u003e (/src/server/services/bluetooth/node_modules/@abandonware/noble/lib/hci-socket/hci.js:6:28)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.\u003canonymous\u003e (/src/server/services/bluetooth/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:7:13)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at module.exports (/src/server/services/bluetooth/node_modules/@abandonware/noble/lib/resolve-bindings.js:13:12)
    at Object.\u003canonymous\u003e (/src/server/services/bluetooth/node_modules/@abandonware/noble/index.js:2:49)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at BluetoothManager.start (/src/server/services/bluetooth/lib/commands/bluetooth.start.js:16:20)
    at Object.start (/src/server/services/bluetooth/index.js:16:28)
    at Service.start (/src/server/lib/service/service.start.js:33:21) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/src/server/services/bluetooth/node_modules/@abandonware/noble/lib/hci-socket/hci.js',
    '/src/server/services/bluetooth/node_modules/@abandonware/noble/lib/hci-socket/bindings.js',
    '/src/server/services/bluetooth/node_modules/@abandonware/noble/lib/resolve-bindings.js',
    '/src/server/services/bluetooth/node_modules/@abandonware/noble/index.js',
    '/src/server/services/bluetooth/lib/commands/bluetooth.start.js',
    '/src/server/services/bluetooth/lib/index.js',
    '/src/server/services/bluetooth/index.js',
    '/src/server/services/index.js',
    '/src/server/lib/index.js',
    '/src/server/index.js'
  ]
}

It’s a dependency of noble.

Functionally, I don’t know — I don’t have any BLE to test with.

Can you run a build on your branch and put the Docker tag here? :slight_smile:

If someone with the hardware can do a test afterwards to see if that fixes the issue! If it’s good, I’ll merge your PR and kick off a build :slight_smile:

image

vonox/gladys:bluetooth

1 Like

Thanks @VonOx :folded_hands:

Can someone do a real test with this image and see if the Bluetooth is OK? If so, let me know and I’ll deploy it as soon as possible!! :grinning_face_with_smiling_eyes:

Being able to shut down the Raspberry Pi from Gladys would be a plus.
But in the event of a power outage, I think I’ll opt for a UPS, since I always have devices to monitor (fire detector, fridge temperature, boiler temperature); the only issue is that without power the Zigbee2mqtt relays will go down, so it’s not certain that the information will be reported.

8 messages were split into a new topic: Image Node 18: Bluetooth integration tests

Indeed because

That seems the most sensible to me as well

1 Like

For your information, the Bluetooth integration bug was isolated and fixed by @VonOx!

Thanks to @VonOx for the fix, @Psoy, @gaetanb76 and @spenceur for the tests :folded_hands:

I’ve launched a build (Gladys Assistant v4.13.2) which should be ready in about 1 hour.

5 Likes

I confirm that Gladys Assistant v4.13.2 is available and fixes the Bluetooth bug!

As usual, your instances will update automatically :slight_smile:

3 Likes

hello,
new version 4.13.2 arrived on my server.
everything seems ok!
ecowatt, MQTT

and especially Bluetooth: service started and it detects my BL devices
great.

to be continued

2 Likes

same for
thank you

Hello?

I do have version v4.13.2 of Gladys but no trace of Ecowatt!

:wink:

Hello @Doudy
Have you been in your dashboard to create a new box? When you select the box, a dropdown menu opens and ecowatt is at the very bottom of the list.

As @Psoy said, we need to add a box to a dashboard