External integration - Devmel

Hello,

New external integration to control shutters, switches, lamps, and sensors from a Devmel AirSend radio gateway. :wink:

Available on the store in about an hour :wink:

Version 2 is out with widgets, triggers, and actions :slight_smile:
Bug fixes are also part of the package :wink:

Hello

I just integrated the DEVEMEL integration and I control all my SOMFY IO and RTS shutters, I have a Tubauto gate and it gives me an error when I want to integrate it to Gladys I copied the Json file as described in the Doc

I don’t know if you can help me here is the code

HTTP 422 — UNPROCESSABLE_ENTITY — t_device_feature.min cannot be null; t_device_feature.max cannot be null

Xavier

Thanks for the report

This is normally fixed in version 2.0.3

The cause

  • Your Tubauto portal is declared as a « button » (type 4096).
  • In Gladys, each function of a device must have a min and a max value.
  • The integration code did not set these values for 3 cases: the button (portals, garages), the switch (type 4097) and the on/off of the lights (type 4100).
  • Gladys therefore refused to create the device, hence the 422 error.
  • Shutters already have these values, which is why they work.

The fix

  • I added min: 0 and max: 1 to the 3 cases, in src/devices/button.js, src/devices/switchDevice.js and src/devices/light.js.
  • I added a test that checks that each function has a min and a max. Without the fix, this test fails. With it, all 249 tests pass and the code check is good.

Thanks for the feedback, it’s good, it works now :slightly_smiling_face:

@prohand

Hello, and thank you for this integration, the remotes mechanism works well.

Context

My airsend.cloud export contains 8 Somfy RTS shutters and 4 “group” inputs, all on pid 13920 (RFY):

  • “South Shutters” (2 shutters), “West Shutters” (3), “North Shutters” (3)
  • “Centralized Shutters” (all 8)

Each shutter lists in its remotes the channel of its group and that of the centralized command, and the three groups list the centralized channel. In this sense, it works: an order sent from Gladys (or by a remote control copied to the group address) on “Centralized Shutters” updates the 3 groups and the 8 shutters.

What’s Missing

Nothing is reported in the other direction:

  1. When I raised all the shutters with the three group remote controls (South, West, North), “Centralized Shutters” keeps its old state in Gladys, even though all the shutters are up.
  2. When I move a single shutter, its group and the centralized command continue to display “open” or “closed”, even though their members are no longer in the same state.

Proposal

A group (an input whose channel appears in the remotes of other inputs, or an explicit members list) would recalculate its state in Gladys only, without emitting anything on the radio, every time one of its members publishes a state:

  • all members have the same state → the group takes it;
  • members disagree → the group goes into an “undetermined” state (no position, neither open nor closed), so that the dashboard does not display something false.

This would also cover the case “all shutters raised one by one → the centralized command displays open”.

I can test a branch on my installation (Gladys 5.3.2, AirSend service integrated, a single box).

Hello @XDECO,

Thank you for this very detailed feedback! :pray: It’s in place in version 3.3.0, available now.

What’s New

A group now displays in Gladys the actual state of its shutters. It is calculated in the integration, and nothing is sent over the radio:

  • all shutters open → the group is open
  • all closed → the group is closed
  • otherwise (some open, some closed, one stopped halfway) → the group is displayed stopped
  • a group with travel time (travel_up / travel_down) displays the average position of its shutters

Gladys does not have an “undetermined” state: “stopped” is the closest state, that of a shutter halfway.

“Centralized Shutters” correctly counts your 8 shutters, going through the South / West / North groups. If you raise the 8 shutters one by one, it goes to “open”.

Nothing to Change in Your Config

The remotes you already have are sufficient: a shutter that has a group address in its remotes is a member of that group.

Good to Know

  • The group updates approximately 2 seconds after its shutters have finished moving. This prevents it from displaying “stopped” for a moment while each shutter follows a group command.
  • After the update, a group displays nothing until each of its shutters has had a known state at least once. A round trip is sufficient.
  • On startup, the integration logs indicate how many groups have been found:
    4 group(s) of shutters show what their shutters show
    If you don’t see this line, let me know.

I couldn’t test it on real hardware, so your feedback is very interesting to me, especially with your 8 shutters and 4 groups.

Thank you again for the tests! :+1:

Thanks @prohand for the 3.3.0, it’s tested and it works!

On startup, I have « 4 group(s) of shutters show what their shutters show ».

For the South group:

- I open Volet Cuisine Sud alone → Volets Sud and Volets CentralisĂ©s go to « stopped »;

- I open Volet Porte FenĂȘtre Sud → Volets Sud goes to « open », Volets CentralisĂ©s remains « stopped » (Ouest and Nord still closed);

- I close Volets Sud → the 2 shutters follow and Volets CentralisĂ©s goes back to « closed ».

Two remarks in the logs, without visible consequences:

  1. Every 4 minutes: « Could not keep the link to “AirSend box” warm: The box did not carry the order: UNSUPPORTED (event type 262) », followed by « Woke the link 
 in 0.2 s ». My box seems not to accept the keep-alive order.

  2. On startup: « Ignored a radio frame (unreliable, graded 0): pid 1 
 Set the listening channel to “generic” », while listening is already on channel 1 (deduced). The advice goes in circles.

I’m still testing the wall controls and the West / North groups, and I’ll get back to you.

Thanks @XDECO for these detailed tests, it helps a lot! :+1:

**Shutter groups**: everything works as expected. A group displays:

- « open » if **all** its shutters are open,

- « closed » if **all** are closed,

- « stopped » in other cases.

So with only Cuisine Sud open, « Volets Sud » correctly goes to « stopped ». And « Volets Centralisés » remains « stopped » as long as West and North are closed.

**The two log messages you reported are fixed in 3.3.1**:

1. **“Could not keep the link warm
 UNSUPPORTED (event type 262)” every 4 min**

To keep the link active, the integration reads a sensor from the box. Your AirSend doesn’t have a sensor, so it responds « UNSUPPORTED »  but it responds, and that’s all we ask of it (your log actually shows a wake-up in 0.2 s). So it wasn’t an error: the log now clearly states this.

2. **“Ignored a radio frame (unreliable, graded 0): pid 1” with the advice to switch listening to « generic »**

You were right, the advice was going in circles. The integration now takes into account the current listening. If it is already on this protocol, it says there’s nothing to change: it’s usually a frame from a neighbor’s device or radio interference.

3.3.1 is available, you can update whenever you want.

I’m waiting for your feedback on the wall-mounted remote controls and the West and North groups :slightly_smiling_face: