Closed jcherrabi closed 3 years ago
Hi,
Nice thing to hear :)
Unfortunately there are no articles or docs. I guess best way to get started would be to have a look at the js files of devices that already exist (in lib/devices
). The js files for properties are placed in the folder lib/properties
; There you can find general purpose properties (directly in the root folder) as well as device specific properties (e.g. for the colour light). These scripts can basically use all features of NodeJS.
In general, there are 3 places you have to make changes to in order to add a new device type:
manifest.json
(required for the device type to show up in the gateway)lib/devices
(have a look at lib/devices/switch-device.js
for a very basic example)lib/adapter.js
On a more hardware level, each tuya device has certain dps channels (identified through numbers; simply set the device type of one of your devices to (empty) in the add-on settings in order to have a look at these). These usually represent a single property, e.g. on/off or brightness. The very basic goal of a device js is to map the properties to the right dps channels.
Best regards
plug with power statistics
has been added by #12
Created CONTRIBUTING.md
. Closing this issue.
Hello there, thank you for creating and sharing this add on. i have the following questions please:
i have many tuya compatible devices and would like to start adding those to the list.. for example a camera, vacuum robot, plug with power statistics and so on...
cheers,