akipta / freedomotic

Automatically exported from code.google.com/p/freedomotic
Other
0 stars 0 forks source link

Implement human readable aliases related to behaviors values #170

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Describe the aim of the proposed feature?
This way human meaningful values can be used in automations, for example with a 
TTS plugin. An alias can be retrived in automations using 
@event.object.powered.alias. This will output "on" or "off" instead of "true" 
or "false" using @event.object.powered

This way is possible to make TTS plugin say "the kitchen light is on" instead 
of the unuseful "the kitchen light is true"

Describe how you would implement this feature
This must be discussed on the forum

List external resources that can be useful

How much you feel this feature will be useful for the project?

[ ] Optional
[ ] Usefull
[X] Can make the difference
[ ] Necessary

Original issue reported on code.google.com by enrico.n...@gmail.com on 2 Sep 2012 at 8:59

GoogleCodeExporter commented 9 years ago
This feature should also take into account internationalization and location.
Maybe one aproach is to allow the user to configure through the xml the 
"mean-full" value.
Some ideas:

    <it.freedomotic.model.object.BooleanBehavior>
      <name>powered</name>
      <description></description>
      <active>true</active>
      <priority>-1</priority>
      <value>false</value>
      <alias>on,off</alias>
    </it.freedomotic.model.object.BooleanBehavior>

<it.freedom.model.object.ListBehavior>
      <name>input</name>
      <description>TV input selected</description>
      <active>true</active>
      <priority>-1</priority>
      <selected>1</selected>
      <list>
        <string>Input 1</string>
        <alias>TV</alias>
        <string>Input 2</string>
        <alias>Ps3</alias>
        <string>Input 3</string>
        <alias>XBOX</alias>
        <string>Input 4</string>
        <alias>PVR</alias>
        <string>Input 5</string>
        <string>Input 6(PC)</string>
      </list>
    </it.freedom.model.object.ListBehavior>

However this would make the configuration more difficult. So maybe instead of 
this we could use a "global" translation file. There are some examples and 
formats available. This way anytime a string must be "translated" is used as a 
key for the "translation" file to retrieve the correct "value".

Moved to the 5.5 roadmap

Original comment by gabriel....@gmail.com on 22 Oct 2012 at 6:26

GoogleCodeExporter commented 9 years ago
another way is to implement an AliasBehavior which is a read-only behavior with 
a map: value-> alias string
this way we don't need to touch any behavior adding alias field.
Question: what to do with ranged behaviors? It will be good to allow something 
like this:
-20 to 0: freezing
0 to 10: cold
10 to 15: quite cold
15 to 20: almost comfortable
20 to 24: comfortable
24 to 27: hot
27 to ...: very hot

this would be very usefull for example with text to speech. How is the 
temperature outside? Outside is quite cold now

Original comment by enrico.n...@gmail.com on 22 Oct 2012 at 8:18

GoogleCodeExporter commented 9 years ago

Original comment by enrico.n...@gmail.com on 28 Oct 2012 at 7:27

GoogleCodeExporter commented 9 years ago
Just an idea for the future (it's feasibility must be widely discussed): what 
if we define the behaviors alias as a fuzzy membership function? 

a basic example for temperature alias definition:
http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/Fuzzy_logic_temperature
_en.svg/300px-Fuzzy_logic_temperature_en.svg.png

taken from http://en.wikipedia.org/wiki/Fuzzy_logic

University of Salerno (Italy) have developed also a FML (fuzzy markup language) 
we can embedd in our objects definitions
http://en.wikipedia.org/wiki/Fuzzy_markup_language

Original comment by enrico.n...@gmail.com on 16 Nov 2012 at 3:47

GoogleCodeExporter commented 9 years ago
About FLM I found a tool to test the language 
http://www.corisa.it/fml/Download_files/VisualFMLTool%200.1.rar
We should open a topic on the groups to discuss about it and involve more 
people. 

Original comment by virtualc...@gmail.com on 24 Nov 2012 at 11:15