Gladys and Imperihome: Fake device creations

Hello everyone,

Having a bit of time, I’m looking into an issue that has appeared since I switched to v4.

In V3, I used the module from @isokar to display status feedback in Imperihome thanks to Gladys. (see here)

However, I assume that since my migration to v4, I can no longer use this solution… Is there another way for me to meet my needs?

A brief summary to save you from reading the entire old topic:

My need:
Having an icon in Imperihome that changes according to the state of my windows (icons allowing 3 possible states/display. Example in my case: closed window, partially open (oscillating), fully open.

My setup:
Each of my windows is equipped with 2 Xiaomi opening sensors, one at the top and one at the bottom.

Previous operation:
Thanks to the said module, the icons of my windows changed according to their opening:
Closed window = 2 sensors in closed state = icon displays closed window
Window in oscillating = only the top sensor of the window open = icon displays oscillating open window
Open window = 2 sensors open = open window icon displayed

Thanks in advance for your attention and any possible help.

Hello!
This is probably a lot of tinkering, but going through two scenes and a fake device might work, but icon bags…

You create an MQTT device for the window with, for example, the ‹ access controller › function.

Then you create a scene in which you specify that if the top sensor is open, change the state of your Fake device to 1 and you add a ‹ continue only if › the bottom sensor is open, change the state of the device to 2.

Another scene will be needed to reset everything. If the bottom sensor is closed, continue only if the top sensor is closed, change the fake device to 0.

You then have three states (0=closed, 1=oscillo-leaf, 2=open)

Are you following me?
I hope you only have one window…

@Retlaw It will indeed be necessary to go through MQTT integration to create fake devices

For three-state windows, we don’t have that in Gladys 4 currently.

We have a sensor type « window opening », but it only manages « Open/Closed ».

If we want to add another type of window opening sensor that manages an intermediate mode, we need to make a small PR to Gladys that defines a new sensor type and manages the display in the front end.

@GBoulvin, I have 6 windows :sweat_smile:

@pierre-gilles, unfortunately I don’t have the knowledge to make a PR :worried:

I will therefore see what can be done with MQTT… For a long time I’ve been telling myself that I need to find time to look into what MQTT is, what it’s used for, and how to set it up. This is another argument to get started.

I hope to be able to set up a fake device type dimmer that would be updated (0/50/100) by a scene launched by Gladys depending on the state of the sensors.

Got it, keep us posted :slight_smile:

For the PR, we can help. For now, try to make your multi-level sensor first and when you have that, maybe look into the display to make something cleaner!