h4 / LYWSD02-home-assistant

Home-Assistant sensor for LYWSD02 Thermometer
75 stars 12 forks source link

Some documentations #1

Open Pouzor opened 5 years ago

Pouzor commented 5 years ago

Hi !

I was looking for integration for LYWSD02 since a while and finaly find something with this code. Can you just add some documentation on how you configure Hass with it ? (I still had error on boot).

Thx

h4 commented 5 years ago

Hi. I'm going to update this integration soon (till Jun 22, I hope). Which kind of errors do you have? For development reason I use CRITICAL error level as INFO, so if you see something like messages below – it's OK.

CRITICAL (MainThread) [custom_components.lywsd02.client.client] Trying to get new data
CRITICAL (MainThread) [custom_components.lywsd02.client.client] LOOP
CRITICAL (MainThread) [custom_components.lywsd02.client.client] BLE Data:
CRITICAL (MainThread) [custom_components.lywsd02.client.client] b'f\n7'
CRITICAL (MainThread) [custom_components.lywsd02.client.client] 55
CRITICAL (MainThread) [custom_components.lywsd02] Lywsd02Data.update_data:
CRITICAL (MainThread) [custom_components.lywsd02] {'data': {'temperature': 26.62, 'humidity': 55}}
CRITICAL (MainThread) [custom_components.lywsd02.sensor] data:
CRITICAL (MainThread) [custom_components.lywsd02.sensor] None
CRITICAL (MainThread) [custom_components.lywsd02.sensor] {'temperature': 26.62, 'humidity': 55}
ginkage commented 5 years ago

What worked for me was:

lywsd02:
  mac: '3F:59:C8:73:34:E8'
  sensor:
    - name: 'lywsd02'

sensor:
  - platform: template
    sensors:
      lywsd02_humidity:
        value_template: '{{ states.sensor.lywsd02.attributes.humidity }}'
        unit_of_measurement: '%'
      lywsd02_temperature:
        value_template: '{{ states.sensor.lywsd02.attributes.temperature }}'
        unit_of_measurement: '°C'

And yeah, having some documentation wouldn't hurt.

h4 commented 5 years ago

I've updating my component. Now it uses separated library to fetch data from sensor, and have minimal installation how-to.