totalimmersion / com.somfy.tahoma

Somfy TaHoma app for Homey
GNU General Public License v3.0
10 stars 16 forks source link

Somfy One Alarm #25

Open AdyRock opened 5 years ago

AdyRock commented 5 years ago

Hi Lennart, Do you think it would be possible to add support for the Somfy One Alarm via Tahoma? Here is the JSON from the web site for this:

      {  
         "creationTime":1526998343000,
         "lastUpdateTime":1526998343000,
         "label":"Home",
         "deviceURL":"",
         "shortcut":false,
         "controllableName":"myfox:SomfyProtectAlarmController",
         "definition":{  
            "commands":[  
               {  
                  "commandName":"arm",
                  "nparams":0
               },
               {  
                  "commandName":"disarm",
                  "nparams":0
               },
               {  
                  "commandName":"getName",
                  "nparams":0
               },
               {  
                  "commandName":"partial",
                  "nparams":0
               },
               {  
                  "commandName":"setName",
                  "nparams":1
               },
               {  
                  "commandName":"refreshAlarmStatus",
                  "nparams":0
               },
               {  
                  "commandName":"setAlarmStatus",
                  "nparams":1
               }
            ],
            "states":[  
               {  
                  "values":[  
                     "offline",
                     "online",
                     "uninstalled"
                  ],
                  "type":"DiscreteState",
                  "qualifiedName":"core:CloudDeviceStatusState"
               },
               {  
                  "values":[  
                     "detected",
                     "notDetected"
                  ],
                  "type":"DiscreteState",
                  "qualifiedName":"core:IntrusionState"
               },
               {  
                  "type":"DataState",
                  "qualifiedName":"core:NameState"
               },
               {  
                  "values":[  
                     "armed",
                     "disarmed",
                     "partial"
                  ],
                  "type":"DiscreteState",
                  "qualifiedName":"myfox:AlarmStatusState"
               },
               {  
                  "type":"DataState",
                  "qualifiedName":"myfox:AlertTrespassState"
               }
            ],
            "dataProperties":[  

            ],
            "widgetName":"MyFoxAlarmController",
            "uiClass":"Alarm",
            "qualifiedName":"myfox:SomfyProtectAlarmController",
            "type":"ACTUATOR"
         },
         "states":[  
            {  
               "name":"core:IntrusionState",
               "type":3,
               "value":"false"
            },
            {  
               "name":"core:CloudDeviceStatusState",
               "type":3,
               "value":"online"
            },
            {  
               "name":"myfox:AlarmStatusState",
               "type":3,
               "value":"disarmed"
            },
            {  
               "name":"myfox:AlertTrespassState",
               "type":3,
               "value":"{\"deviceId\":\"site_alarm\",\"sendAt\":\"2018-11-02T10:11:02.000000Z\"}"
            }
         ],
         "attributes":[  

         ],
         "available":true,
         "enabled":true,
         "placeOID":"",
         "widget":"MyFoxAlarmController",
         "type":1,
         "oid":"",
         "uiClass":"Alarm"
      },

Within Tahoma I can get and set the state (off, partial and full). I can also specify actions for blinds. etc when an intrusion is detected so I guess it should have a way to monitor the alarm condition. What I would like to do is set the alarm to partial mode at specified times but only if the current state is off and set it to off at certain times but only if it is partial. Thanks, Adrian.

AdyRock commented 4 years ago

I have added support for the alarm to my local copy of your app. Are you interested in adding this officially if I send you my changes?