feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

Support for Sonoff MS01

Open stskrp opened this issue 3 years ago • 2 comments

Describe the problem you have/What new integration you would like Support for Sonoff MS01 moisture sensor

Please describe your use case for this integration and alternatives you've tried: Sonoff TH10/16 now has support for new sensor - MS01 https://sonoff.tech/product/accessories/ms01/ It is already supported in Tasmota https://github.com/arendst/Tasmota/pull/15335/files But not sure how to port it to esphome. Would be great to have support for MS01 is esphome too.

Additional context

stskrp avatar May 16 '22 06:05 stskrp

I'm using the Tasmota software successfully but would appreciate support in ESP home as well.

kahhu3 avatar Jul 19 '22 12:07 kahhu3

Trying to add this through PR#3901 and I'm stuck. I'm getting output, but it doesn't match Tasmota. I'm getting small neg ative values (-3.1) instead of positive values. Other values seem to be close.

Zebble avatar Oct 16 '22 18:10 Zebble

Hi @Zebble, I fixed negative values. Tasmota's computations can be negative also. But then we've got this:

if (humidity < 0) humidity = 0.1f;

so I've just added this to your code if (*humidity < 0) *humidity = 0.1f;

and it works.

emes30 avatar Jun 03 '23 20:06 emes30

Hi, Can u send me your yaml, i have the entity but no data. Thx

ffabrice78 avatar Jun 06 '23 22:06 ffabrice78

Here is my fork https://github.com/emes30/esphome/tree/components-dht-ms01 Check it out. If you have entity then your yaml seems ok, check pins and connections.

emes30 avatar Jun 07 '23 10:06 emes30

Hi,

external_components:

  • source: type: git url: https://github.com/emes30/esphome/ ref: components-dht-ms01 components: [dht]

switch:

  • platform: gpio name: "THR316 Relay" pin: GPIO21 id: relay
  • platform: gpio pin: GPIO27 id: sensor_power restore_mode: ALWAYS_ON

sensor:

  • platform: dht pin: 25 model: MS01 humidity: name: "Soil Moisture" update_interval: 60s

Here is my yaml, i use ur fork, but i don't have data, just error

ffabrice78 avatar Jun 10 '23 14:06 ffabrice78

What error ? Can you paste your logs here ?

emes30 avatar Jun 14 '23 20:06 emes30

[10:57:17][C][dht:042]: DHT: [10:57:17][C][dht:043]: Pin: GPIO25 [10:57:17][C][dht:049]: Model: DHT22 (or equivalent) [10:57:17][C][dht:052]: Update Interval: 15.0s [10:57:17][C][dht:054]: Temperature 'esphome10 Temperature' [10:57:17][C][dht:054]: Device Class: 'temperature' [10:57:17][C][dht:054]: State Class: 'measurement' [10:57:17][C][dht:054]: Unit of Measurement: '°C' [10:57:17][C][dht:054]: Accuracy Decimals: 1 [10:57:17][C][dht:055]: Humidity 'esphome10 Soil Moisture' [10:57:17][C][dht:055]: Device Class: 'humidity' [10:57:17][C][dht:055]: State Class: 'measurement' [10:57:17][C][dht:055]: Unit of Measurement: '%' [10:57:17][C][dht:055]: Accuracy Decimals: 0

[10:57:27][W][dht:198]: Requesting data from DHT failed! [10:57:27][W][dht:085]: Invalid readings! Please check your wiring (pull-up resistor, pin number).

YAML: sensor:

  • platform: dht model: MS01 pin: GPIO25 humidity: name: ${node_name} Soil Moisture temperature: name: ${node_name} Temperature update_interval: 15s

j-k-olofsson avatar Jun 18 '23 08:06 j-k-olofsson