As a user
I want to be able to inject a scene variable into an HTTP request
In order to be able to make requests containing relevant information (door opening status for example)
As a user
I would like to be able to inject a scene variable into a block controlling a device
In order to be able to define a value for a feature (air quality recovery via api cf: Nouvelle vidéo : Gladys Assistant chez vous #5, Cyril et son café prêt tous les matins grâce à Gladys! - #15 par pierre-gilles )
I think this is a good feature so I even voted for it
Will my Sonos finally be able to tell me what the temperature is in my daughter’s room ?
If on top of that you play the « child » card, you’re going to make me develop it even faster haha
She is 8 months old, is that better?! XD
VonOx
March 9, 2022, 7:52pm
6
Yes, she will tell you to check your Dashboard
I vote for it because I have Sonos speakers too, and children too!!
guim31
March 9, 2022, 9:01pm
8
My daughter is 15 months old…
Still, I don’t even know what we’re talking about with http injections
A warning is better than nothing xD
In short, I created an API on the Node-RED side
And when I send this action to Gladys
And when I pass it a text + a room, I get a voice message (for now, Google) on my Sonos speakers
guim31
March 10, 2022, 7:56am
11
Oh yeah, that’s VERY cool! I really like the concept.
I can imagine that at my place with the alarm status:
« Alarm activation in 30sec »
Beep – Beep – Beep – …
« Alarm activated »
« Alert detected - Emergency services being called »
Etc… I love it
It will be necessary to create bots that vote (no choice ^^)
I vote for it! Actually, I had suggested the same idea in November, but it didn’t get as much success : Permettre d'injecter une variable dans une action "faire une requête HTTP"
Indeed, is it possible to merge the two as well as the votes @pierre-gilles / @VonOx / @Tlse-vins ?
Merging is not possible as far as I know, but we need to tell @Lokkye to delete his vote from the other one and vote on this one.
We will be able to close the other request.
Lokkye
April 18, 2022, 3:50pm
16
I just removed my vote on the other one
Hi everyone!
I worked on this topic today. It’s not the most requested topic on the forum, but it’s a « quick win » and I think this feature is very useful for people who want to switch to Gladys while keeping another instance alongside (HA (Home Assistant), Node-RED, etc..) to manage devices not handled by Gladys.
For the « Make an HTTP request » action, it looks like this:
Same behavior as the « Send a message » action
The PR is available here:
master ← new-variable-injected-component-scene
ouvert 03:52PM - 23 May 22 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fa… st as possible, make sure to review and check all of these items:
- [x] If your changes affects code, did your write the tests?
- [x] Are tests passing? (`npm test` on both front/server)
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [x] If you are adding a new features/services, did you run integration comparator? (`npm run compare-translations` on front)
- [x] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to [the community](https://community.gladysassistant.com/) for testing before merging.
- [x] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
- [x] If you are adding a new features/services which needs explanation, did you modify the user documentation? See [the GitHub repo](https://github.com/GladysAssistant/v4-website) and the [website](https://gladysassistant.com).
- [x] Did you add fake requests data for the demo mode (`front/src/config/demo.js`) so that the demo website is working without a backend? (if needed) See [https://demo.gladysassistant.com](https://demo.gladysassistant.com).
NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
### Description of change
Please provide a description of the change here. It's always best with screenshots, so don't hesitate to add some!
However, I can’t really see how we could do this in the « Control a device » action because that view doesn’t have any text fields.
I wonder if in the end it’s not a different development..
Those of you who wanted this feature in the « control a device » action, what would you have used it for?
Do you have an example use case?
VonOx
May 23, 2022, 4:22pm
18
You make a GET request that retrieves a value, and that value allows you to set the state of a Gladys device. It doesn’t matter which feature.
That avoids using Node-RED just to do that (in practice it can be complicated if you need to convert the data type…)
Ok I see, indeed that’s useful.
Besides, in this case it’ll be a totally different visual, since we just want to inject a « pure » value, and not concatenated text like when sending a message or an HTTP request.
The problem of data conversion is also important, because then it’s no longer text but numbers that we send.
So it will be a different PR then.
I thought it was in the new