I put your file in an intent file, with at the end:
allume (dans | de la | du) (le | la) ($house_room){house_room} [pendant | durant] (<number> <duration>){duration}
And it works !
I got the right intent, with slot duration and house_room !!
Now, duration slot returned is “dix minutes”, we would need to get duration slot in intent always in same unit and as a number. Here it should be just “10”, if we ask two hours, it should be “120”, etc. Or in second to be more precise, and only later in handling the intent we do the conversion we need. But duration must be a float or int.
I guess rhasspy should intercept duration slot and convert all years, months, weeks etc to a number.
Anyway, can’t get these rules to work when separated in another file.
/slots/mathSlots
[mathSlots]
# Number
two_to_nine = ( deux | trois | quatre | cinq | six | sept | huit | neuf )
....
then in an intent:
[LightTimeOnJeedom]
allume (dans | de la | du) (le | la) ($house_room){house_room} [pendant | durant] (<mathSlots.number> <mathSlots.duration>){duration}
got error line 135, in walk_expression for item in replacements[key]: KeyError: ‘<number>’
Ok, one year later, does duration slot have evolved ?
Can we get an entity with duration.years, quarters, months, weeks, days, jours, minutes, seconds ?
With like ( ){duration} ? I retried this with rhasspy 2.5.8, doesn’t seems to work.
This works in sentences: quel jour [était on | étions nous] [il y a] [(1..52){duration_years} ans] [et] [(1..52){duration_weeks} semaines] [et] [(1..31){duration_days} jours] [avant]
but then I have to get every possible slot combination in my skill. And construct sentences isn’t easy and quite limiting.
Sorry, have been off of rhasspy for a while, trying to set it back on with all last evolutions.