mikejgray / neon-homeassistant-skill

A Neon AI Skill for Home Assistant, which integrates with ovos-PHAL-plugin-homeassistant.
Apache License 2.0
7 stars 4 forks source link

Devices not always matched #7

Closed NeonDaniel closed 1 year ago

NeonDaniel commented 1 year ago

"Turn off desk light" works, but "Turn off my desk light" does not. Consider filtering out filler words (maybe after trying with the whole parsed entity?) to improve matches. I do something like this in the alerts skill, though it could probably be done with regex too.

Relevant logs:

2023-02-07 13:40:55.708 - skills - neon_core.skills.intent_service:handle_utterance:219 - INFO - ['turn on desk light', 'turn on desk light.']
2023-02-07 13:40:56.162 - skills - neon-homeassistant-skill_mikejgray:handle_turn_on_intent:46 - INFO - {'utterances': ['turn on desk light', 'turn on desk light.'], 'lang': 'en-us', 'context': {'client_name': 'mycroft_listener', 'source': 'audio', 'ident': 'None1943361626219843307', 'raw_audio': None, 'destination': ['skills'], 'timing': {}, 'username': 'local', 'user_profiles': [{'user': {'first_name': '', 'middle_name': '', 'last_name': '', 'preferred_name': '', 'full_name': '', 'dob': 'YYYY/MM/DD', 'age': '', 'email': '', 'username': 'local', 'password': '', 'picture': '', 'about': '', 'phone': '', 'phone_verified': False, 'email_verified': False}, 'brands': {'ignored_brands': {}, 'favorite_brands': {}, 'specially_requested': {}}, 'speech': {'stt_language': 'en-us', 'alt_languages': [], 'tts_language': 'en-us', 'tts_gender': 'female', 'neon_voice': '', 'secondary_tts_language': '', 'secondary_tts_gender': 'male', 'secondary_neon_voice': '', 'speed_multiplier': 1.0}, 'units': {'time': 12, 'date': 'MDY', 'measure': 'imperial'}, 'location': {'lat': '47.7229', 'lng': '-122.1961', 'city': 'Kirkland', 'state': 'Washington', 'country': 'United States', 'tz': 'America/Los_Angeles', 'utc': '-8.0'}, 'response_mode': {'speed_mode': 'quick', 'hesitation': False, 'limit_dialog': False}, 'privacy': {'save_audio': True, 'save_text': True}}]}, 'entity': 'desk light', 'utterance': 'turn on desk light'}
2023-02-07 13:40:56.184 - skills - neon-homeassistant-skill_mikejgray:_get_device_from_message:196 - INFO - Device: desk light
2023-02-07 13:40:56.196 - skills - neon-homeassistant-skill_mikejgray:_get_device_from_message:198 - INFO - Device ID: light.office_desk_light
mikejgray commented 1 year ago

Regex doesn't seem to be doing the trick. I'll take a look at the filtering you did in the alerts skill.

mikejgray commented 1 year ago

@NeonDaniel I've added the filler words to the intent files, and tests are showing at least 90% confidence of a suitable match. The dev branch has that new code if you want to take it for a spin. Let me know if that doesn't do the trick and I'll look at dropping filler.