iobroker-community-adapters / ioBroker.synology

ioBroker SYNOLOGY Adapter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use sendMethod ?

Sungray opened this issue · comments

I want to use the following method: Disable from category: SYNO.SurveillanceStation.ActionRule

It seems all I can use is the methods in SYNO.SurveillanceStation (i.e. getInfo). I have no way to set the category to ActionRule.

Is that possible?

For instance:
{"method": "getInfo", "params": {}} works but not what I want
{"method": "ActionRule.Disable", "params": {"idList":"1"}} is what I want, but doesn't work
or
{"category": "ActionRule", "method": "Disable", "params": {"idList":"1"}}
but that doesn't exist either

Could also be a global sendMethod with the following params:
{"name": "SurveillanceStation",
"category": "ActionRule",
"version": "1",
"params": {}
}
which would make the most sense, cover all usecases and follow the Synology API definition.

In the current state, sendMethod doesn't seem to offer much capability at all, but maybe I am entirely missing the usage.

Ok when I see the code:
sendMethod uses the name from the state-id where you set the value on ... Thsi means when using synology.0.SurveillanceStation.sendMethod then "name" is automatically set to "SurveillanceStation".

The value is then JSON parsed.

Then it is checked that "method" key exists and it is extracted and send as parameter
And "param" key as sub object is used as parameters

Then calls are done ...

So what does log say when you execute something?

@Sungray have you found any solution on how to send commands?

@spcqike I have not unfortunately, I'm using a workaround using node-red.
exec node:
node /opt/iobroker/node_modules/syno/bin/syno.js -c /opt/userscripts/config.yaml ss enableActionRule --payload '{"idList": "2,3,5", "version":"1"}' --pretty

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

commented

This issue has been automatically closed because of inactivity. Please open a new issue if still relevant and make sure to include all relevant details, logs and reproduction steps. Thank you for your contributions. Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details, Logs und Reproduktionsschritte enthalten sind. Vielen Dank für Eure Unterstützung.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

Reset stale-bot

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.