Home | Software | Linux | Windows | Mobile | Gura Humorului |
miercuri, 16 noiembrie 2022
Configure a Tuya pet feeder with Home Assistant and LocalTuya
Scris miercuri, 16 noiembrie 2022 , 15:56 , de Ovidiu
I will assume that you went through the steps to configure LocalTuya and you already have your Client ID and Client Secret. You will also need to add the device into the Devices tab of your Tuya IoT project and get the device's local key by installing the tinytuya Python module and running python3 -m tinytuya wizard to query and configure local Tuya devices.
After installing localtuya through HACS or by manually adding it to custom_components, add a new LocalTuya integration in Home Assistants integration page and check Do not configure a Cloud API account, since we already have everything we need to set up the integration. After the integration is added, click on the Configure button and select Add a new device in the LocalTuya Configuration popup. Select your device and in the next step replace the Device ID field's value with the value of the "id" field returned by tinytuya:
Also, fill the "key" value returned by tinytuya into the Local key field and give your device a nice name. Leave 3.3 selected for the protocol and for Manual DPS add 101, which is the indicator light status datapoint, and 239, which is the empty/full status of the food bucket. There are many other datapoints for night mode, memory card status and so on, if you're interested into getting the DPs for those see the Zigbee2MQTT great documentation about finding them.
After submitting the form, select switch as a platform for the newly created entity type, then in the next step make sure 101 is selected for the ID, give it a suggestive name, e.g. Indicator Light. Submit this and for the next entity select binary_sensor, make sure to uncheck Do not add any more entities, give it again a name (e.g. Food Bucket Empty), for the On Value set less and for the Off Value set full. Finally, click on Submit and you should now have a new device with a switch entity and a binary sensor available. Don't worry about the Food Bucket Empty sensor being unavailable, it will be updated as soon as it gets updated (you can check this by covering/uncovering the sensors inside the bucket).
Triggering the feeding motor require to manually set a value for the 245 datapoint. For that, go to Services tab in Developer tools (/developer-tools/service) and call the localtuya.set_dp service with the following data:
device_id: <your_device_id>
dp: 245
value: 1
2 comentarii :
Did you manage to make the camera and speaker working?
Camera stream can be accessed via RTSP at rtsp://admin:admin@DEVICE_IP:554/1. I never tried to make the speaker working.
Trimiteți un comentariu