| Crates.io | homey-energy-dongle |
| lib.rs | homey-energy-dongle |
| version | 0.3.4 |
| created_at | 2025-07-01 13:47:19.602184+00 |
| updated_at | 2025-07-07 13:06:52.809067+00 |
| description | Homey Energy Dongle local API access |
| homepage | |
| repository | https://github.com/twistedfall/homey-energy-dongle |
| max_upload_size | |
| id | 1733238 |
| size | 73,117 |
Support the project | Documentation
Run:
cargo add homey-energy-dongle
Or add to your Cargo.toml:
[dependencies]
homey-energy-dongle = "0.3.4"
Unofficial async implementation of Homey Energy Dongle discovery and local API access. See the support page for details on how to enable it in your dongle.
The crate includes the mDNS discovery with the discover feature and the local API access with the websocket feature. Both
features are disabled by default.
The general workflow with this crate is as follows:
use std::net::SocketAddr;
use std::time::Duration;
use futures_util::{stream, StreamExt};
async fn example() {
let dongles = homey_energy_dongle::discover::discover_devices_with_mdns(Duration::from_secs(5), 0).await.unwrap();
for dongle in dongles {
let addr = dongle.socket_addresses().next().unwrap();
let dongle_buffers = homey_energy_dongle::websocket::WebsocketEnergyDongle::connect(addr, &dongle.path)
.await
.unwrap()
.flat_map(|res| stream::iter(res.ok()));
let mut raw_telegram_reader = homey_energy_dongle::reader::RawTelegramStream::new(dongle_buffers);
while let Some(raw_telegram) = raw_telegram_reader.next().await {
dbg!(&raw_telegram);
}
}
}
MIT OR Apache-2.0