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

Add support for Shelly 3EM & 3EM-PRO #5

Open
gmoscalu opened this issue Nov 25, 2023 · 2 comments
Open

Add support for Shelly 3EM & 3EM-PRO #5

gmoscalu opened this issue Nov 25, 2023 · 2 comments

Comments

@gmoscalu
Copy link

gmoscalu commented Nov 25, 2023

Hi,

I tested the exporter on a Shelly 3EM & a Shelly 3EM PRO.

For the 3EM, i got :

root@Ubuntu-Tools:~# curl -s "http://localhost:7978/probe?target=10.10.200.40"
# HELP shelly_api_status_latency_ms Request latency for the status API in milliseconds
# TYPE shelly_api_status_latency_ms gauge
shelly_api_status_latency_ms{device="485519D74AEF"} 38
# HELP shelly_bat Show the current battery status in percentage
# TYPE shelly_bat gauge
shelly_bat{device="485519D74AEF"} 0
# HELP shelly_cloud_connected Whether the device is connected to Shelly Cloud
# TYPE shelly_cloud_connected gauge
shelly_cloud_connected{device="485519D74AEF"} 1
# HELP shelly_cloud_enabled Whether the device has Shelly Cloud enabled
# TYPE shelly_cloud_enabled gauge
shelly_cloud_enabled{device="485519D74AEF"} 1
# HELP shelly_filesystem_free_kb Amount of free filesystem space on device in kilobytes
# TYPE shelly_filesystem_free_kb gauge
shelly_filesystem_free_kb{device="485519D74AEF"} 155118
# HELP shelly_filesystem_total_kb Amount of total filesystem space on device in kilobytes
# TYPE shelly_filesystem_total_kb gauge
shelly_filesystem_total_kb{device="485519D74AEF"} 233681
# HELP shelly_memory_free_kb Amount of free memory on device in kilobytes
# TYPE shelly_memory_free_kb gauge
shelly_memory_free_kb{device="485519D74AEF"} 32420
# HELP shelly_memory_total_kb Amount of total memory on device in kilobytes
# TYPE shelly_memory_total_kb gauge
shelly_memory_total_kb{device="485519D74AEF"} 49920
# HELP shelly_mqtt_connected Whether the device is connected to MQTT
# TYPE shelly_mqtt_connected gauge
shelly_mqtt_connected{device="485519D74AEF"} 0
# HELP shelly_relay_on Whether the channel is turned ON or OFF
# TYPE shelly_relay_on gauge
shelly_relay_on{device="485519D74AEF",relay="0"} 1
# HELP shelly_update_available Whether the device has a firmware update available
# TYPE shelly_update_available gauge
shelly_update_available{device="485519D74AEF"} 0
# HELP shelly_uptime_seconds Uptime of the device in seconds
# TYPE shelly_uptime_seconds gauge
shelly_uptime_seconds{device="485519D74AEF"} 6196
root@Ubuntu-Tools:~#

For the 3EM PRO, i get nothing:

root@Ubuntu-Tools:~# curl -s "http://localhost:7978/probe?target=10.10.200.41"
root@Ubuntu-Tools:~# 

From POSTMAN, i get the following returns from the devices:
20231125-Shelly_3EM.txt
20231125-Shelly_3EM_PRO.txt

I have no idea how to adjust this code to make it work, can you help?

FYI, to test it, i used:

root@Ubuntu-Tools:~# docker pull ghcr.io/ianunruh/shelly-exporter:main
main: Pulling from ianunruh/shelly-exporter
5c7808093659: Pull complete
c8e21b145cca: Pull complete
Digest: sha256:70f0a8362043bc4f90ab34a58396d8537ad81d75a3ba2af090a5c3567d70340f
Status: Downloaded newer image for ghcr.io/ianunruh/shelly-exporter:main
ghcr.io/ianunruh/shelly-exporter:main
root@Ubuntu-Tools:~#

Then from portainer, i created a container from the image & exposed ports 7978->9090 and it seems to be working, but the energy data is not captured.

Thanks,
Gabriel

@ianunruh
Copy link
Owner

Looks like the 3EM uses the Gen1 API, which 3EM Pro uses the Gen2 API.

https://shelly-api-docs.shelly.cloud/gen2/Devices/ShellyPro3EM/

I'll look at what it takes to add support for the new version. Thank you for providing the output from the 3EM Pro.

@gmoscalu
Copy link
Author

gmoscalu commented Dec 4, 2023

@ianunruh,

While at it, please note that no power/energy/current/voltage measurement is returned for the 3EM either, just the memory and filesystem is returned...

I can't say why. Maybe you can have a look as well.

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

2 participants