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
just use the web ui and wait for changes to sync, might take a few minutes.
i havent looked into gez skill, but this seems an odd thing to set utterance in web ui. just make a regular skill using intents like everyone else? that is literally what intents are for
@JarbasAl: I’m a total noob here, just trying to make gez skill work in a very simple scenario.
That said, I think I’m getting closer.
I’ve edited the .py file to speak the variable instead of speaking the error, and one of the problems seems to be that even it the command (in the web ui) is
turn lights {status}
when I say “turn lights on”
the command that is returned is turn lights (ie, the variable stays… null)
I’ve deleted and re-cloned the repo to be sure to have a clean start, and I’ve modified ONLY the data in the webui to these values:
@Sgee: I’ve given up on updating locally, and I’m just using the WebUI trying to make things as easy and replicable as possible. If you read my above post, I’m not really managing to have the variable you suggested get a value.
I’m banging my head at this since hours… I didn’t expect this to be so hard…
Thanks for the help
for updating purposes, yes. But to create those parameter (that are needed for your application) you have to edit settingsmeta.yaml. And after that you set up the actual values in home.mycroft.ai
Ok, finally made it!
I had to edit skills/make-get-request-skill.krisgesling/__init__.py
and replace value = self.settings.get('param_value')
with value=message.data.get('status')
as @Sgee suggested!
I also had to edit manually skills/make-get-request-skill.krisgesling/locale/en-us/make.request.intent
since it was not updating to reflect the command
and make it: turn lights {status}
Everything else left as in the github repo.
Thanks @Sgee and @JarbasAl!
Hold your horses. That replacement just makes sure that the param_values are circumvented alltogether. That just works as status=value (request = turn on/off), but what if you want to use an other command? Just a bandaid. (if you want to stick to Gez’ logic)
and you’re actually confusing me with
the skills reside in /opt/mycroft/skills/*
the (local) configuration at ~/.config/mycroft/skills/*
you might want to log your code importing
from mycroft.util.log import LOG
and log the variables (to cli) with
self.log.info(variable)
Maybe I’ve missed it but how do you have more then one request? Great skill btw since this is a great and basic way of smarthome control but how do you set it up to send more then one get request and more then one way to ask it. So that I can control my entire smarthome like lights, plugs and devices with get commands?
The simplicity (/universality) yet becomes its problem. Since you can go in every direction with this, you are pretty much on your own with this to taylor it to your needs (which means: coding)
(I would maybe rework (settingsmetas’) trigger -> device/s (/array of devices), and the trigger with “[skill name] [action] {device} {status}”)
BTW - more of a general feature request - What does it take to make the metasettings expandable/contractable (i.e. new value/key (+/-))? From “Home” that is.