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

Call read commands from Web #2116

Closed
proddy opened this issue Oct 20, 2024 · 10 comments
Closed

Call read commands from Web #2116

proddy opened this issue Oct 20, 2024 · 10 comments
Labels
enhancement New feature or request
Milestone

Comments

@proddy
Copy link
Contributor

proddy commented Oct 20, 2024

This has been discussed before and not implemented in favour of the send command, but I still think it's useful for novice users.

I've added a new setting in Application Settings called Developer Mode which we can use to expose more advanced/debug/developer type features. When enabled you'll get a new command icon in the Web Log where you can send write commands like:

image

proddy added a commit to proddy/EMS-ESP32 that referenced this issue Oct 20, 2024
@Delta1977
Copy link

great feature.
i have another Idea:
It would be great if we could do this also via api or mqtt or is this also implemented?

@proddy
Copy link
Contributor Author

proddy commented Oct 21, 2024

great feature. i have another Idea: It would be great if we could do this also via api or mqtt or is this also implemented?

Yes, it is possible now. It's a new system command called read so you can call it via API and MQTT. Like:

curl -X POST \
    -H "Authorization: Bearer ${emsesp_token}" \
    -H "Content-Type: application/json" \
    -d '{"data":"8 2"}' \
    ${emsesp_url}/api/system/read

and MQTT with:
topic = ems-esp/system/read
payload = 8 2

@Delta1977
Copy link

Very cool. Thank you

proddy added a commit that referenced this issue Oct 22, 2024
Developer Mode and send EMS Read Commands from WebUI - #2116
@Delta1977
Copy link

@proddy i tested the MQTT Variant and the Output is logged in EMS-ESP Log, but no return via mqtt.
is a Mqtt-feedback planned?
Maybe we can publish the complete Logs via MQTT in an logging Topic.

@proddy proddy added this to the v3.7.0 milestone Oct 22, 2024
@proddy proddy added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Oct 22, 2024
@proddy proddy closed this as completed Oct 22, 2024
@proddy
Copy link
Contributor Author

proddy commented Oct 22, 2024

@Delta1977 log output isn't sent over MQTT, it wouldn't be very useful as each log line would be replaced every second and unless you're quick enough to catch it you'll miss half the logs. We use the SysLog protocol for that as it's designed for that. Alternatively, you could tap into the SSE event source, which is over HTTP.

The idea of this feature is for novice users to type in a simple read command, then watch the single line output, copy & paste into GitHub for the developers to work on.

@VlastiBroucek
Copy link

I am using 3.7.1-dev.2 and it is not working. Tried it in Edge, Chrome and Firefox on both Windows and in KALI Linux

@proddy
Copy link
Contributor Author

proddy commented Nov 3, 2024

I am using 3.7.1-dev.2 and it is not working. Tried it in Edge, Chrome and Firefox on both Windows and in KALI Linux

can you be more specific? what doesn't work? what happens? what do you see?

@VlastiBroucek
Copy link

VlastiBroucek commented Nov 3, 2024 via email

@proddy
Copy link
Contributor Author

proddy commented Nov 3, 2024

try just '18 6'

@VlastiBroucek
Copy link

VlastiBroucek commented Nov 3, 2024

Oh, that works... I was expecting it will be like everywhere else...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants