Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy possibility to configure more complex actions (e.g. Shelly) #476

Open
klues opened this issue Jan 28, 2025 · 12 comments
Open

Easy possibility to configure more complex actions (e.g. Shelly) #476

klues opened this issue Jan 28, 2025 · 12 comments

Comments

@klues
Copy link
Contributor

klues commented Jan 28, 2025

It would be nice to have a possibility to define predefined actions which make it easier for users to set up more complex actions. For instance Shelly devices can be easily controlled via the HTTP action, but for non-technical people it's probably still hard to configure them correctly, because you have to look up the correct API calls.

Therefore it would be good to have some kind of predefined action, which gives the user the possibility to choose from a set of predefined actions for a specific device, which then triggers the correct action in the background (in this example an HTTP action, but it could be any other action type). The predefined action only asks for the information needed (e.g. IP address, action type) and all other implicit knowledge (e.g. API URL) is predefined and not visible for the user.

klues added a commit that referenced this issue Jan 28, 2025
klues added a commit to asterics/AsTeRICS-Grid-Boards that referenced this issue Jan 28, 2025
klues added a commit to asterics/AsTeRICS-Grid-Boards that referenced this issue Jan 28, 2025
klues added a commit to asterics/AsTeRICS-Grid-Boards that referenced this issue Jan 28, 2025
…ed actions data, added live json files that's used by AsTeRICS Grid
@klues
Copy link
Contributor Author

klues commented Feb 5, 2025

It's now possible to setup actions for Shelly devices (Plug S and 1PM) quite easily. There is the new action type "Predefined actions", where you can select local or remote (cloud) control of these Shelly devices:

Image

Local control only works on specific browsers or with the special setting "mixed content allowed", cloud control should work everywhere.

@ms-mialingvo and if you @arasaac-dga also want (and have a Shelly device to test available) you can test at https://gridbeta.asterics-foundation.org/ (it's not grid.beta but gridbeta, since this is the https testing version of AsTeRICS Grid, which is relevant for this Shelly interaction).

I know, that it's not optimal that the name for this is "Predefined action", since nobody will find it, if he/she searches for a way to integrate Shelly plugs. However I think this should be improved at some point, where maybe the configurations page for actions is completely redesigned for better usability, maybe with some categorization of actions.

@klues
Copy link
Contributor Author

klues commented Feb 5, 2025

Strings for these new actions can be translated here: https://crowdin.com/project/asterics-grid-boards

The AG Boards repository now also holds the infos about predefined actions, so it will be possible to add new predefined actions (e.g. another Shelly device or any other device with a REST API) without a new release of AG in the future. The new crowdin project may also be used for crowd-translations of the default board sets at some point.

@ms-mialingvo
Copy link
Collaborator

Great! :)
As I don't have wifi at home and only can test at school I'll only be able to test next Monday or Tuesday.

I know, that it's not optimal that the name for this is "Predefined action", since nobody will find it, if he/she searches for a way to integrate Shelly plugs. However I think this should be improved at some point, where maybe the configurations page for actions is completely redesigned for better usability, maybe with some categorization of actions.

Someone who does something more "complex" like using a Shelly Plug will probably check the manual anyway so as long as it's documented there it should be fine for the moment. Maybe just add an info sentence in the http action pointing towards this action if anyone already has been using that and wouldn't check the manual for newer options.

@ms-mialingvo
Copy link
Collaborator

Local control only works on specific browsers or with the special setting "mixed content allowed", cloud control should work everywhere.

What are possible advantages of local control? Because if there aren't any important ones, wouldn't it make sense to allow cloud control only to cause less errors and possible confusion for the users?

klues added a commit that referenced this issue Feb 5, 2025
@klues
Copy link
Contributor Author

klues commented Feb 5, 2025

What are possible advantages of local control? Because if there aren't any important ones, wouldn't it make sense to allow cloud control only to cause less errors and possible confusion for the users?

The advantage is that you don't have to register at Shelly and you're not dependent on their Servers. So it should be definitely possible to configure, however we could make "Cloud control" the first option to select.

@arasaac-dga
Copy link
Collaborator

We have Shelly 2PM in home to controls covers but no Shelly Plug S and 1PM. So we cannot test it. Most of the home automations in our home are with Zigbee. Anyway. It's a great addtion.

@klues
Copy link
Contributor Author

klues commented Feb 6, 2025

I've added Shelly 2PM (I think it's the same, but simply with the additional option to select the channel 0 or 1) - but I cannot test it, since I don't have it.

I've also made "cloud control" the first and "local control" the second option now.

You can test at https://gridbeta.asterics-foundation.org/

@arasaac-dga
Copy link
Collaborator

ok, do you think that works with cover configuration? because in this case is not exactly a switch with 2 channels. Each channel have 2 buttons (one for open cover and another to close).

@klues
Copy link
Contributor Author

klues commented Feb 6, 2025

What do you mean with "cover configuration"? I think Shelly 2PM is the same as 1PM, but with the possiblity to control 2 lamps instead of one:

Image

And as far as I understand the API, you can select between the two lamps with the "channel" attribute (0 or 1).

@arasaac-dga
Copy link
Collaborator

Yes, you can use it to control to switches but nowadays is the best device to control covers with a special configuration that, perhaps, was added on 2PM and in the new 3PM. When you change this configuration change the way in which the device control the 2 channels (one is for open cover and the other to close). But if you press up, for example, the system show you an addtional pause button to stop opening. So, you need 3 buttons. One for open, another for close and another that "create" the system to pause/stop action (when you want thar the cover stop).

I think here is the documentation https://kb.shelly.cloud/knowledge-base/shelly-plus-2-pm-device-smart-control-cover-mode

@klues
Copy link
Contributor Author

klues commented Feb 6, 2025

OK, I understand. To be able to add it, I would need some working HTTP requests / curl commands for controlling locally and via cloud.
Like for the 1PM for the cloud it's curl -X POST "https://shelly-xyz-eu.shelly.cloud/device/relay/control" -d "auth_key=myKEY" -d "id=myID" -d "turn=toggle" -d "channel=0". I'm sure that for the cover mode of 2PM there is also the possibility to control it via the REST API, but I cannot deduce it just from the docs, probably this one: https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Cover/#http-endpoint-rollerid

klues added a commit that referenced this issue Feb 6, 2025
klues added a commit to asterics/AsTeRICS-Grid-Boards that referenced this issue Feb 6, 2025
klues added a commit that referenced this issue Feb 6, 2025
klues added a commit that referenced this issue Feb 6, 2025
@klues
Copy link
Contributor Author

klues commented Feb 6, 2025

Added documentation for predefined actions.

@ms-mialingvo the section about Shelly-specific things probably could/should be moved to the more "tutorial-like" section after reorganizing the manual.

klues added a commit to asterics/AsTeRICS-Grid-Boards that referenced this issue Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants