_As a (type of user) I want this Skill to be able to make simpme web requests so that I can integrate it with a tool I use for home automation.
What third party services, data sets or platforms will the Skill interact with? It literally just needs to make a web request. For my purposes, it just needs to run curl and the url on the command line and it will make the request.
Are there similar Mycroft Skills already? Not that I know off.
Other comments?
Not really. I just think this would be a powerful, yet simple to implement skill. Put any other comments you think are relevant in here
If I understand correctly you to perform http-requests to a web-application by a Mycroft skill? For that you may want to have a look at Requests python library. Otherwise you need to be more specific, do you have a example requests? what is your âhome automation toolâ?
Having mycroft react to âHey Mycroft! Turn Light Onâ by wgetting the above URL would be pretty sweet (of course, the basic idea here is to make keywords/URLs customizable)
Thanks!
Thanks @Dominik
yep, you guessed right
Thanks for the code
I think it would be useful for anyone to have it inserted in the marketplace as a generic solution, since many IoT devices (Tasmota being the most used) accept HTTP commands for simple tasks (On/Off) without requiring an home automation backend.
Thanks!
Hey @gez-mycroft, thanks!
Iâve cloned the repo in to /skills, and edited the /mycroft-core/skills/make-get-request-skill.krisgesling/settingsmeta.yml
it now looks like this:
skillMetadata:
sections:
- name: Trigger
fields:
- name: trigger_phrase
type: text
label: Trigger phrase
value: "lights on"
placeholder: this should not include the wake word
- name: response_on_success
type: text
label: Response on success
value: "as you command"
- name: response_on_failure
type: text
label: Response on failure
value: "I can't sir"
[...]
I have also restarted mycroft with: ./start-mycroft.sh restart all
giving the command :skills in the CLI correctly lists make-get-request-skill.krisgesling among the installed skills.
but when I say âHey Mycroft! ⌠lights onâ, Mycroft responds with :
lights on DEBUG output
>> I don't know what that means.
Is there anything else I need to do?
Again, thanks for your support!
Thanks @SGee, here is the nano of make.request.intent
test this thing for me
I donât think itâs very evident from the code above, but there is a newline after âtest this thing for meâ⌠(ie: the file is composed of the above, followed by a new,empty line)
Iâve tried removing the newline and restarting Mycroft tho, and still the command is not recognized I also tried âtest this thing for meâ as the command, but it is not recognized either.
I deleted and re-created the file with just a simple word in it (âlightsâ) and it IS working!
yeah, but this doesnât resolve the core problem. This should automatcally be written as you change the config. (given the home config fetching algorithm got juiced)
Yep.
and I tought to play the smart guy and duplicate the skill (since as of now, I need at least two parameters: On and Off) and so have a skill for the âOnâ command and the other for the âOffâ command but alas, this isnât working either
Thanks @SGee, but Iâm really new at Mycroft
when you say:
make something with âlights {status}â
you mean writing in make.request.intent exactly: lights {status} ?
I tried doing this, and putting the logic in __init__.py but lights {status} isnât recognized anymore as a command. (of course by speaking âLights Onâ)
Again, pardon me but Iâm a total noob at this
Update: I also tried with double curly braces ({{status}}) as explained here:
@intent_handler('make.request.intent')
def handle_request(self, message):
"""Make the actual GET request."""
status = message.data.get(âstatusâ)
key = self.settings.get('param_key')
if status == "on":
value = self.settings.get('param_value')
if status == "off":
value = self.settings.get('param_value2')
...
Iâve found that Mycroft wonât react to the command specified in the settingsmeta.yaml, but just to the one in make.request.intent
maybe something else is broke⌠elsewhere?
Just to be sure, I rm -fr the skill and re cloned it with mycroft-msm install https://github.com/krisgesling/make-get-request-skill
then edited the above files one at a time, same results
maybe you are doing something wrong, you really should not edit settingsmeta.yaml, you should edit settings.yaml , the meta is for usage by the backend to display web settings
or maybe its the known selene bug, the backend is known to overwrite any changes you make locally to skill settings.
@SGee: yes, running with en-us @JarbasAl: thereâs no settings.yaml in this repo, Iâve tried updating settingsmeta from the device settings in the website, but it takes long for the settings to apply (if ever) so I was changing them direcly on disk