skydiver / ewelink-api

eWeLink API for JavaScript
https://www.npmjs.com/package/ewelink-api
MIT License
264 stars 108 forks source link

How do I know the type of device (Power meter, thermometer, etc.)? #206

Open ChrisRahme opened 1 year ago

ChrisRahme commented 1 year ago

The productModel field in the device JSON is sometimes helpful to find the type of a device (e.g. NSPanel, Sonoff 4CH).

But sometimes, this field is empty (" ") for different types of products (e.g. temperature sensor and non-Sonoff breakers). Is there any way (besides examining the JSON structure) to know for sure the type of a device?

baugp commented 9 months ago

use method getDevice(id) then check the extra.uiid field. https://coolkit-technologies.github.io/eWeLink-API/#/en/UIIDProtocol https://github.com/skydiver/ewelink-api/blob/master/src/data/devices-type-uuid.json