Advertisement
Guest User

MEATER ESPHome

a guest
Apr 6th, 2023
2,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.73 KB | None | 0 0
  1. esphome:
  2.   name: meater
  3.   friendly_name: MEATER
  4.  
  5. esp32:
  6.  #board: esp32dev
  7.   board: esp32-c3-devkitm-1
  8.   framework:
  9.    #type: esp-idf
  10.     type: arduino
  11.  
  12. # Enable logging
  13. logger:
  14.  #level: VERBOSE
  15.   #level: VERY_VERBOSE
  16.  
  17. # Enable Home Assistant API
  18. api:
  19. ota:
  20.   password: "3e657a40432cc48a6b1b22d566b9eed8"
  21.  
  22. wifi:
  23.   ssid: !secret wifi_ssid
  24.   password: !secret wifi_password
  25.  
  26.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  27.   ap:
  28.     ssid: "Meater Fallback Hotspot"
  29.     password: "1JX0qX8Co7KL"
  30.    
  31. # Example configuration entry for finding
  32. # Service UUIDs and iBeacon UUIDs and identifiers
  33. #esp32_ble_tracker:
  34.  
  35. ble_client:
  36.   - mac_address: B8:1F:5E:1C:42:95
  37.     id: meater
  38.  
  39. text_sensor:
  40.   - platform: template
  41.     name: "MEATER firmware"
  42.     id: meater_firmware
  43.  
  44. sensor:
  45.   - platform: ble_client
  46.     type: characteristic
  47.     ble_client_id: meater
  48.     name: "MEATER tip temperature"
  49.     service_uuid: 'a75cc7fc-c956-488f-ac2a-2dbc08b63a04'
  50.     characteristic_uuid: '7edda774-045e-4bbf-909b-45d1991a2876'
  51.     icon: 'mdi:thermometer'
  52.     unit_of_measurement: '°C'
  53.     accuracy_decimals: 2
  54.     notify: true
  55.     lambda: |-
  56.       uint16_t tip_temp = (x[0] + (x[1] << 8) + 8.0) / 16.0;
  57.       return (float)tip_temp;
  58.   - platform: ble_client
  59.     type: characteristic
  60.     ble_client_id: meater
  61.     name: "MEATER ambient temperature"
  62.     service_uuid: 'a75cc7fc-c956-488f-ac2a-2dbc08b63a04'
  63.     characteristic_uuid: '7edda774-045e-4bbf-909b-45d1991a2876'
  64.     icon: 'mdi:thermometer'
  65.     unit_of_measurement: '°C'
  66.     accuracy_decimals: 2
  67.     notify: true
  68.     lambda: |-
  69.       uint16_t tip = x[0] + (x[1] << 8);
  70.       uint16_t ra = x[2] + (x[3] << 8);
  71.       uint16_t oa = x[4] + (x[5] << 8);
  72.       uint16_t min_val = 48;
  73.       uint16_t ambient = (tip + std::max(0, (((ra - std::min(min_val, oa)) * 16 * 589) / 1487)) + 8.0) / 16;
  74.       return (float)ambient;
  75.   - platform: ble_client
  76.     type: characteristic
  77.     ble_client_id: meater
  78.     name: "MEATER battery level"
  79.     service_uuid: 'a75cc7fc-c956-488f-ac2a-2dbc08b63a04'
  80.     characteristic_uuid: '2adb4877-68d8-4884-bd3c-d83853bf27b8'
  81.     icon: 'mdi:battery'
  82.     unit_of_measurement: '%'
  83.     notify: true
  84.     lambda: |-
  85.       uint16_t battery = (x[0] + x[1]) * 10;
  86.       return (float)battery;
  87.   - platform: ble_client
  88.     type: characteristic
  89.     ble_client_id: meater
  90.     id: firmware
  91.     service_uuid: '180A'
  92.     characteristic_uuid: '00002a26-0000-1000-8000-00805f9b34fb'
  93.     lambda: |-
  94.       std::string data_string(x.begin(), x.end());
  95.       id(meater_firmware).publish_state(data_string.c_str());
  96.       return (float)x.size();
  97.   - platform: ble_client
  98.     type: rssi
  99.     ble_client_id: meater
  100.     name: "MEATER RSSI"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement