Mycroft Community Forum

My padatious entity files are being ignored. Help!

I am writing a skill to turn some lights on/off.

My intent file contains the line:

(switch | turn) the {{name}} light {{state}}
(switch | turn) {{name}} light {{state}}
(switch | turn) {{name}} {{state}}

I have a file called state.entity:

on
off

I also have a file called name.entity:

lounge
hall

My skill includes the code:

@intent_handler(‘lights.shelly.intent’)
def handle_lights_shelly(self, message):
name = message.data.get(‘name’)
state = message.data.get(‘state’)

If I say “turn the lounge light red”, the variable state contains “red”. Likewise, if I say “turn bathroom light on”, the variable name contains “bathroom”. Why is Mycroft ignoring my entity files?

Seems like I need to register the entity files in my initiaze(), using the self.register_entity_file API. Now it works as intended.

1 Like

Hey thanks for flagging this - the entity file registration was completely missing from the documentation!!!