ioBroker.alexa2 icon indicating copy to clipboard operation
ioBroker.alexa2 copied to clipboard

Routinen aktivieren und deaktivieren (nicht starten)

Open ds-1982 opened this issue 4 years ago • 4 comments

Hallo!

In der AlexaApp ist es möglich Routinen zu aktivieren bzw. zu deaktivieren. Ist das eventuell auch mit dem Adapter umsetzbar?

Ich habe verschiedene Routinen die in Abhängigkeiten aktiv und inaktiv geschaltet werden, zum Beispiel: Gäste Anwesend -> Routine 1 aktiv, Routine 2 inaktiv Gäste Abwesend -> Routine 2 aktiv, Routine 1 inaktiv Bisher habe ich nur den Weg über die App gefunden. Es gibt wohl auch keinen Sprachbefehl dafür.

ds-1982 avatar Nov 06 '20 08:11 ds-1982

This is a bigger thing because it requires a restructing of the Reotine objects from one start to have the state as folder and add sustates and somehow backward compatible

Apollon77 avatar Dec 10 '20 23:12 Apollon77

Effektiv geht es, ABER der Status wird im zweifel nicht in sync sein, weil änderungen in der App nicht an den Adapter gesynct werden können.

Generell:

  • lesen mittels automationID via GET /api/behaviors/automations/amzn1.alexa.automation.119df83f-96f3-463e-bc37-a55dc08900ce HTTP/1.1
  • dann PUT /api/behaviors/automations/amzn1.alexa.automation.119df83f-96f3-463e-bc37-a55dc08900ce HTTP/1.1 , ABER angepasster content ...
{"behaviorId":"amzn1.alexa.automation.119df83f-96f3-463e-bc37-a55dc08900ce","triggerJson":"{\"@type\":\"com.amazon.alexa.behaviors.model.Trigger\",\"id\":\"amzn1.alexa.trigger.23341711-1aed-483b-8a37-0187691829b8\",\"skillId\":\"amzn1.ask.1p.customutterance\",\"type\":\"CustomUtterance\",\"payload\":\"{\\\"locale\\\":\\\"de-DE\\\",\\\"marketplaceId\\\":\\\"A1PA6795UKMFR9\\\",\\\"utterance\\\":\\\"hubel bubel\\\",\\\"customerId\\\":\\\"A3NSX4MMJVG96V\\\",\\\"@type\\\":\\\"com.amazon.alexa.behaviors.model.CustomUtteranceTriggerPayload\\\"}\"}","sequenceJson":"{\"@type\":\"com.amazon.alexa.behaviors.model.Sequence\",\"startNode\":{\"@type\":\"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\",\"type\":\"Alexa.Speak\",\"skillId\":\"amzn1.ask.1p.saysomething\",\"operationPayload\":{\"deviceType\":\"ALEXA_CURRENT_DEVICE_TYPE\",\"customerId\":\"A3NSX4MMJVG96V\",\"textToSpeak\":\"ha ha\",\"locale\":\"de-DE\",\"deviceSerialNumber\":\"ALEXA_CURRENT_DSN\"}}}","status":"DISABLED"}

Apollon77 avatar Jan 30 '21 22:01 Apollon77

This one is not that easy after I looked again into it ....

1.) As said the JSON for the call is not the same es it was requested before, so I need to recreate that in the other format ... no idea if this will be possible that easiely because all cases needs to be found out 2.) It will be a breaking change because for now a routine only is a state ... then we need to convert that into a channel having multiple states ...(but issue 1 is bigger :-) )

So needs to stay here as idea ...

Apollon77 avatar Jul 09 '22 11:07 Apollon77

I collected more infos in https://github.com/Apollon77/alexa-remote/issues/187

I decdided against this for now (might change later) because risk is too high that we destroy routines because the "recoding" is not handling all cases. Especially over time when Amazon adjust stuff on their side or adds new options.

Apollon77 avatar Jul 22 '22 08:07 Apollon77