Snips HA HaassLightSet

Hello,

I have snips running on a pi3 B+ with the home assistant intent skill.
For the lights, there are three main intents that are applicable in the skill:
HassTurnOn
HassTurnOff
HassLightSet

HassTurnOn and HassTurnOff are working very well.

HassLightSet is not working at all. It supports brightness (expressed as a percentage) and color (expressed as a color name text value).

I get home-assistant.log errors when I try to change either brightness or color. The color or brightness at the light does not change. The errors are the same for both brightness and color change.

Jun 24 11:27:27 HomeAuto hass[28582]: #033[33m2018-06-24 11:27:27 WARNING (MainThread) [homeassistant.helpers.intent] Received invalid slot info for HassLightSet: extra keys not allowed @ data[‘light’]#033[0m
Jun 24 11:27:27 HomeAuto hass[28582]: #033[31m2018-06-24 11:27:27 ERROR (MainThread) [homeassistant.components.snips] Error while handling intent: HassLightSet.#033[0m
Jun 24 11:27:27 HomeAuto hass[28582]: Traceback (most recent call last):
Jun 24 11:27:27 HomeAuto hass[28582]: File “/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/intent.py”, line 59, in async_handle
Jun 24 11:27:27 HomeAuto hass[28582]: result = await handler.async_handle(intent)
Jun 24 11:27:27 HomeAuto hass[28582]: File “/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/init.py”, line 271, in async_handle
Jun 24 11:27:27 HomeAuto hass[28582]: slots = self.async_validate_slots(intent_obj.slots)
Jun 24 11:27:27 HomeAuto hass[28582]: File “/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/intent.py”, line 142, in async_validate_slots
Jun 24 11:27:27 HomeAuto hass[28582]: return self._slot_schema(slots)
Jun 24 11:27:27 HomeAuto hass[28582]: File “/home/homeassistant/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 267, in call
Jun 24 11:27:27 HomeAuto hass[28582]: return self._compiled(, data)
Jun 24 11:27:27 HomeAuto hass[28582]: File “/home/homeassistant/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 587, in validate_dict
Jun 24 11:27:27 HomeAuto hass[28582]: return base_validate(path, iteritems(data), out)
Jun 24 11:27:27 HomeAuto hass[28582]: File “/home/homeassistant/homeassistant/lib/python3.5/site-packages/voluptuous/schema_builder.py”, line 425, in validate_mapping
Jun 24 11:27:27 HomeAuto hass[28582]: raise er.MultipleInvalid(errors)
Jun 24 11:27:27 HomeAuto hass[28582]: voluptuous.error.MultipleInvalid: extra keys not allowed @ data[‘light’]
Jun 24 11:27:27 HomeAuto hass[28582]: The above exception was the direct cause of the following exception:
Jun 24 11:27:27 HomeAuto hass[28582]: Traceback (most recent call last):
Jun 24 11:27:27 HomeAuto hass[28582]: File “/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/components/snips.py”, line 101, in message_received
Jun 24 11:27:27 HomeAuto hass[28582]: hass, DOMAIN, intent_type, slots, request[‘input’])
Jun 24 11:27:27 HomeAuto hass[28582]: File “/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/intent.py”, line 65, in async_handle
Jun 24 11:27:27 HomeAuto hass[28582]: ‘Received invalid slot info for {}’.format(intent_type)) from err
Jun 24 11:27:27 HomeAuto hass[28582]: homeassistant.helpers.intent.InvalidSlotInfo: Received invalid slot info for HassLightSet#033

Here is the MQTT sent from snips to HA for a color change;

hermes/intent/hass:HassLightSet
{“sessionId”:“ffad5a63-5840-4d70-8a3d-dfefcba00f65”,
“customData”:null,
“siteId”:“default”,
“input”:“set kitchen to blue”,“intent”:{“intentName”:“hass:HassLightSet”,“probability”:1.0},
“slots”:[{“rawValue”:“kitchen”,“value”:{“kind”:“Custom”,“value”:“kitchen”},“range”:{“start”:0,“end”:7},“entity”:“light”,“slotName”:“light”},
{“rawValue”:“blue”,“value”:{“kind”:“Custom”,“value”:“Blue”},“range”:{“start”:8,“end”:12},“entity”:“color”,“slotName”:“color”}]}

Here is the MQTT sent from snips to HA for a brightness change;

hermes/intent/hass:HassLightSet
{“sessionId”:“7e9960f5-40ef-46bb-95b9-801b05a48866”,
“customData”:null,
“siteId”:“default”,
“input”:“kitchen brightness fifty percent”,“intent”:{“intentName”:“hass:HassLightSet”,“probability”:0.9597607},
“slots”:[{“rawValue”:“kitchen”,“value”:{“kind”:“Custom”,“value”:“kitchen,”},“range”:{“start”:0,“end”:7},“entity”:“light”,“slotName”:“light”},
{“rawValue”:“fifty percent”,“value”:{“kind”:“Percentage”,“value”:50.0},“range”:{“start”:20,“end”:33},“entity”:“snips/percentage”,“slotName”:“brightness”}]}

Setting the light brightness and color would be great (and enhance the WAF). In the future I hope we could implement an effect slot also.
I have tried everything I know how to do. The MQTT looks correct from what I can tell. Any help would be much appreciated!

Got it working. Added light effects for the supported lights by modifying light component init.py. The lights now work by voice control with Snips.
HassLightSet
- color
- brightness
- effect

@lightmind Would you mind sharing this? I am new to this intent stuff and dunno where to start.

Would be wesome :slight_smile: