mycroftai / skill-homeassistant Goto Github PK
View Code? Open in Web Editor NEWThis project forked from eclarity/mycroft-homeassistant
Mycroft Skill/Integration for Homeassistant
License: GNU Lesser General Public License v3.0
This project forked from eclarity/mycroft-homeassistant
Mycroft Skill/Integration for Homeassistant
License: GNU Lesser General Public License v3.0
There device tracker part of this skill is a little raw..
Sandro-iMac has been detected at not_home.
Where is Sandro?
Last known location of Sandro-iMac is not_home.
Where is Sandro iPhone?
Sandros-iPhone has been detected at home.
So Sandro is at home?
You might have to say that a different way.
You may consider to add a "Persons" "Entity" that in HA it has states "Home / Not_Home"...
Is your feature request related to a problem? Please describe.
I would like to receive audible notifications from Home Assistant on my Mycroft Mark ii.
Describe the solution you'd like
There should be some way to send notifications to Mycroft from HA. Here is an example of many situations in which this was used with the old third-party HA integration: https://community.mycroft.ai/t/fun-with-mycroft-and-home-assistant/12030
Describe alternatives you've considered
n/a
Additional context
n/a
Mycroft says "an error occured while installing the dependancies for home assistant" when I try to install this skill
The old method of registering intent files was:
self.register_intent_file(
'set.climate.intent',
self.handle_set_thermostat_intent
)
These can now be converted to decorators eg:
@intent_handler('set.climate.intent')
self.handle_set_thermostat_intent(self, message):
...
Is your feature request related to a problem? Please describe.
There is no button intent support for ha
Describe the solution you'd like
It would be cool to have an intent like "(press | activate) {Entity}". But i'm new to HA so there might already be another intent already supported that can be used to realise this action?
Describe alternatives you've considered
Maybe wait for scripts or already use scene support for more generic use of buttons entity directly in HA?
Thanks in advance and great job!
Hi! First of all, very good job with this skill. Keep up the good work!
I recently updated to mycroft-core 20.2.0 and after failing to update, i just clean installed picroft again.
Running on Raspberry Pi 3, after installing Home Assistant skill i get the following in mycroft-cli
`~~~~ | WARNING | 640 | mycroft.skills.settings:_update_settings_meta:306 | DEPRECATION WARNING: The "name" attribute in the settingsmeta file is no longer supported.
20:13:41.746 | ERROR | 640 | mycroft.skills.settings:_issue_api_call:315 | Failed to upload skill settings meta for homeassistant|20.02
Traceback (most recent call last):
File "/home/pi/mycroft-core/mycroft/skills/settings.py", line 312, in _issue_api_call
self.api.upload_skill_metadata(self.settings_meta)
File "/home/pi/mycroft-core/mycroft/api/__init__.py", line 382, in upload_skill_metadata
"json": settings_meta
File "/home/pi/mycroft-core/mycroft/api/__init__.py", line 69, in request
return self.send(params)
File "/home/pi/mycroft-core/mycroft/api/__init__.py", line 152, in send
return self.get_response(response, no_refresh)
File "/home/pi/mycroft-core/mycroft/api/__init__.py", line 174, in get_response
raise HTTPError(data, response=response)
~~~~ ["Couldn't interpret 'False' as string."]}, '1': {'value': ["Couldn't interpret 'True' as string."]}, '2': {'value': ["Couldn't interpret 'True' as string."]}}}}`
Any idea?
Since about a month now my Mycroft homeassistant skill running on Picroft stopped working. Using the client in debug mode I write
turn on corner lamp
which used to work pretty flawlessly, but now I am getting:
22:54:19.415 | INFO | 609 | WolframAlphaSkill | WolframAlpha query: turn on corner lamp
22:54:19.426 | INFO | 609 | WolframAlphaSkill | Non-question, ignoring: turn on corner lamp
22:54:20.179 | INFO | 609 | QuestionsAnswersSkill | Timeout occured check responses
Environment (please complete the following information):
I have regenerated the long term key for homeassistant and pasted it in the skill as a way to force a restart, but that didn't help. It did however uncover a problem with the log in:
2022-08-20 23:30:49.894 | INFO | 558 | mycroft.skills.skill_loader:load:185 | ATTEMPTING TO LOAD SKILL: skill-homeassistant.mycroftai
2022-08-20 23:30:51.172 | INFO | 558 | mycroft.skills.settings:get_local_settings:83 | /home/pi/.config/mycroft/skills/skill-homeassistant.mycroftai/settings.json
2022-08-20 23:30:51.179 | INFO | 558 | mycroft.skills.settings:get_local_settings:83 | /home/pi/.config/mycroft/skills/skill-homeassistant.mycroftai/settings.json
2022-08-20 23:30:51.663 | INFO | 558 | mycroft.skills.skill_loader:_communicate_load_status:344 | Skill skill-homeassistant.mycroftai loaded successfully
(.venv) pi@picroft:~/mycroft-core$ grep homeassi /var/log/mycroft/skills.log | tail
FANN Error 2: Unable to open configuration file "/home/pi/.local/share/mycroft/intent_cache/skill-homeassistant.mycroftai:{/tmp/mycroft/cache/HomeAssistantSkill/tracker}.intent.net" for writing.
2022-08-20 23:30:49.894 | INFO | 558 | mycroft.skills.skill_loader:load:185 | ATTEMPTING TO LOAD SKILL: skill-homeassistant.mycroftai
2022-08-20 23:30:51.172 | INFO | 558 | mycroft.skills.settings:get_local_settings:83 | /home/pi/.config/mycroft/skills/skill-homeassistant.mycroftai/settings.json
2022-08-20 23:30:51.179 | INFO | 558 | mycroft.skills.settings:get_local_settings:83 | /home/pi/.config/mycroft/skills/skill-homeassistant.mycroftai/settings.json
2022-08-20 23:30:51.663 | INFO | 558 | mycroft.skills.skill_loader:_communicate_load_status:344 | Skill skill-homeassistant.mycroftai loaded successfully
2022-08-20 23:31:19.876 | INFO | 558 | mycroft.skills.settings:_emit_settings_change_events:435 | Emitting skill.settings.change event for skill @e4cc7a57-38bc-4a74-b27c-64ada459203a|homeassistant|21.02
2022-08-20 23:31:19.915 | INFO | 558 | mycroft.skills.settings:save_settings:116 | Skill settings successfully saved to /home/pi/.config/mycroft/skills/skill-homeassistant.mycroftai/settings.json
FANN Error 2: Unable to open configuration file "/home/pi/.local/share/mycroft/intent_cache/skill-homeassistant.mycroftai:{/tmp/mycroft/cache/HomeAssistantSkill/tracker}.intent.net" for writing.
Regenerated skill-homeassistant.mycroftai:{/tmp/mycroft/cache/HomeAssistantSkill/tracker}.
And at the same time I am seeing home assistant complaining about the failed login. It looks to me that maybe the token is now being downloaded?
Please let me know if there's anything I can do or check more detail to improve this description?
As flagged in https://community.mycroft.ai/t/homeassistant-skill-misinterprets-request/6453/39, there is currently no error if you try to control a device that is offline.
This is in part due to limitations of the home assistant API, which issues an HTTP 200 (successful) response regardless of whether it was able to actual take the action issued. To resolve this, I think we'd need to query the device before (and potentially after) issuing commands, to confirm they are online, and then that the command actually worked. This would introduce some obvious race conditions, but I think in practical terms, people are unlikely to hit those.
I've Tado (climate) and Hue (lamp) devices in my home, and for this particular issue: both define entities named "Bedroom"
I tried a few variations of these phrases to get Mycroft to control the hue lamp in my bedroom:
In all scenarios, Mycroft affects my Tado entity in my bedroom instead of the lamps as expected.
Looking in code, the issue is in handle_switch_intent
, which looks in all entities including climate: https://github.com/MycroftAI/mycroft-homeassistant/blob/e5abeab32dc1c8cb3ea6d5737e883dbc3f74a0e8/__init__.py#L180-L190
The context about lights is dismissed at this point and Mycroft proceeds to affect any best matching entity named "bedroom" in home assistant, which in this ends up being my bedroom's climate control, not the lights.
I don't need Mycroft to control my climate sensors (yet), so a quick fix for me was to remove the "climate" value from the find_entity
call but I'd love to see Mycroft being more aware of my intent in this case.
If a long-lived access token for homeassistant is not configured and the user attempts to use the homeassistant skill, the response from mycroft does not mention that a token is required.
Hello,
I'm trying to use the skill and it works perfectly in English. However in french (configured by "lang": "fr-fr", in mycroft.conf), no keywords work. For instance I use "allume XXX" which is the equivalent to "turn on XXX" (according to this https://translate.mycroft.ai/fr/mycroft-skills/translate/homeassistant-fr.po#search=allume&sfields=source,target&unit=134631&offset=0) but faced with a blank response "Sorry I don't understand".
Logs are below.
Anything I'm doing wrong to change language?
Thanks
10:52:23.476 | DEBUG | 675 | mycroft.skills.intent_service:handle_utterance:329 | Utterances: ['allume entree']
~~~~lls.intent_service:handle_utterance:349 | Padatious intent: {'name': 'mycroft-stop.mycroftai:reboot.intent', 'sent': 'allume entree', 'matches': {}, 'conf': 0.17207702686938922}
10:52:23.584 | DEBUG | 675 | mycroft.skills.intent_service:handle_utterance:350 | Adapt intent: None
10:52:23.592 | DEBUG | 675 | mycroft.skills.padatious_service:handle_fallback:157 | Padatious fallback attempt: allume entree
10:52:23.593 | INFO | 675 | QuestionsAnswersSkill | Searching for allume entree
10:52:23.597 | DEBUG | 675 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: fallback-query.mycroftai:QuestionQueryTimeout
10:52:23.648 | DEBUG | 675 | WolframAlphaSkill | WolframAlpha query: allume entree
Removing event fallback-query.mycroftai:QuestionQueryTimeout
10:52:23.658 | DEBUG | 675 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
10:52:23.663 | DEBUG | 675 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: fallback-query.mycroftai:QuestionQueryTimeout
10:52:23.703 | DEBUG | 675 | WolframAlphaSkill | translation: light entry
10:52:23.704 | DEBUG | 675 | WolframAlphaSkill | Non-question, ignoring: light entry
Removing event fallback-query.mycroftai:QuestionQueryTimeout
10:52:23.749 | DEBUG | 675 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
10:52:24.191 | INFO | 675 | QuestionsAnswersSkill | Timeout occured check responses
10:52:24.600 | DEBUG | 675 | mycroft.skills.padatious_service:handle_fallback:157 | Padatious fallback attempt: allume entree
10:52:30.103 | DEBUG | 675 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
10:52:30.468 | DEBUG | 675 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/device/aa930e2b-a455-40d8-840e-b25d3be1e668/skill/settings HTTP/1.1" 304 0
10:52:30.475 | DEBUG | 675 | mycroft.skills.settings:download:365 | No skill settings changes since last download
10:53:07.251 | DEBUG | 675 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
10:53:07.622 | DEBUG | 675 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/device/aa930e2b-a455-40d8-840e-b25d3be1e668/setting HTTP/1.1" 304 0
10:53:07.630 | DEBUG | 675 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
10:53:07.984 | DEBUG | 675 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/device/aa930e2b-a455-40d8-840e-b25d3be1e668/location HTTP/1.1" 304 0
^--- NEWEST ---^
When using the voice command to install home assistant, it incorrectly installs the version with YAML settings. Doing a git pull
in the homeassistant skills directory updates to the correct version, at which point the Skill can be configured at home.mycroft.ai.
Please fix the skill installation so it uses the JSON settings file instead of the broken YAML file. There is zero documentation for this, so hopefully this issue helps someone else.
Many thanks for creating this skill. I've been using it with success on both individual and group lights.
It would be great if it could support brightness e.g.
Hey Mycroft, turn the corner light to 70%.
Hey Mycroft, set the corner light to 70%.
I don't think it's a high priority feature as it could be achieved with scenes. Also, most of the time people will just use an app to get a very rewarding experience of sliding. There were a few situations though when I just wanted to decrease brightness so I am sure I am not the only one.
Shouldnt default branch be changed to 20.02 ?
I cannot controll covers with it? Is it something I do wrong? Thank You
After install and when trying to load the skill the following shows up and the skill doesn't load.
2020-06-14 09:45:54.899 | ERROR | 1819 | mycroft.skills.skill_loader:_create_skill_instance:249 | Skill initialization failed with error('nothing to repeat at position 0')
Traceback (most recent call last):
File "/home/pi/mycroft-core/mycroft/skills/skill_loader.py", line 238, in _create_skill_instance
self.instance.load_data_files()
File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 1180, in load_data_files
self.load_regex_files(root_directory)
File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 1217, in load_regex_files
regexes = load_regex(regex_dir, self.skill_id)
File "/home/pi/mycroft-core/mycroft/skills/skill_data.py", line 107, in load_regex
regexes += load_regex_from_file(join(path, f), skill_id)
File "/home/pi/mycroft-core/mycroft/skills/skill_data.py", line 68, in load_regex_from_file
re.compile(regex)
File "/usr/lib/python3.7/re.py", line 234, in compile
return _compile(pattern, flags)
File "/usr/lib/python3.7/re.py", line 286, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python3.7/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib/python3.7/sre_parse.py", line 930, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib/python3.7/sre_parse.py", line 426, in _parse_sub
not nested and not items))
File "/usr/lib/python3.7/sre_parse.py", line 651, in _parse
source.tell() - here + len(this))
re.error: nothing to repeat at position 0
Running (picroft) 20.2.4 with language set to nl-nl
After some testing I noticed that when I take regex/nl-nl folder out of the equation the skill loads perfectly.
Further testing (copying files 1 by 1) resulted in finding that numvalue.rx was the culprit. After replacing it with the en-us version the skill loaded correctly.
It seems like a '(' is missing from the line.
Add a native QML UI interface instead of webviews as being used in #84
A native QML UI provides more controls over the UI integration than a web interface, For example, a basic QML UI can be implemented for a group of devices and each individual device within a group itself (just to be clear the below is just an example of what it can look like from my pov as a community dev)
Some of the cons of using a web interface instead of a native interface:
Consider the following light group
- platform: group
name: Main Floor
entities:
- light.back_den
- light.kitchen
- light.dining_room
- light.main_front_hall
or
- platform: group
name: Kitchen
entities:
- light.kitchen_main
- light.kitchen_sink
- light.kitchen_island
- light.kitchen_counter
Let's use the kitchen for this example.
Hey Mycroft, turn on the kitchen lights
works!
turned on kitchen
Hey Mycroft, turn on the kitchen lights
or
Hey Mycroft, turn on all of the kitchen lights
, doesn't work:
no change
kitchen lights already on
This is because the "state" of the group is on if any one sub-entity is on.
Any suggestions for how to address this scenario?
PS:
3. "subset of lights in a room are on" -- and we want ALL lights in the room off
Hey Mycroft, turn off the kitchen lights
, works:
turned off kitchen
Describe the bug
I cant say turn on [Area]
. It always just enables the first entity in the Area.
It seems like the fallback to Homeassistant conversation is never used.
it seems that nomatter if “enable_fallback”: true
the skill still thinks it is false.
In lines 59..61 is the problem.
if conversation_activated:
self.enable_fallback = \
self.settings.get('enable_fallback') == 'true'
should be
if conversation_activated:
self.enable_fallback = \
self.settings.get('enable_fallback')
Then it works.
I made a fix in the fix_fallback branch and will PR that to the default if/when someone confirms it is working for them too.
Hi there,
Thanks a lot for the amazing skill. I was wondering if there is any way to have data flowing from mycroft into home assistant as an event or something, So that for example an alarm set in mycroft could then be automated in homeassistant.
30486 | mycroft.skills.skill_loader:load:185 | ATTEMPTING TO LOAD SKILL: skill-homeassistant.mycroftai
14:22:37.421 | INFO | 30486 | mycroft.skills.settings:get_local_settings:83 | /home/pi/.config/mycroft/skills/skill-homeassistant.mycroftai/settings.json
14:22:37.425 | INFO | 30486 | mycroft.skills.settings:get_local_settings:83 | /home/pi/.config/mycroft/skills/skill-homeassistant.mycroftai/settings.json
14:22:37.589 | INFO | 30486 | HomeAssistantSkill | Removing all handlers...
14:22:37.591 | WARNING | 30486 | mycroft.skills.fallback_skill:remove_fallback:185 | Could not find matching fallback handler
14:22:37.599 | ERROR | 30486 | mycroft.skills.skill_loader:_create_skill_instance:313 | Skill initialization failed with AttributeError("'NoneType' object has no attribute 'group'")
Traceback (most recent call last):
File "/home/pi/mycroft-core/mycroft/skills/skill_loader.py", line 307, in _create_skill_instance
self.instance.initialize()
File "/opt/mycroft/skills/skill-homeassistant.mycroftai/__init__.py", line 91, in initialize
self._setup()
File "/opt/mycroft/skills/skill-homeassistant.mycroftai/__init__.py", line 37, in _setup
ip = check_url(self.settings.get('host'))
File "/opt/mycroft/skills/skill-homeassistant.mycroftai/ha_client.py", line 34, in check_url
return matches.group(1)
AttributeError: 'NoneType' object has no attribute 'group'
14:22:37.604 | ERROR | 30486 | mycroft.skills.skill_loader:_communicate_load_status:351 | Skill skill-homeassistant.mycroftai failed to load
I installed this and i'm happy its working as expected. I want to use it with my vacuum integration that i got from here https://github.com/BnMcG/PyRobovac. It works manually through the home assistant dashboard but not through mycroft voice command. Its response is "Sorry cant find the Home Assistant entity "vacuum manuel".
The entity is named this "vacuum.manuel" on my home assistant which I can see in developer-tools/state on home assistant, I can also see the state is currently set to "off" when "off" and on when on.
My questions are:
Am i right in thinking because it uses fuzzy words that it should at least understand that that entity exists?
Should this work out the box or will i need to do some more work to get ti to work?
Thanks in advance.
This line is missing arguments for the dialog:
skill-homeassistant/__init__.py
Line 155 in 19c1b01
==> /var/log/mycroft/skills.log <==
2023-01-11 15:09:55.699 - skills - mycroft.skills.intent_services.commonqa_service:_query_timeout:173 - INFO - Timeout occurred check responses
2023-01-11 15:09:55.924 - skills - mycroft.skills.mycroft_skill.mycroft_skill:_on_event_error:1131 - ERROR - 'field'
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/ovos_utils/messagebus.py", line 352, in wrapper
handler(message)
File "/home/mycroft/.local/share/mycroft/skills/skill-homeassistant.mycroftai/__init__.py", line 229, in handle_turn_on_intent
self._handle_turn_actions(message)
File "/home/mycroft/.local/share/mycroft/skills/skill-homeassistant.mycroftai/__init__.py", line 382, in _handle_turn_actions
ha_entity = self._find_entity(
File "/home/mycroft/.local/share/mycroft/skills/skill-homeassistant.mycroftai/__init__.py", line 155, in _find_entity
self.speak_dialog('homeassistant.error.setup')
File "/usr/lib/python3.10/site-packages/mycroft/skills/mycroft_skill/mycroft_skill.py", line 1490, in speak_dialog
self.dialog_renderer.render(key, data),
File "/usr/lib/python3.10/site-packages/ovos_utils/dialog.py", line 94, in render
line = line.format(**context)
KeyError: 'field'
The dialog expects a field
argument, but this line does not pass any.
Describe the bug
Changing the language to french makes the Home assistant skill not working
To Reproduce
Steps to reproduce the behavior:
Install Mycroft - stable or dev
---- The following steps can be swapped between them to reproduce ----
set mycroft language to french: mycroft-config set lang "fr-fr"
install home-assistant skill: mycroft-msm install home-assistant
try to use Home-assistant skill
Expected behavior
You can enjoy Home assistant skill in french :-) Bonjour
Log files
skills.log
Environment (please complete the following information):
Additional context
I'm very new to Mykroft, i feels there's something wrong but it looks like it's not on my side this time :-) i hope to be mistaken
Is your feature request related to a problem? Please describe.
I'm always frustrated when I say "Turn on the living room lights" but only one of the lights in the living room turns on.
Describe the solution you'd like
HA lets you assign devices to Areas (rooms) and then lets you target all the devices in those areas. I'd like for Areas to be supported with voice commands too.
Describe alternatives you've considered
There are two alternatives that are already supported by this skill, but they both have drawbacks.
Furthermore both of these alternatives suffer from the fact that the fuzzy entity matching often (for me at least) will pick a single light over the scene or group.
I've tried having a scene "Living room lights on" and telling mycroft to activate the scene, but it will mostly just pick a single light and turn it on.
Additional context
none
Hello! This issue is more of a question to start, but based on answers I'd like to submit a PR.
As per https://github.com/MycroftAI/mycroft-homeassistant/blob/20.02/vocab/en-us/AutomationActionKeyword.voc, we have some initial great vocab for activating scenes/automation in home assistant.
We have some scenes like:
So we can activate them with:
So! To make it slightly more intuitive, we are thinking it would be +1 cool factor to just say:
So, questions:
thx!
Hello, do we have a timeline for adding the ability to call Home Assistant scripts? I'd love to help out in any way to get this ability added.
Is your feature request related to a problem? Please describe.
I have a set of RGB lights and i would like to use mycroft to change their colour
Describe the solution you'd like
A notifty for "Change/Set <light name> to <colour>"
As the title says, the image links are broken and simply redirect to a github 404 page.
This happens on the 20.8 and the 20.2 branches, but they still work for the 19.02 branch and some of the other branches too
I don't understand how to work with it. How to start with it? I have so many problems to start. Commands are not recognized correctly, how can I adjust this? What is read out at hass, "friendly name", "entity id"? Commands like "Turn on the office light" / "Turn off bedroom lights" doesn't work for me.
If I ask "sensor temperature bath" - I get "CPU temperature is 50 °C".
Describe the bug
Since PR #89 the list of trackers is saved within a temporary tracker.entity
files and loaded within padatious. Padatious cannot save the generated network and fails with an exception.
When padatious is configured to be single_thread
, it cause the whole skills process to fails and exit.
To Reproduce
Steps to reproduce the behavior:
single_thread
mycroft.skills
Expected behavior
Padatious should not fails to compile and save the generated neural network.
Log files
2022-04-24 15:58:18.300 | INFO | 3366 | mycroft.skills.intent_services.padatious_service:train:151 | Training... (single_thread=True)
2022-04-24 15:58:18.343 | INFO | 3366 | __main__:on_ready:185 | Skills service is ready.
FANN Error 2: Unable to open configuration file "/opt/mycroft/.local/share/mycroft/intent_cache/skill-homeassistant.mycroftai:{/tmp/mycroft/cache/HomeAssistantSkill/tracker}.intent.net" for writing.
malloc(): invalid size (unsorted)
Environment (please complete the following information):
Additional context
The issue comes from method _register_tracker_entities
:
skill-homeassistant/__init__.py
Lines 91 to 107 in cb27f22
This methods create a temporary file (/tmp/mycroft/cache/HomeAssistantSkill/tracker.entity
) and write trackers to it. It is provided to the core method register_entity_file
which is intented to managed files within the vocab
or locale
directories only.
When Mycroft core generate the name for padatious, it uses both the skill ID and the filename https://github.com/MycroftAI/mycroft-core/blob/dev/mycroft/skills/mycroft_skill/mycroft_skill.py#L1049
In this case, the entity name contains multiples slashes /
which are not valid within filenames.
One solution to prevent this issue would be to directly write list of trackers within vocab/<lang>/tracker.entity
and to load it with self.register_entity_file("tracker.entity")
Issue from Forums, text copied here:
I have a working Homeassistant and have installed the Homeassistant skill on Mycroft. Mycroft appears to communicate with my HA instance. I can manipulate one of my actuators with verbal or typed commands.
I have some other actuators ( reflashed Sonoff with Tasmota ). Since I have four of these, their name on HA are suffixed with the numbers 1-4. The skill seems to get fixated on one particular actuator and ignores the number I actually want to address. This is not a speech recognition problem since a typed command does not work either.
In short “turn on blabla 1” will result in mycroft trying for instance to manipulate “blabla 3”.
Describe the bug
Throws an error
Log files
20:27:03.169 | INFO | 5168 | __main__:handle_wakeword:71 | Wakeword Detected: hey mycroft
20:27:03.643 | INFO | 5168 | __main__:handle_record_begin:41 | Begin Recording...
20:27:05.704 | INFO | 5168 | __main__:handle_record_end:49 | End Recording...
20:27:07.492 | INFO | 5168 | __main__:handle_utterance:76 | Utterance: ['schalte wohnzimmer aus']
20:27:07.600 | ERROR | 4550 | mycroft.skills.mycroft_skill.mycroft_skill:on_error:897 | Bei der Verarbeitung der Anfrage ist ein Fehler im Skill Home Assistant Skill aufgetreten.
Traceback (most recent call last):
File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 73, in wrapper
handler(message)
File "/opt/mycroft/skills/skill-homeassistant.mycroftai/__init__.py", line 174, in handle_turn_off_intent
self._handle_turn_actions(message)
File "/opt/mycroft/skills/skill-homeassistant.mycroftai/__init__.py", line 305, in _handle_turn_actions
data=ha_entity)
File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 1202, in speak_dialog
self.dialog_renderer.render(key, data),
File "/home/pi/mycroft-core/mycroft/dialog/dialog.py", line 110, in render
line = line.format(**context)
ValueError: Single '}' encountered in format string
^--- NEWEST ---^
Environment (please complete the following information):
I have multiple rooms configured in my home-assistant, but I'm unable to shut off lights on a per-room basis.
When I try the utterance "turn off the living room lights", and see it correctly registered in the logs, it still matches a scene I have configured to turn my living room lights on low or high.
The reply I get is "turn off living room nighttime", but my lights stay on.
I can ofcourse ask to turn all my lights in the house off, but this defeats the point. I'd rather not create a scene with shut off lights if I can help it.
Same goes for my kitchen, the utterance "turn on/off kitchen lights", and it's correctly interpreted in the logs, but yet, it goes to turn on "all my switches", so my 3d printer in the next room turns on instead.
Am I using the wrong utterances? It seems like mycroft's confidence is way off and it keeps going for the wrong things.
In short, how do I address an entire group/room at once without a scene?
Is your feature request related to a problem? Please describe.
I'm always frustrated when I tell mycroft to turn off/on some media player and it doesn't understand.
Describe the solution you'd like
HA has extensive support for media players, I'd like to see this skill leverage that!
Describe alternatives you've considered
none
There are several logical stages to take in supporting media players.
media_player.media_pause
- "Pause the living room speaker"media_player.media_stop
- "Stop playing in the living room"media_player.media_next_track
/ previous_track
- "Next track", "Previous song" (open question: how to choose which media_player entity when none is provided?)media_player.volume_up
/ down
- "Turn up the volume"media_player.volume_set
- "Set the volume to 50%"media_player.volume_mute
- "Mute the TV"media_player.repeat_set
- "Set repeat to single track"media_player.shuffle_set
- "Turn on shuffle"Eventually it would be nice to play specific playlists or albums. Unfortunately this is sort of media player platform specific in HA, that's why I'd leave it for a future stage.
For commonly played media (radio stations, common playlists etc) one could setup a script in HA, then use mycroft to trigger the script.
Describe the bug
Ask mycroft to add something to the shopping list when connected to an HA instance that doesn't have the Shopping List integration. You will get 'An error occurred while processing a request in Home Assistant Skill'
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should report a nice error, perhaps telling me that I need to configure the shopping list integration in HA>
Log files
Dec 25 12:08:58 localhost.localdomain python[2864]: INFO:mycroft.util.log:Padatious match: {'name': 'homeassistant.mark2:add.item.shopping.list.intent', 'sent': ['add', 'onions', 'to', 'the', 'shopping', 'list'], 'matches': {'entity': 'onions', 'utterance': 'add onions to the shopping list'}, 'conf': 1.0}
Dec 25 12:08:58 localhost.localdomain python[2864]: DEBUG:mycroft.util.log:Exit handle utterance
Dec 25 12:08:58 localhost.localdomain python[2929]: DEBUG:homeassistant.mark2:Handling homeassistant.mark2:add.item.shopping.list.intent with skill homeassistant.mark2 (session=67368b6b-6270-49a4-b56e-bfca08d0d01e)
Dec 25 12:08:58 localhost.localdomain python[2929]: DEBUG:homeassistant.mark2:Add onions to the shoping list
Dec 25 12:08:58 localhost.localdomain python[2929]: DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 10.9.4.25:8123
Dec 25 12:08:58 localhost.localdomain python[2861]: DEBUG:mycroft.util.log:Loading audio file: /opt/mycroft-dinkum/shared/mycroft/res/snd/acknowledge.wav
Dec 25 12:08:58 localhost.localdomain python[2929]: DEBUG:urllib3.connectionpool:http://10.9.4.25:8123 "POST /api/services/shopping_list/add_item HTTP/1.1" 400 16
Dec 25 12:08:58 localhost.localdomain python[2929]: ERROR:mycroft.util.log:Error in intent handler: homeassistant.mark2:add.item.shopping.list.intent
Dec 25 12:08:58 localhost.localdomain python[2929]: Traceback (most recent call last):
Dec 25 12:08:58 localhost.localdomain python[2929]: File "/opt/mycroft-dinkum/shared/mycroft/skills/mycroft_skill/mycroft_skill.py", line 685, in _handle_intent
Dec 25 12:08:58 localhost.localdomain python[2929]: result_message = handler(message)
Dec 25 12:08:58 localhost.localdomain python[2929]: File "/opt/mycroft-dinkum/skills/homeassistant.mark2/__init__.py", line 317, in handle_shopping_list_intent
Dec 25 12:08:58 localhost.localdomain python[2929]: return self._handle_shopping_list(message)
Dec 25 12:08:58 localhost.localdomain python[2929]: File "/opt/mycroft-dinkum/skills/homeassistant.mark2/__init__.py", line 477, in _handle_shopping_list
Dec 25 12:08:58 localhost.localdomain python[2929]: self.ha_client.execute_service("shopping_list", "add_item", ha_data)
Dec 25 12:08:58 localhost.localdomain python[2929]: File "/opt/mycroft-dinkum/skills/homeassistant.mark2/ha_client.py", line 283, in execute_service
Dec 25 12:08:58 localhost.localdomain python[2929]: req.raise_for_status()
Dec 25 12:08:58 localhost.localdomain python[2929]: File "/opt/mycroft-dinkum/.venv/lib/python3.8/site-packages/requests/models.py", line 960, in raise_for_status
Dec 25 12:08:58 localhost.localdomain python[2929]: raise HTTPError(http_error_msg, response=self)
Dec 25 12:08:58 localhost.localdomain python[2929]: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://10.9.4.25:8123/api/services/shopping_list/add_item
Dec 25 12:08:58 localhost.localdomain python[2929]: WARNING:mycroft.util.log:Missing template file: skill.error
Dec 25 12:08:58 localhost.localdomain python[2861]: INFO:mycroft.util.log:Played sound: file:///opt/mycroft-dinkum/shared/mycroft/res/snd/acknowledge.wav
Dec 25 12:08:58 localhost.localdomain python[2864]: DEBUG:mycroft.util.log:Starting session: b5b1c845-dc32-49a2-823a-83cffab763cf
Dec 25 12:08:58 localhost.localdomain python[2864]: DEBUG:mycroft.util.log:Completed action for session b5b1c845-dc32-49a2-823a-83cffab763cf: SpeakAction(utterance='An error occurred while processing a request in Home Assistant Skill', dialog='skill.error', wait=True)
Dec 25 12:08:58 localhost.localdomain python[2861]: DEBUG:audio:Speak for session 'b5b1c845-dc32-49a2-823a-83cffab763cf': An error occurred while processing a request in Home Assistant Skill (cache=False)
Dec 25 12:08:58 localhost.localdomain python[2864]: DEBUG:mycroft.util.log:Requested session end: 67368b6b-6270-49a4-b56e-bfca08d0d01e
Dec 25 12:08:58 localhost.localdomain python[2861]: DEBUG:audio:Segments: ['An error occurred while processing a request in Home Assistant Skill']
Environment (please complete the following information):
Mycroft is up and running, but Mycroft won't remember settings.
To recreate:
I've tried removing and re-adding the plugin, manually writing into settings.json, nothing works.
Any idea what's happening, or how I can figure out what's happening?
Submitting the latest Skill to the Marketplace showed there are some small intent conflicts with default Skills:
PR - MycroftAI/mycroft-skills#1459
Voight Kampff report - https://reports.mycroft.ai/skills/PR-1459/
Primarily the utterances:
It would be good to look at why this Skill is catching these utterances and improving intent handling so that we aren't trying to respond to utterances that don't relate to this Skill.
We could also add Voight Kampff tests for phrases that Home Assistant should not trigger on, like the above. Here's an example of that in the Timer Skill:
https://github.com/MycroftAI/mycroft-timer/blob/20.08/test/behave/timer.feature#L430
Describe the bug
Cannot obtain values from my Thermostat. I saw the vocab sentences and told mycroft to tell me the values of the current temperature, but it fails
To Reproduce
Steps to reproduce the behavior:
<ENTITY NAME>
"<ENTITY NAME>
"Expected behavior
It should read aloud the current temperature
Log files
13:51:35.342 | ERROR | 169044 | mycroft.skills.mycroft_skill.mycroft_skill:on_error:835 | An error occurred while processing a request in Home Assistant Skill
Traceback (most recent call last):
File "/home/malevolent/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 66, in wrapper
handler(message)
File "/opt/mycroft/skills/skill-homeassistant/__init__.py", line 187, in handle_sensor_intent
self._handle_sensor(message)
File "/opt/mycroft/skills/skill-homeassistant/__init__.py", line 456, in _handle_sensor
quantity.uncertainty <= 0.5):
TypeError: '<=' not supported between instances of 'NoneType' and 'float'
Environment (please complete the following information):
I'm trying to use intents mentioned here, but MyCroft ( Jarvis ) is not understanding.
I'm know that my voice command is recorded properly from the mycroft CLI.
Is there something I should do to make this work?
Describe the bug
When asking to open or close cover entities, Mycroft does not understand the command. Light and switch entities work great.
To Reproduce
Ask Mycroft to open or close an existing cover entity in Home Assistant
Expected behavior
I had hoped the skill would understand the utterance. The entity is named 'garage door' but this isn't recognised. Perhaps I am doing something simple wrong.
Log files
2021-12-01 12:54:44.482 | INFO | 795 | mycroft.session:get:74 | New Session Start: 9fc37c0c-dd65-412e-869f-bc9238a478e7
2021-12-01 12:54:44.484 | INFO | 795 | main:handle_wakeword:71 | Wakeword Detected: hey mycroft
==> skills.log <==
2021-12-01 12:54:44.493 | INFO | 789 | ReSpeaker_4mic_hat | Pixel Ring: Wakeup
2021-12-01 12:54:44.493 | INFO | 789 | TimerSkill | stopping repeating event to check for timer expiration
==> voice.log <==
Playing WAVE '/home/pi/mycroft-core/mycroft/res/snd/start_listening.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
2021-12-01 12:54:44.983 | INFO | 795 | main:handle_record_begin:41 | Begin Recording...
2021-12-01 12:54:46.986 | INFO | 795 | main:handle_record_end:49 | End Recording...
==> skills.log <==
2021-12-01 12:54:47.016 | INFO | 789 | ReSpeaker_4mic_hat | Pixel Ring: Off
==> voice.log <==
2021-12-01 12:54:48.071 | INFO | 795 | main:handle_utterance:76 | Utterance: ['open the garage door']
==> skills.log <==
2021-12-01 12:54:48.174 | INFO | 789 | ReSpeaker_4mic_hat | Pixel Ring: Think
2021-12-01 12:54:48.219 | INFO | 789 | ReSpeaker_4mic_hat | Pixel Ring: Off
2021-12-01 12:54:48.232 | INFO | 789 | QuestionsAnswersSkill | Searching for open the garage door
2021-12-01 12:54:48.239 | INFO | 789 | ReSpeaker_4mic_hat | Pixel Ring: Think
2021-12-01 12:54:49.402 | INFO | 789 | QuestionsAnswersSkill | Timeout occured check responses
2021-12-01 12:54:50.250 | INFO | 789 | ReSpeaker_4mic_hat | Pixel Ring: Off
2021-12-01 12:54:50.292 | INFO | 789 | ReSpeaker_4mic_hat | Pixel Ring: Think
==> audio.log <==
2021-12-01 12:54:50.303 | INFO | 792 | mycroft.audio.speech:mute_and_speak:127 | Speak: I'm sorry, , I can't do that right now. This conversation no longer serves any purpose.
2021-12-01 12:54:50.311 | INFO | 792 | mycroft.tts.tts:_get_sentence_from_cache:392 | Found 35a05a0daca65a4a30059bd228cbf1ee.mp3 in TTS cache
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.25.10; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
==> skills.log <==
2021-12-01 12:54:50.342 | INFO | 789 | ReSpeaker_4mic_hat | Pixel Ring: Off
2021-12-01 12:54:50.343 | INFO | 789 | ReSpeaker_4mic_hat | Pixel Ring: Speak
==> audio.log <==
Directory: /tmp/mycroft/cache/tts/GoogleTTS/
Playing MPEG stream 1 of 1: 35a05a0daca65a4a30059bd228cbf1ee.mp3 ...
MPEG 2.0 L III cbr32 24000 mono
^C
You may also include screenshots, however screenshots of log files are often difficult to read and parse.
If you are running Mycroft, the Support Skill helps to automate gathering this information. Simply say "Create a support ticket" and the Skill will put together a support package and email it to you.
Environment (please complete the following information):
Traceback:
Traceback (most recent call last):
File "/opt/mycroft/mycroft/skills/core.py", line 131, in load_skill
imp.PY_SOURCE))
File "/usr/lib/python3.5/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/usr/lib/python3.5/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 661, in exec_module
File "<frozen importlib._bootstrap_external>", line 767, in get_code
File "<frozen importlib._bootstrap_external>", line 727, in source_to_code
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/opt/mycroft/skills/homeassistant.mycroftai/__init__.py", line 149
self._client: HomeAssistantClient = None
^
SyntaxError: invalid syntax
Python 3.5.2.
Mycroft 19.2.13
Using the commonIoT branch for compatibility with the IoT skill. Related issue on that side: MycroftAI/skill-iot-control#6
Hello,
I have some problems with the skill when I turn my Mycroft assistant into French language. Here is the problem:
Description of the bug
skill-homeassistant initialisation fails if Mycroft is configured in French
To Reproduce
Steps to reproduce the behavior:
mycroft-config edit user
{
"max_allowed_core_version": 21.2,
"lang": "en-us",
"stt": {
"module": "mycroft",
"mycroft": {
"lang": "en-gb"
}
},
"tts": {
"module": "google",
"google": {
"lang": "en-gb"
}
}
}
Reload the conf mycroft-config reload
and reboot
skill-homeassistant works!
Set Mycroft to French mycroft-config edit user
{
"max_allowed_core_version": 21.2,
"lang": "fr-fr",
"stt": {
"module": "mycroft",
"mycroft": {
"lang": "fr-fr"
}
},
"tts": {
"module": "google",
"google": {
"lang": "fr"
}
}
}
mycroft-config reload
and reboot23:01:43.771 | ERROR | 960 | mycroft.skills.skill_loader:_communicate_load_status:351 | Skill mycroft-stock.mycroftai failed to load
23:01:43.788 | INFO | 960 | mycroft.skills.skill_loader:load:185 | ATTEMPTING TO LOAD SKILL: homeassistant.mycroftai
23:01:43.873 | INFO | 960 | mycroft.skills.settings:get_local_settings:83 | /home/pi/.config/mycroft/skills/homeassistant.mycroftai/settings.json
23:01:43.880 | INFO | 960 | mycroft.skills.settings:get_local_settings:83 | /home/pi/.config/mycroft/skills/homeassistant.mycroftai/settings.json
23:01:44.234 | INFO | 960 | HomeAssistantSkill | Removing all handlers...
23:01:44.239 | WARNING | 960 | mycroft.skills.fallback_skill:remove_fallback:185 | Could not find matching fallback handler
23:01:44.249 | ERROR | 960 | mycroft.skills.skill_loader:_create_skill_instance:313 | Skill initialization failed with error('unterminated character set at position 26')
Traceback (most recent call last):
File "/home/pi/mycroft-core/mycroft/skills/skill_loader.py", line 302, in _create_skill_instance
self.instance.load_data_files()
File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 1276, in load_data_files
self.load_regex_files(root_directory)
File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 1313, in load_regex_files
regexes = load_regex(regex_dir, self.skill_id)
File "/home/pi/mycroft-core/mycroft/skills/skill_data.py", line 107, in load_regex
regexes += load_regex_from_file(join(path, f), skill_id)
File "/home/pi/mycroft-core/mycroft/skills/skill_data.py", line 68, in load_regex_from_file
re.compile(regex)
File "/usr/lib/python3.7/re.py", line 234, in compile
return _compile(pattern, flags)
File "/usr/lib/python3.7/re.py", line 286, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python3.7/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib/python3.7/sre_parse.py", line 930, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib/python3.7/sre_parse.py", line 426, in _parse_sub
not nested and not items))
File "/usr/lib/python3.7/sre_parse.py", line 816, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
File "/usr/lib/python3.7/sre_parse.py", line 426, in _parse_sub
not nested and not items))
File "/usr/lib/python3.7/sre_parse.py", line 532, in _parse
source.tell() - here)
re.error: unterminated character set at position 26
23:01:44.270 | ERROR | 960 | mycroft.skills.skill_loader:_communicate_load_status:351 | Skill homeassistant.mycroftai failed to load
Environment:
Best regards,
Guillaume Nibert
Describe the bug
User on the Forums is reporting that they get dialog duplicated as output:
“Successfully set thermostat to 70 none, successfully set thermostat to 70 none”
It's also reporting "None" for presumably the unit of measure.
To Reproduce
Full details here:
https://community.mycroft.ai/t/mycroft-speaks-twice-with-homeassistant-confirmations/11428/2
Expected behavior
Single dialog reported back.
https://github.com/MycroftAI/mycroft-homeassistant/blob/19.02/regex/en-us/switch.rx#L2 makes me think the phrase turn off all lights
should work. However:
turn off all lights
>> Entity "all" could not be found.
turn off lights
>> turned off all lights.
Describe the bug
The README lists the supported entity types, but doesn't mention scripts or automations. I almost opened a feature request to add these, but then found in the source code that they were in fact supported.
skill-homeassistant/__init__.py
Line 601 in c8853f9
To Reproduce
n/a
Expected behavior
The README should document the actual features :)
Log files
n/a
Environment (please complete the following information):
n/a
Additional context
n/a
Is your feature request related to a problem? Please describe.
An issue I've seen reported many times over the years is that people enter their host / ip address settings in different ways and it's not clear which format should be used. For example you might enter:
192.168.1.100
http://192.168.1.100
http://192.168.1.100/
https://192.168.1.100
Describe the solution you'd like
Ideally we would accept any logical format and normalize these to what the Home Assistant client expects.
Describe alternatives you've considered
Alternatively we can improve the documentation about what is required, but as much as I love documentation, I also know that most people don't read it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.