diff --git a/docs/auto_configure.md b/docs/auto_configure.md
new file mode 100644
index 000000000..cf6d7a864
--- /dev/null
+++ b/docs/auto_configure.md
@@ -0,0 +1,88 @@
+# Auto configure devices
+Localtuya can disocver you device entities if cloud is enable because the feature at the moment rely on `DP code` and [Devices Category](https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq#title-6-List%20of%20category%20code).
+
+By known the `category` we use that to get all the possible entities from stored data.
Data stored in `/localtuya/core/tuya_devices` (1)
+{.annotate}
+
+1. Files named with entity type
![](/images/dev/tuya_devices_dir.png)
+
+??? info "DPCodes data"
+ All known `Codes` are stored in `base.py` in `DPCode Class`.
+ If class doesn't contains your `DPCode` Add it, `DPCode class sorted in alphabetically`.
+
+
+!!! tip annotate "How to get the `Codes and DP`"
+ You can download your devices data from HA using `Download diagnostics`
+
+ 1. Download device diagnostics `localtuya` from device page. (1) `file -> device_cloud_info`
+ 2. Download entry diagnostics `note: contains all devices data` (2) `file -> cloud_devices`
+
+ Inside downloaded `txt file`, in `cloud_data object` look for your `device -> dps_data`
+
+1. ![](/images/dev/device_diagnostics.png)
+2. ![](/images/dev/entry_diagnostics.png)
+
+__Now that we know the device `category` and `Codes` we can start add the entities.__
+
+In `/localtuya/core/tuya_devices` open the file named with `entity type` you want to add.
+All files contain `constant dict` contains all known `categories` (1).
+Look for the `category` modify if it existed then add the missing `entity`.
+{.annotate}
+
+1. e.g `COVERS or SWITCHES`
+
+Using `LocalTuyaEntity class` we pass entity parameters and `DP Fields names` DP Keys has to be supported by `localtuya` (1)
+{.annotate}
+
+1. All entities has `id` key. but some has mode dp fields
For example: `cover platforms` has config keys for `current_position_dp` and `set_position_dp`
+
+
+# Examples
+
+
+
+??? example "Add `code: switch_4` into `SWITCHES` `kg` category"
+ ```python
+ "kg": (
+ LocalTuyaEntity(
+ id=DPCode.SWITCH_4, # REQUIRED: id config look for code `switch_4`
+ name="Switch 4", # name the entity: `Switch 4`
+ icon="mdi:icon_name", # icon of the entity
+ entity_category=EntityCategory.CONFIG, # show entity in this category
+ ),
+ ),
+ ```
+
+??? example "Add `switch` into `SWITCHES` `cl` category: with condition"
+ ```python
+ "cl": (
+ LocalTuyaEntity(
+ id=DPCode.CONTROL_BACK,
+ name="Reverse",
+ icon="mdi:swap-horizontal",
+ entity_category=EntityCategory.CONFIG,
+ condition_contains_any=["true", "false"],
+ ),
+ ),
+ ```
+
+
+
+??? example "Add `cover` into `COVERS` `cl` category"
+ ```python
+ "cl": (
+ LocalTuyaEntity(
+ id=DPCode.CONTROL,
+ name="Curtain",
+ custom_configs=localtuya_cover("open_close_stop", "position"), # localtuya config
+ current_state=DPCode.SITUATION_SET,
+ current_position_dp=(DPCode.PERCENT_CONTROL, DPCode.PERCENT_STATE),#(1)!
+ set_position_dp=DPCode.PERCENT_CONTROL,
+ ),
+ ),
+ ```
+
+ 1. current_position_dp will search two possible codes and will take the first `DP` found.
+
+
+
diff --git a/docs/cloud_api.md b/docs/cloud_api.md
new file mode 100644
index 000000000..aac49c343
--- /dev/null
+++ b/docs/cloud_api.md
@@ -0,0 +1,111 @@
+# Cloud API Setup
+
+The Tuya integration integrates all Powered by Tuya devices you have added to the Tuya Smart and Tuya Smart Life apps.
+
+!!! note
+ `LocalTuya` uses cloud only to get your devices data to make configure devices much easier.
+
+## Configuration of the Tuya IoT Platform
+
+### Prerequisites
+
+- Your devices need first to be added in the [Tuya Smart or Smart Life app](https://developer.tuya.com/docs/iot/tuya-smart-app-smart-life-app-advantages?id=K989rqa49rluq#title-1-Download).
+- You will also need to create an account in the [Tuya IoT Platform](https://iot.tuya.com/).
+This is a separate account from the one you made for the app. You cannot log in with your app's credentials.
+
+### Create a project
+
+1. Log in to the [Tuya IoT Platform](https://iot.tuya.com/).
+2. In the left navigation bar, click `Cloud` > `Development`.
+3. On the page that appears, click `Create Cloud Project`.
+4. In the `Create Cloud Project` dialog box, configure `Project Name`, `Description`, `Industry`, and `Data Center`. For the `Development Method` field, select `Smart Home` from the dropdown list. For the `Data Center` field, select the zone you are located in. Refer to the country/data center mapping list [here](https://github.com/tuya/tuya-home-assistant/blob/main/docs/regions_dataCenters.md) to choose the right data center for the country you are in.
+
+ ![](https://www.home-assistant.io/images/integrations/tuya/image_001.png)
+
+5. Click `Create` to continue with the project configuration.
+6. In Configuration Wizard, make sure you add `Industry Basic Service`, `Smart Home Basic Service` and `Device Status Notification` APIs. The list of API should look like this:
+ ![](https://www.home-assistant.io/images/integrations/tuya/image_002new.png)
+7. Click `Authorize`.
+
+### Link devices by app account
+
+1. Navigate to the `Devices` tab.
+2. Click `Link Tuya App Account` > `Add App Account`.
+ ![](https://www.home-assistant.io/images/integrations/tuya/image_003.png)
+3. Scan the QR code that appears using the `Tuya Smart` app or `Smart Life` app using the 'Me' section of the app.
+
+ ![](https://www.home-assistant.io/images/integrations/tuya/image_004.png)
+
+4. Click `Confirm` in the app.
+5. To confirm that everything worked, navigate to the `All Devices` tab. Here you should be able to find the devices from the app.
+6. If zero devices are imported, try changing the DataCenter and check the account used is the "Home Owner".
+ You can change DataCenter by clicking the Cloud icon on the left menu, then clicking the Edit link in the Operation column for your newly created project. You can change DataCenter in the popup window.
+
+![](https://www.home-assistant.io/images/integrations/tuya/image_005.png)
+
+### Get authorization data
+
+Click the created project to enter the `Project Overview` page and get the `Authorization Key`. You will need these for setting up the integration. in the next step.
+
+![](/images/tuya_iot_overview.png)
+
+ `Data center region`:
+ Choose the country you picked when signing up.
+
+ `Client ID`:
+ Go to your cloud project on [Tuya IoT Platform](https://iot.tuya.com/). on the **Project Overview** tab.
+
+ `Client Secret`:
+ Go to your cloud project on [Tuya IoT Platform](https://iot.tuya.com/). on the **Project Overview** tab.
+
+### Get USER ID
+ Navigate to the `Devices` tab -> Click Link `Tuya App Account` Copy `UID` <- is `User ID`.
+
+ ![](https://user-images.githubusercontent.com/46300268/246021288-25d56177-2cc1-45dd-adb0-458b6c5a25f3.png)
+
+## Error codes and troubleshooting
+
+
+
+??? info "1004: sign invalid"
+ Incorrect Access ID or Access Secret. Please refer to the **Configuration** part above.
+
+??? info "1106: permission deny"
+ - App account not linked with cloud project: On the [Tuya IoT Platform](https://iot.tuya.com/cloud/), you have linked devices by using Tuya Smart or Smart Life app in your cloud project. For more information, see [Link devices by app account](https://developer.tuya.com/docs/iot/Platform_Configuration_smarthome?id=Kamcgamwoevrx#title-3-Link%20devices%20by%20app%20account).
+
+ - Incorrect username or password: Enter the correct account and password of the Tuya Smart or Smart Life app in the **Account** and **Password** fields (social login, which the Tuya Smart app allows, may not work, and thus should be avoided for use with the Home Assistant integration). Note that the app account depends on which app (Tuya Smart or Smart Life) you used to link devices on the [Tuya IoT Platform](https://iot.tuya.com/cloud/).
+
+ - Incorrect country. You must select the region of your account of the Tuya Smart app or Smart Life app.
+
+??? info "1100: param is empty"
+ Empty parameter of username or app. Please fill the parameters refer to the **Configuration** part above.
+
+??? info "2406: skill id invalid"
+ - Make sure you use the **Tuya Smart** or **SmartLife** app account to log in. Also, choose the right data center endpoint related to your country region. For more details, please check [Country Regions and Data Center](https://github.com/tuya/tuya-home-assistant/blob/main/docs/regions_dataCenters.md).
+
+ - Your cloud project on the [Tuya IoT Development Platform](https://iot.tuya.com) should be created after May 25, 2021. Otherwise, you need to create a new project.
+
+ - This error can often be resolved by unlinking the app from the project (`Devices` tab > `Link Tuya App Account` > `Unlink`) and [relinking it again](#link-devices-by-app-account).
+
+??? info "28841105: No permissions. This project is not authorized to call this API"
+ Some APIs are not authorized, please [Subscribe](https://developer.tuya.com/docs/iot/applying-for-api-group-permissions?id=Ka6vf012u6q76#title-2-Subscribe%20to%20APIs) then [Authorize](https://developer.tuya.com/docs/iot/applying-for-api-group-permissions?id=Ka6vf012u6q76#title-3-Grant%20a%20project%20access%20to%20API%20calls). The following APIs must be subscribed for this tutorial:
+
+ - Device Status Notification
+
+ - Industry Basic Service
+
+ - Smart Home Basic Service
+
+ - Authorization
+
+ - IoT Core
+
+ - Smart Home Scene Linkage
+
+ - IoT Data Analytics
+
+??? info "28841002: No permissions. Your subscription to cloud development plan has expired"
+ Your subscription to Tuya cloud development **IoT Core Service** resources has expired, please [extend it](https://iot.tuya.com/cloud/products/detail?abilityId=1442730014117204014) in `Cloud` > `Cloud Services` > `IoT Core` > `My Subscriptions` tab > `Subscribed Resources` > `IoT Core` > `Extend Trial Period`.
+
+## REF Document
+[HomeAssistant Tuya](https://www.home-assistant.io/integrations/tuya/#28841105-no-permissions-this-project-is-not-authorized-to-call-this-api){target="_blank"}
\ No newline at end of file
diff --git a/docs/ha_events.md b/docs/ha_events.md
new file mode 100644
index 000000000..df84d0ad7
--- /dev/null
+++ b/docs/ha_events.md
@@ -0,0 +1,77 @@
+# Events
+Localtuya have fires an [events](https://www.home-assistant.io/docs/configuration/events/){target="_blank"} on `homeassisstant`
+that can be used on automation or check your device `DPS`
+
+With this you can automate `scene remote` (1) devices to trigger action on `homeassistant`
+{.annotate}
+
+1. e.g. `single click`, `double click` or `hold`.
+
+| Event | Data
+| ----------- | ------------------------------------
+| `localtuya_device_triggered` | `#!json {"data": {"device_id", "states"} }`
+| `localtuya_device_dp_triggered` | `#!json {"data": {"device_id", "dp", "value"} }`
+| `localtuya_states_update` | `#!json {"data": {"device_id", "old_states", "new_states"} }`
+
+Exaples
+=== "localtuya_device_triggered"
+
+ ```yaml
+
+ trigger:
+ - platform: event
+ event_type: localtuya_device_triggered
+ condition: []
+ action:
+ - service: persistent_notification.create
+ data:
+ message: "{{ trigger.event.data }}"
+
+ ```
+
+=== "localtuya_device_dp_triggered"
+
+ ```yaml title=""
+
+ trigger:
+ - platform: event
+ event_type: localtuya_device_dp_triggered
+ condition: []
+ action:
+ - service: persistent_notification.create
+ data:
+ message: "{{ trigger.event.data }}"
+
+ ```
+ ???+ example "Automation for scene remote trigger if 1st button single clicked"
+ ```yaml title=""
+
+ trigger:
+ - platform: event
+ event_type: localtuya_device_dp_triggered
+ event_data:
+ device_id: bfa2f86e3068440a449dhd
+ dp: "1" # quotes are important for dp
+ value: single_click
+ condition: []
+ action:
+ - service: persistent_notification.create
+ data:
+ message: "{{ trigger.event.data }}"
+
+ ```
+
+=== "localtuya_states_update"
+
+ ```yaml title=""
+
+ trigger:
+ - platform: event
+ event_type: localtuya_states_update
+ condition: []
+ action:
+ - service: persistent_notification.create
+ data:
+ message: "{{ trigger.event.data }}"
+
+ ```
\ No newline at end of file
diff --git a/docs/images/Thumbs.db b/docs/images/Thumbs.db
new file mode 100644
index 000000000..901c1f3ec
Binary files /dev/null and b/docs/images/Thumbs.db differ
diff --git a/docs/images/configure.png b/docs/images/configure.png
new file mode 100644
index 000000000..d2fc56d65
Binary files /dev/null and b/docs/images/configure.png differ
diff --git a/docs/images/delete_device.png b/docs/images/delete_device.png
new file mode 100644
index 000000000..a8cba2e23
Binary files /dev/null and b/docs/images/delete_device.png differ
diff --git a/docs/images/dev/Thumbs.db b/docs/images/dev/Thumbs.db
new file mode 100644
index 000000000..29b99630b
Binary files /dev/null and b/docs/images/dev/Thumbs.db differ
diff --git a/docs/images/dev/device_diagnostics.png b/docs/images/dev/device_diagnostics.png
new file mode 100644
index 000000000..77f959a21
Binary files /dev/null and b/docs/images/dev/device_diagnostics.png differ
diff --git a/docs/images/dev/entry_diagnostics.png b/docs/images/dev/entry_diagnostics.png
new file mode 100644
index 000000000..a8a0d9f71
Binary files /dev/null and b/docs/images/dev/entry_diagnostics.png differ
diff --git a/docs/images/dev/tuya_devices_dir.png b/docs/images/dev/tuya_devices_dir.png
new file mode 100644
index 000000000..b91b2d261
Binary files /dev/null and b/docs/images/dev/tuya_devices_dir.png differ
diff --git a/docs/images/dp_list_explain.png b/docs/images/dp_list_explain.png
new file mode 100644
index 000000000..6be0e0756
Binary files /dev/null and b/docs/images/dp_list_explain.png differ
diff --git a/docs/images/dps_list_ex.png b/docs/images/dps_list_ex.png
new file mode 100644
index 000000000..40b217b42
Binary files /dev/null and b/docs/images/dps_list_ex.png differ
diff --git a/docs/images/init.png b/docs/images/init.png
new file mode 100644
index 000000000..bd4462590
Binary files /dev/null and b/docs/images/init.png differ
diff --git a/docs/images/opt_add_devices.png b/docs/images/opt_add_devices.png
new file mode 100644
index 000000000..be2306ea5
Binary files /dev/null and b/docs/images/opt_add_devices.png differ
diff --git a/docs/images/opt_configure_device.png b/docs/images/opt_configure_device.png
new file mode 100644
index 000000000..85cba5de2
Binary files /dev/null and b/docs/images/opt_configure_device.png differ
diff --git a/docs/images/opt_configure_entity.png b/docs/images/opt_configure_entity.png
new file mode 100644
index 000000000..11b9a3fa9
Binary files /dev/null and b/docs/images/opt_configure_entity.png differ
diff --git a/docs/images/opt_configure_more.png b/docs/images/opt_configure_more.png
new file mode 100644
index 000000000..2d1902638
Binary files /dev/null and b/docs/images/opt_configure_more.png differ
diff --git a/docs/images/opt_configure_switch_ex.png b/docs/images/opt_configure_switch_ex.png
new file mode 100644
index 000000000..c8e463164
Binary files /dev/null and b/docs/images/opt_configure_switch_ex.png differ
diff --git a/docs/images/opt_reconfigure_device.png b/docs/images/opt_reconfigure_device.png
new file mode 100644
index 000000000..66ac2c7ae
Binary files /dev/null and b/docs/images/opt_reconfigure_device.png differ
diff --git a/docs/images/opt_reconfigure_device_entity_check.png b/docs/images/opt_reconfigure_device_entity_check.png
new file mode 100644
index 000000000..4128cb4ad
Binary files /dev/null and b/docs/images/opt_reconfigure_device_entity_check.png differ
diff --git a/docs/images/options.png b/docs/images/options.png
new file mode 100644
index 000000000..0da21d47e
Binary files /dev/null and b/docs/images/options.png differ
diff --git a/docs/images/templates.png b/docs/images/templates.png
new file mode 100644
index 000000000..1ac5c0aec
Binary files /dev/null and b/docs/images/templates.png differ
diff --git a/docs/images/tuya_iot_overview.png b/docs/images/tuya_iot_overview.png
new file mode 100644
index 000000000..81d953397
Binary files /dev/null and b/docs/images/tuya_iot_overview.png differ
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 000000000..f22d58590
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,43 @@
+# Overview
+LocalTuya is [HomeAssistant](https://www.home-assistant.io/) integration allows you to control your Tuya-based smart devices directly within your local network.
+
+!!! info "LocalTuya is a HUB"
+ `LocalTuya` is a hub means after setup your entry whether using `cloud` or `no cloud`, You will manage your devices from entry configuration UI
+ by clicking on `configure` (1)
+ { .annotate }
+
+ 1. ![](/images/configure.png)
+
+!!! info "Cloud API"
+ LocalTuya uses cloud only to get devices data and fill the required fields for you.
+
+ It provides many features to make device set-up easier.
+
+ `LocalTuya` Can be you used without cloud.
+
+[:simple-homeassistantcommunitystore: Add repository to HACS](https://my.home-assistant.io/redirect/hacs_repository/?category=integration&repository=hass-localtuya&owner=xZetsubou){ target=_blank .md-button }
+
+
+## Features
+- Cloud Api
+- Supported protocols - `3.1`, `3.2`, `3.3`, `3.4` and `3.5`
+- Auto configure devices - `Requires cloud api set-up`
+- Auto fill devices config fields - `Requires cloud api set-up`
+- Disocvery - `Discover Tuya devices on you network`
+
+
+
+## Supported platforms
+- Binary Sensor
+- Button
+- Climate
+- Cover
+- Fan
+- Humidifier
+- Light
+- Number
+- Selector
+- Sensor
+- Siren
+- Switch
+- Vacuum
\ No newline at end of file
diff --git a/docs/installation.md b/docs/installation.md
new file mode 100644
index 000000000..4ce9d3c4f
--- /dev/null
+++ b/docs/installation.md
@@ -0,0 +1,223 @@
+# Usage
+Assuming you add the repository and Installed Integration from [Overview](index.md)
+
+!!! Note "Before you start"
+ You must have your device `localkey` and `ID` in order to add your device into **LocalTuya**. The easiest way is to configure the Cloud API account in the integration.
+
+ If you want to obtain `localkey` without configure cloud api. A good guides [TuyaAPI Setup](https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md){ target=_blank}, [TinyTuya](https://pypi.org/project/tinytuya/.){ target=_blank} or [MarkVideo](https://www.youtube.com/watch?v=YKvGYXw-_cE){ target=_blank}
+
+ Before Adding any device `Smart Life and Tuya Smart` Apps Need to be closed from Phones. and devices aren't added in different Local Integration
+ `This is due to some Tuya devices can only accept 1 connection at the same time`
+
+## Installation
+#### Add HUB
+1. Adding hub options
+
+ a. Go to [integration page](https://my.home-assistant.io/redirect/integrations/){target=_blank} in HA and click on `ADD INTEGRATION` bottom right corner.
+
+ b. MY Link [Add Integration](https://my.home-assistant.io/redirect/config_flow_start/?domain=localtuya){target=_blank}
+
+2. When adding new hub config page will show up (1)
+{ .annotate }
+ 1. ![](/images/init.png)
+
+ a. If you don't want to setup cloud api check `Disable Cloud API?` and skip to [ADD Devices](#add-new-device)
+
+ b. If you setup `cloud` account you should have all the needed information: [Get auth data](cloud_api.md/#get-authorization-data)
+
+
+
+## Configuration Menu
+
+After setting up the integration you can now manage your devices `ADD` and `EDIT`
+
+By click on `Configure` (1) a menu will show up, Choose your (2)
+{ .annotate }
+
+1. ![](/images/configure.png)
+2. ![](/images/options.png)
+
+
+### Add new device
+!!! Note "Discovery"
+ By default `localtuya` has discovery feature, and it will scan local network searching for tuya devices and list it in config flow.
+ But this will requires HA Machine to be connected with the same Tuya Devices network and doesn't run on different `subnet`.
+!!! note ""
+ The example below using `2 Gang Tuya Switch`
+
+
+1. Choose `Add new device` new page will show up with dsicovered devices listed (1)
+Choose the device to configure and click on `submit`.
+ {.annotate}
+
+ 1. If device is on configured `Tuya account` ID will be replaced with the name if not will remain with `xxx (ip)`
![](/images/opt_add_devices.png)
+
+2. `Configure device`: Fill the fields that still missing and is `required`
+
+ ??? info "Device Name"
+ A name for the device. e.g. `Bedroom 2G`
entities ID will follow device name for example an entity named `switch 1` the `entity id` will be `switch.bedroom_2g_switch_1`
+
+ ??? info "ip"
+ The device IP Address in local e.g. `192.168.1.55`
Automatically inserted if you choose discovered device.
+
+ ??? info "Device ID"
+ The device ID obtain from `cloud` [top note](#top).
Automatically inserted if you choose discovered device.
+
+ ??? info "Local Key"
+ The key for device. see [top note](#top)
Automatically inserted if cloud api is setup and device added on the account.
+
+ ??? info "(optional) Enable Debug"
+ Device will send `Debug messages` in logs. `Use it if you have an issues and wants to track it`
+ You need to enable logger debug in `configuretion.yaml` for localtuya.
+ ```yaml
+ logger:
+ logs:
+ custom_components.localtuya: debug
+ custom_components.localtuya.pytuya: debug
+ ```
+
+ ??? info "(optional) Scan Interval"
+ Only needed if energy/power values are not updating frequently enough by default.
Values less than 10 seconds may cause stability issues
+
+ ??? info "(Optional) Manual DPS"
+ It is only needed if the device doesn't advertise the DPS correctly until the entity has been properly initiailised. This setting can often be avoided by first connecting/initialising the device with the Tuya App, then closing the app and then adding the device in the integration.
Note: Any DPS added using this option will have a `-1` value during setup e.g. `20,21,22`
+
+ ??? info "(Optional) DPIDs Reset"
+ It is used when a device doesn't respond to any Tuya commands after a power cycle, but can be connected to (zombie state). This scenario mostly occurs when the device is blocked from accessing the internet. The DPids will vary between devices, but typically "18,19,20" is used. If the wrong entries are added here, then the device may not come out of the zombie state. Typically only sensor DPIDs entered here.
+
+ ??? info "(Optional) Node ID or CID"
+ `Node ID` also known as `CID` only for sub devices that works through `Gateways` e.g. `ZigBee` and `BLE` Devices.
+
+3. After connection success it time to setup the entities.
+
+#### Configure device methods
+!!! info "How does localtuya works"
+ Before configure device entities this is how `localtuya` works
+ So Tuya devices has functions like `Switch 1, Switch 2 and more` each function will be addressed with `DP ID`.
+ Localtuya configure entities using the `DP ID` and control the function by it's `ID`.
+
+##### Discover device entities automatically
+ Automatic setup is only supported for CloudAPI setup.
+ It's still possible to tweak the entities config later after auto configure.
+
+
+
+##### Configure device entities manually
+This option will pretty much works for everyone but it more advanced.
+
+1. Choosing manually setup will show new page for with listed supported `platforms`(1)
+Each `platform` has different configuretion fields.
+{.annotate}
+
+ 1. ![](/images/opt_configure_entity.png)
+
+2. Configre `Switch` (1). All the fields can be changed later except for `ID`
+{.annotate}
+
+ 1. ![](/images/opt_configure_switch_ex.png)
+
+ !!! tip annotate "`DP` fields (1)"
+ DP fields will show all the `DP IDs` of the device and the value of that `DP` `[Code only shows if cloud setup]`
+ Using __`1 ( code: switch_1 , value: False )`__ as an example:
+ `DP 1` refers to `1st gang on my switch`, With `DP ID` is `1` and it's `off` now because `Value is False` (2)
+ Some `platforms` has more then one `DP field` like `climate` where there is a `DP` for turn `off` and `on` and dp for set temperture and set `mode`
+
+
+
+ 1. ![](/images/dps_list_ex.png)
+ 2. `DP 1` Switch 1 is `OFF` `[1st gang]`
`DP 2` Switch 2 is `OFF` `[2nd gang]`
`DP 7` Switch 1 Timer is `0`
`DP 8` Switch 2 Timer is `0`
![](/images/dps_list_ex.png)
+
+ Must of the fields are Optional but `ID` is always `Required` so from the example choosing Platform `Switch` and set `ID` to `1` to configure entity switch controls `1st Gang switch`
+
+3. When submit first entity, `IF there is still more DP IDs not configured yet` it will ask you if you want to finish the process or add more entities (1)
+ {.annotate}
+
+ 1. ![](/images/opt_configure_more.png)
+
+ !!! info ""
+ I unchecked `Finish configuring entities` and repeated `step 2` to add another `switch` entity that controls `ID 2` <- `2nd Gang switch`
+
+4. After finish adding entities step Check `Finish configuring entities` and submit to add your Device & entities
+
+
+##### Use saved template
+!!! info "Templates"
+ Ready to go device config can be imported through add device process.
It can be used if you want to take `backup`, `share` or setup similar devices.
+ All templates in `templates directory` will be listed on `Use saved template` step.
+ __Templates directory located in `custom_components/localtuya/templates`__.
+ !!! annotate note ""
+ Templates will be loaded when HA starts so in order for template to show in the list restart is needed
+ However when you import a template you can manually type the name `my_template.yaml` (1)
+ 1. ![](/images/templates.png)
+
+###### Create templates
+There's 2 way to create templates
+
+1. Export a configured device from [Reconfigure existing device](#reconfigure-existing-device)
+2. Is write configs in `yaml` file and copy it to templates directory `[Not Recommended]`
+
+??? example "`Cover` template example"
+ ```yaml
+ - cover:
+ commands_set: open_close_stop
+ current_position_dp: '3'
+ entity_category: None
+ friendly_name: My BedRoom Shade
+ id: '1'
+ platform: cover
+ position_inverted: false
+ positioning_mode: position
+ set_position_dp: '2'
+ span_time: 25.0
+ - select:
+ entity_category: config
+ friendly_name: My BedRoom Shade Motor Direction
+ id: '5'
+ is_passive_entity: false
+ platform: select
+ restore_on_reconnect: false
+ select_options: forward;back
+ select_options_friendly: Forward;Reverse
+ - select:
+ entity_category: config
+ friendly_name: My BedRoom Shade Motor Mode
+ id: '106'
+ is_passive_entity: false
+ platform: select
+ restore_on_reconnect: false
+ select_options: contiuation;point
+ select_options_friendly: Auto;Manual
+ - binary_sensor:
+ device_class: problem
+ entity_category: diagnostic
+ friendly_name: My BedRoom Shade Fault
+ id: '12'
+ platform: binary_sensor
+ state_off: '0'
+ state_on: '1'
+ ```
+
+
+### Reconfigure existing device
+Reconfigure existing device (1) works pretty much like `Add Device steps` but you can now modify old entities or add more
+{.annotate}
+
+1. ![](/images/opt_reconfigure_device.png)
+
+#### Delete entities
+You can delete the entity by uncheck the entity you want to remove on `reconfigure device` (1)
+{.annotate}
+
+1. ![](/images/opt_reconfigure_device_entity_check.png)
+
+### Manage Cloud API account
+You can manage your configured Tuya CloudAPI account, or disable cloud
+
+## Delete Device
+1. To delete device go to your device page on HomeAssistant.
+2. On device info panel click on the :material-dots-vertical: and click on __delete__
+
+??? example "Example image"
+ ![](/images/delete_device.png)
\ No newline at end of file
diff --git a/docs/services.md b/docs/services.md
new file mode 100644
index 000000000..1c41b23d4
--- /dev/null
+++ b/docs/services.md
@@ -0,0 +1,39 @@
+# Services
+
+
+| Service | Data | Description
+| ----------- | ---------------------------------------------------------|-------------------------------------
+| `localtuya.reload` | | Reload All `localtuya` entries
+| `localtuya.set_dp` | `#!json {"data": {"device_id", "dp", "value"}}` | Set new value for one `DP` or multi
+
+
+=== "Set DP Service"
+
+ ```yaml title="Change the value of DP 1"
+ service: localtuya.set_dp
+ data:
+ device_id: 11100118278aab4de001
+ dp: 1
+ value: true
+ ```
+
+ ```yaml title="Change the values for multi DPs"
+ service: localtuya.set_dp
+ data:
+ device_id: 11100118278aab4de001 #(1)!
+ value:
+ "1": true # (2)!
+ "2": true # (3)!
+ "3": false # (4)!
+ ```
+
+ 1. Device with this ID must be added into `localtuya`
+ 2. Set `DP 1` Value to `true`
+ 3. Set `DP 2` Value to `true`
+ 4. Set `DP 3` Value to `false`
+
+=== "Reload Service"
+ Reload all `LocalTuya` Entries
+ ```yaml
+ service: localtuya.reload
+ ```
diff --git a/mkdocs.yml b/mkdocs.yml
new file mode 100644
index 000000000..5c9dbd87d
--- /dev/null
+++ b/mkdocs.yml
@@ -0,0 +1,47 @@
+site_name: Localtuya Documentation
+repo_url: https://github.com/xZetsubou/hass-localtuya/
+edit_uri: edit/main/docs/
+copyright: Copyright © Bander aka xZetsubou 2023
+
+theme:
+ name: 'material'
+ features:
+ - content.action.edit
+ - content.code.annotate
+ - content.code.copy
+ - navigation.instant
+ - navigation.sections
+ - navigation.top
+ palette:
+ scheme: slate
+ primary: teal
+ accent: teal
+
+nav:
+ - index.md
+ - ha_events.md
+ - services.md
+ - Guides:
+ - installation.md
+ - cloud_api.md
+ - Development:
+ - auto_configure.md
+
+markdown_extensions:
+ - admonition
+ - attr_list
+ - md_in_html
+ - pymdownx.details
+ - pymdownx.inlinehilite
+ - pymdownx.snippets
+ - pymdownx.superfences
+ - tables
+ - pymdownx.highlight:
+ anchor_linenums: true
+ line_spans: __span
+ pygments_lang_class: true
+ - pymdownx.emoji:
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
+ - pymdownx.tabbed:
+ alternate_style: true
\ No newline at end of file