Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for TCS0533B / STK-02 / tv6peegl Soil Thermo-Hygrometer #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zimmra
Copy link

@zimmra zimmra commented Aug 9, 2023

I stumbled across a cheaper soil moisture sensor on Amazon and wanted to test it with Home Assistant.

It is a Tuya based product under the Diivoo brand, model # STK-02.

Tuya IoT platform shows it to be TCS0533B and the product identifier is tv6peegl

I was able to add the device to the integration, but without this commit the only information I was able to get was the Signal Strength

With this commit, I am able to get Temperature and Humidity from the device.

I have not attempted the battery or temperature unit fields, as they seem to be configured differently than other devices this configuration handles

Query Device Details Output

{
  "result": {
    "active_time": 1691553738,
    "category": "wsdcg",
    "create_time": 1691553738,
    "custom_name": "",
    "icon": "smart/icon/ay15662905541765SKtA/5de5e1c4a9e8371f7ae7763d9e4e0bbe.png",
    "id": "{redacted}",
    "ip": "",
    "is_online": false,
    "lat": "",
    "local_key": "{redacted}",
    "lon": "",
    "model": "",
    "name": "Soil Thermo-hygrometer",
    "product_id": "tv6peegl",
    "product_name": "TCS0533B 蓝牙版土壤温湿度传感器",
    "sub": false,
    "time_zone": "-07:00",
    "update_time": 1691553738,
    "uuid": "{redacted}"
  },
  "success": true,
  "t": 1691559227215,
  "tid": "4ff7a2f3367611ee804ade073cb82c5d"
}

Device Control > Query Properties

{
  "result": {
    "properties": [
      {
        "code": "temp_current",
        "custom_name": "",
        "dp_id": 1,
        "time": 1691553738179,
        "value": 0
      },
      {
        "code": "Temp",
        "custom_name": "",
        "dp_id": 101,
        "time": 1691559236022,
        "value": 29
      },
      {
        "code": "Moisure",
        "custom_name": "",
        "dp_id": 102,
        "time": 1691559236954,
        "value": 25
      },
      {
        "code": "battery_status",
        "custom_name": "",
        "dp_id": 117,
        "time": 1691559359926,
        "value": false
      },
      {
        "code": "temp_format",
        "custom_name": "",
        "dp_id": 119,
        "time": 1691558934549,
        "value": "1"
      },
      {
        "code": "temp_count",
        "custom_name": "",
        "dp_id": 122,
        "time": 1691553738179
      },
      {
        "code": "moisure_count",
        "custom_name": "",
        "dp_id": 123,
        "time": 1691553738179
      }
    ]
  },
  "success": true,
  "t": 1691559478675,
  "tid": "e5eb4671367611ee804ade073cb82c5d"
}

I'm not sure if it matters, but I have Control Instruction Mode set to DP Instruction

I quite literally just got this up and going, so haven't been able to test the long term reliability of the connection, but I am getting Moisture(humidity), Temperature, and Signal Strength in Home Assistant now. I also can't attest to the accuracy of this sensor, it seems accurate enough to work but not sure how it compares to other plant sensors on the market.

@zimmra
Copy link
Author

zimmra commented Aug 9, 2023

image
Still connected/reporting 8 hours later, although I'm not sure if that flat period is from lack of data or just consistent temperature throughout the night.

Will have better chance of observation as temperature should fluctuate throughout the daytime more.

@dimitribo
Copy link

Hello,

Woow, you integrated yourself the code so you get the temperature en humidity ?
Is there any chance that you can help me further in the same way with my climate entities where i asked for in this group ?
See on : #58
At the moment i want to reed the set en actual temperature and maybe it's the same way ... to modify because ther all ready existe climates ... But for now it is no detected for me ...

Hopefully you can help me further with this ?

@zimmra
Copy link
Author

zimmra commented Aug 9, 2023

Hello,

Woow, you integrated yourself the code so you get the temperature en humidity ? Is there any chance that you can help me further in the same way with my climate entities where i asked for in this group ? See on : #58 At the moment i want to reed the set en actual temperature and maybe it's the same way ... to modify because ther all ready existe climates ... But for now it is no detected for me ...

Hopefully you can help me further with this ?

Comments in pull requests should pertain to that pull request... Outside of the 'Discussions' area that projects can electively enable, Github isn't a forum.

With that being said I don't really know anything about Tuya's protocol this is the first and only device from them that I've used, sorry.

@zimmra
Copy link
Author

zimmra commented Aug 10, 2023

@PlusPlus-ua

Is it possible to perform a setting/function similar to the active_scan option of custom-components/ble_monitor?

active_scan

active_scan
Use active scan instead of passive scan (affects battery) (boolean)(Optional) In active mode scan requests will be sent, which is most often not required, but slightly increases the sensor battery consumption. ‘Passive mode’ means that you are not sending any request to the sensor but you are just receiving the advertisements sent by the BLE devices. This parameter is a subject for experiment. Default value: False

ble_monitor:
 active_scan: True

It seems like I am only consistently getting status updates at/around the times I do one of the following:

  • Reboot Home Assistant
  • Reload tuya_ble integration
  • Press action button on the soil sensor

@zimmra
Copy link
Author

zimmra commented Aug 11, 2023

It seems like I am only consistently getting status updates at/around the times I do one of the following:

  • Reboot Home Assistant
  • Reload tuya_ble integration
  • Press action button on the soil sensor

This doesn't seem to be accurate necessarily, as I have been getting state updates but seemingly sporadic. I did not interact with my server or the unit at any time during this window

What confuses me the most, as the between Signal Strength, Humidity, and Temperature at least one of them is consistently updating their state but not all 3 of them

image

sirloinofbeef added a commit to sirloinofbeef/ha_tuya_ble that referenced this pull request May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants