Open scottsweb opened 5 years ago
Hey Scott, thanks for the clear and detailed outline.
We don't currently have a team member actively working on this Skill as we've got the whole team focused on the Mark II, but this will be useful for whoever picks it up. Whether that's a team member or someone from the broader Community.
One small question, when you said:
For example
turn on hot water
, gets picked up asturned on hot water cancel
.
Do you mean the STT transcribes the utterance incorrectly?
Thanks for the reply @krisgesling. From the logs it looks like the STT transcribes correctly, it is just the skills interpretation that is wrong - or at least a little unexpected. I have noticed in that second example I can say turn on hot water 30 mins
and it will find the correct switch. Looking at my config there are two names configured for that particular switch:
https://github.com/scottsweb/ham/blob/master/homeassistant/customize.yaml#L150-L151
It used to be the case that the emulated hue name was used (old home assistant skill), now it seems to be the friendly name.
It looks like the issue here is that 'lounge' is not recognized as an entity. We can see that from the intent type: IoTRequestWithEntityOrThing
. If lounge was an entity, the intent would be an IoTRequestWithEntityAndThing
- note the And
instead of the Or
(the 'Thing' is the light, which it picks up correctly). See https://github.com/MycroftAI/skill-iot-control/blob/master/__init__.py#L107-L122.
The is further evidenced by the behavior when you say "Turn off lounge" - it only works because of the fallback. Adapt doesn't even send it to the IoT control skill, because "turn off" doesn't match without an entity or thing included in the utterance, and 'lounge' isn't recognized.
This issue should be closed here, and opened on the Home Assistant skill - if Home Assistant registers "lounge" as an entity, this would work (you could test this by hard coding ["lounge"]
as the result of the get_entities
method in the Home Assistant skill). My guess would be the Home Assistant API changed and/or was augmented, and the skill just needs to be updated to account for that and pick up all the entities.
It would also need to be updated to account for:
Not passing an entity ID to a service to target all entities is deprecated. Update your call to light.turn_on to be instead: entity_id: all
I am testing this with the Home Assistant skill on the
commonIot
branch and things are working quite well. Unfortunately there are certain devices that are not picked up correctly. A good example is a Home Assistant group/switch calledLounge Lights
. This skill seems to attempt to interpret the event as just 'lights'. From the logs:Home Assistant itself is not overly happy with the request:
It seems to work if I ask
turn on lounge
(without thelights
on the end), but it seems to use older code in the Home Assistant skill - the command is confirmed with a reply,turned lounge lights on
rather than the new confirmationbeep
.Although this worked on this occasion, generally when mycroft falls back to
fallback-unknown.mycroftai
for Home Assistant, the wrong device gets switched. For exampleturn on hot water
, gets picked up asturned on hot water cancel
.This didn't used to be an issue on the old 18 branch of Mycroft with the older Home Assistant skill.