Coder Social home page Coder Social logo

Comments (6)

digitaldan avatar digitaldan commented on August 15, 2024

Agreed, that would be cool

from openhab-alexa.

digitaldan avatar digitaldan commented on August 15, 2024

So i have started thinking about this one, my thoughts so far as sample items would be:

Group  TestAlarm "Alarm" {alexa="SecurityPanelController"}
String TestAlarmModeCommand "Alarm"  (TestAlarm) { alexa="SecurityPanelController.command" [ARMED_AWAY="away",ARMED_STAY="stay",ARMED_NIGHT="night",DISARMED="disarm",pinSupport=true,supportsArmInstant=true] }
String TestAlarmModeState "Alarm"  (TestAlarm) { alexa="SecurityPanelController.armState" [ARMED_AWAY="away",ARMED_STAY="stay",ARMED_NIGHT="night",DISARMED="disarm"] }
Switch TestAlarmBurglaryAlarm "Burglary in Alarm" (TestAlarm) {alexa="SecurityPanelController.burglaryAlarm"}
Switch TestAlarmFireAlarm "FIre in Alarm" (TestAlarm) {alexa="SecurityPanelController.fireyAlarm"}
Switch TestAlarmCarbonMonoxideAlarm "Carbon Monoxide in Alarm" (TestAlarm) {alexa="SecurityPanelController.carbonMonoxideAlarm"}
Switch TestAlarmWwaterAlarm "Water in Alarm" (TestAlarm) {alexa="SecurityPanelController.waterAlarm"}
Number TestAlarmExitDelayInSeconds "Exit Delay In Seconds" (TestAlarm) {alexa="SecurityPanelController.exitDelayInSeconds"}

@jsetton didn't know if you had started working on this, I have a rough sketch out of the capabilities and properties, but not much more at this point.

For pin support when sending a command, I was thinking we could append the pin to the command if enabled, so when arming we would send "away:1234" as a string. If there is a better idea, i'm all ears :-)

from openhab-alexa.

jsetton avatar jsetton commented on August 15, 2024

Since you had this one assigned to yourself, I left that one last 😄 I was going to aim at range, toggle and time hold capabilities next.

Your sketch looks good. A couple things to note:

  • The group endpoint needs to match the display category. Strange enough, the main documentation that lists all their existing categories isn't up to date. Anyway, the category for this one is SECURITY_PANEL. So, the endpoint group should be Endpoint.SecurityPanel and we will need to add camel case reformatting when handling a group category.

  • To handle the difference between alarm mode command and state, we should use the item sensor concept (end of section) I added to accomplish that type of scenario instead of creating an extra non-documented property. This is similar to lock control. Not every users may have two different channels to get current state. So using that concept gives that flexibility.

  • For the arm mode, we should probably allow Number item type as well similar to thermostat mode support (e.g. [DISARMED=0, ARMED_STAY=1, ARMED_AWAY=2, ARMED_NIGHT=3]).

  • In regards to the pin code support, I am fine with the format but we would only allow it for String item type. I would also call the parameter supportsPinCodes for consistency purpose.

  • For the exit delay workflow, having two separate items will be a pain in the current workflow and also cost an extra rest call. I think we should have a parameter with the delay amount such as exitDelay=<delay> and will probably need to append the delay value to the command <mode>:<delay>:<pin>. Again, this would only be supported with String item type. The delay would be determined as directive.payload.isArmInstant == true ? 0 : (parameter.exitDelay || 0)

Here is my revise sketch:

Group  TestAlarm "Alarm" {alexa="SecurityPanel"}
String TestAlarmMode "Alarm"  (TestAlarm) {alexa="SecurityPanelController.armState" [ARMED_AWAY="away",ARMED_STAY="stay",ARMED_NIGHT="night",DISARMED="disarm",exitDelay=300,supportsArmInstant=true,supportsPinCodes=true,itemSensor="TestAlarmModeStatus"]}
String TestAlarmModeStatus "Alarm Status"  (TestAlarm)
Switch TestAlarmBurglaryAlarm "Burglary in Alarm" (TestAlarm) {alexa="SecurityPanelController.burglaryAlarm"}
Switch TestAlarmFireAlarm "Fire in Alarm" (TestAlarm) {alexa="SecurityPanelController.fireAlarm"}
Switch TestAlarmCarbonMonoxideAlarm "Carbon Monoxide in Alarm" (TestAlarm) {alexa="SecurityPanelController.carbonMonoxideAlarm"}
Switch TestAlarmWaterAlarm "Water in Alarm" (TestAlarm) {alexa="SecurityPanelController.waterAlarm"}

from openhab-alexa.

digitaldan avatar digitaldan commented on August 15, 2024

Thank @jsetton for the feedback, going to work on this today.

from openhab-alexa.

jsetton avatar jsetton commented on August 15, 2024

At this point, I would say you should wait for my refactoring PR. Although you can start thinking about the logic 😄 but a lot of the enhancement I added will make this very easy to implement. I am aiming to get the PR out by the end of the day.

from openhab-alexa.

digitaldan avatar digitaldan commented on August 15, 2024

Sounds good, I definitely have other things to work on. If you already have this thought through or think it would be easier for you to incorporate , feel free to take it.

from openhab-alexa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.