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

enable/disable system services and settings via API #2182

Closed
proddy opened this issue Nov 6, 2024 · 6 comments
Closed

enable/disable system services and settings via API #2182

proddy opened this issue Nov 6, 2024 · 6 comments
Labels
enhancement New feature or request technical Technical enhancement, or tech-debt issue
Milestone

Comments

@proddy
Copy link
Contributor

proddy commented Nov 6, 2024

Triggered by #2168 two new commands were added in 3.7.1 to control the shower (/api/system/showeralert and /api/system/showertimer).

A more generic approach is to extend the new action command, moving this from /rest/ to a HTTP POST API /api/system so we can use a format like {"action":'enable|disable', param:'ntp|ap|syslog|showeralert...'}.`

This will remove 3 EMS-ESP Commands and free up some memory.

@proddy proddy self-assigned this Nov 6, 2024
@proddy proddy added enhancement New feature or request technical Technical enhancement, or tech-debt issue labels Nov 6, 2024
@proddy
Copy link
Contributor Author

proddy commented Nov 10, 2024

Request to extend this to turn LED on and off as well

#2194

@proddy proddy removed their assignment Nov 10, 2024
@proddy proddy changed the title enable/disable services via API enable/disable system services and settings via API Nov 10, 2024
@MichaelDvP
Copy link
Contributor

If i understand right, the appoach with action is API only and can not used via console or mqtt.
I've made a alternative appoach withing the command structure. Please check and tell what do you think about it.
30fca2a

@proddy
Copy link
Contributor Author

proddy commented Nov 28, 2024

This is a good approach. My idea was to originally move action from /rest to /api and expose it as a new system command called service so it can be called via API, MQTT and the Console via call system action [n]. But this approach is also perfectly fine.

I would only keep things simple and have the cmd be:

showertimer
showeralert
led
analog
mqtt
ntp
ap
syslog
etc....

as this makes it easier for the end user.

and keep to on/off, so remove txmode. Changing that real-time can be dangerous.

@MichaelDvP
Copy link
Contributor

I think the commands should always be the same as api read of the entity. E.g.
api/system/settings/hideled should show (there is a camelCase bug in my dev for writeable):

{
  "name": "hideLed",
  "circuit": "settings",
  "readable": true,
  "writeable": true,
  "visible": true,
  "value": false,
  "type": "boolean"
}

So the command also has to be api/system/settings/hideled with value.
Using different commands does not allow automatisation like thomas do it in his ioBroker adapter:

  • reading the system/info
  • reading system/<path>/<entity>
  • create entities depending on readable/writeable settings

as this makes it easier for the end user.

ot sure, as i implemented the shower settings without prefix the user extected them as settings/showeralert and i have to explain why this is not normal scheme.

@proddy
Copy link
Contributor Author

proddy commented Nov 29, 2024

okay, that actually makes a lot of sense. What do you want me to do next, test?

proddy added a commit that referenced this issue Dec 2, 2024
heatingtypes #2268, pretty telegram, service commands #2182
@proddy
Copy link
Contributor Author

proddy commented Dec 4, 2024

The doc also needs to be updated.

@proddy proddy added this to the v3.7.2 milestone Dec 4, 2024
@proddy proddy closed this as completed Dec 19, 2024
oliof added a commit to oliof/EMS-ESP32 that referenced this issue Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request technical Technical enhancement, or tech-debt issue
Projects
None yet
Development

No branches or pull requests

2 participants