Launch a script via a scene (Python/Bash/JS)

Hello

Simply the possibility to call a Python or Bash script via Gladys
With this, we open the door to advanced Linux users like me

Hello

For me, this can already be done:

  • Just create a « device Â» with the « Light On/Off Â» feature from the MQTT module.
  • Write a Python or Bash script on the machine of your choice that subscribes to the MQTT topic associated with the feature created previously and that executes what you want when the state changes to 1, for example.

Thus, you can run your script by clicking on the switch associated with the Light feature from the Gladys Dashboard.
I don’t know if I’m very clear but I can detail if necessary.

2 Likes

Hello, I’d be happy to provide details when you have spare time…

Thank you

It’s still a workaround using MQTT…

+1 to having a native solution. As a workaround, at least a minimum to start with would be good.

How do you envision a native integration?

Could you describe the functionality you would like?

Hello,

I can imagine several things, it will be more clear with some use cases I had with v3 :slight_smile:

I have a Raspberry with a touch screen, I had made a shell script where Gladys sent a remote SSH command to turn off/on the display in a fake on/off device.
This allows you to integrate it into things like I’m going to bed, it turns off all the lights + the screen.

You can imagine several on/off functions, text or value retrieval.

For example, you could make a script that lists the SSH users connected to a server and put a status in Gladys.

@Jean34 @Will9 I made a video about it :slight_smile: