Skip to content

Commit

Permalink
Garage light tweak, meater ESPhome
Browse files Browse the repository at this point in the history
  • Loading branch information
aneisch committed Dec 1, 2023
1 parent eed1273 commit 28f47ae
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 34 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Also using Grafana/Influx for graphing, both running in Docker containers on NUC
## Some statistics about my installation:
Description | value
-- | --
Lines of ESPHome YAML | 2691
Lines of Home Assistant YAML | 8379
Lines of ESPHome YAML | 2774
Lines of Home Assistant YAML | 8350
[Integrations](https://www.home-assistant.io/integrations/) in use | 51
Zigbee devices in [`zha`](https://www.home-assistant.io/integrations/zha/) | 26
Z-Wave devices in [`zwave_js`](https://www.home-assistant.io/integrations/zwave_js/) | 37
Expand Down
4 changes: 2 additions & 2 deletions extras/appdaemon/apps/apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ Living Room Sconces at Night With Motion:
# Seconds to turn entity on when triggered
time_on: "1"

Garage Lights with Cover and Door:
Garage Lights with Cover, Door, Motor, Person:
module: door_open
class: DoorLight
trigger_sensor: binary_sensor.garage_interior_door,binary_sensor.garage_exterior_door
trigger_sensor: binary_sensor.garage_interior_door,binary_sensor.garage_exterior_door,binary_sensor.garage_motor_light_status,binary_sensor.garage_person_occupancy
toggle_entity: switch.garage_lights
# Turn_off is handled by automation
#time_on: '10'
Expand Down
92 changes: 92 additions & 0 deletions extras/esphome/meater.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
substitutions:
name: meater
friendly_name: "Meater"

esphome:
name: ${name}
platform: ESP32
board: esp32dev

<<: !include common.yaml

# python3 -m esptool -p /dev/cu.usbmodem01 write_flash 0x0 /Users/aneisch/Desktop/XXXXXX.bin

# Example configuration entry for finding
# Service UUIDs and iBeacon UUIDs and identifiers
#esp32_ble_tracker:

wifi:
ssid: SSID
password: WPA_KEY
# Optional manual IP
manual_ip:
static_ip: 10.0.0.20
gateway: 10.0.1.1
subnet: 255.255.254.0

ble_client:
- mac_address: B8:1F:5E:1C:42:95
id: meater

text_sensor:
- platform: template
name: "MEATER firmware"
id: meater_firmware

sensor:
- platform: ble_client
type: characteristic
ble_client_id: meater
name: "MEATER tip temperature"
service_uuid: 'a75cc7fc-c956-488f-ac2a-2dbc08b63a04'
characteristic_uuid: '7edda774-045e-4bbf-909b-45d1991a2876'
icon: 'mdi:thermometer'
unit_of_measurement: '°C'
accuracy_decimals: 2
notify: true
lambda: |-
uint16_t tip_temp = (x[0] + (x[1] << 8) + 8.0) / 16.0;
return (float)tip_temp;
- platform: ble_client
type: characteristic
ble_client_id: meater
name: "MEATER ambient temperature"
service_uuid: 'a75cc7fc-c956-488f-ac2a-2dbc08b63a04'
characteristic_uuid: '7edda774-045e-4bbf-909b-45d1991a2876'
icon: 'mdi:thermometer'
unit_of_measurement: '°C'
accuracy_decimals: 2
notify: true
lambda: |-
uint16_t tip = x[0] + (x[1] << 8);
uint16_t ra = x[2] + (x[3] << 8);
uint16_t oa = x[4] + (x[5] << 8);
uint16_t min_val = 48;
uint16_t ambient = (tip + std::max(0, (((ra - std::min(min_val, oa)) * 16 * 589) / 1487)) + 8.0) / 16;
return (float)ambient;
- platform: ble_client
type: characteristic
ble_client_id: meater
name: "MEATER battery level"
service_uuid: 'a75cc7fc-c956-488f-ac2a-2dbc08b63a04'
characteristic_uuid: '2adb4877-68d8-4884-bd3c-d83853bf27b8'
icon: 'mdi:battery'
unit_of_measurement: '%'
notify: true
lambda: |-
uint16_t battery = (x[0] + x[1]) * 10;
return (float)battery;
- platform: ble_client
type: characteristic
ble_client_id: meater
id: firmware
service_uuid: '180A'
characteristic_uuid: '00002a26-0000-1000-8000-00805f9b34fb'
lambda: |-
std::string data_string(x.begin(), x.end());
id(meater_firmware).publish_state(data_string.c_str());
return (float)x.size();
- platform: ble_client
type: rssi
ble_client_id: meater
name: "MEATER RSSI"
15 changes: 0 additions & 15 deletions packages/garage_door.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@ automation:
service: homeassistant.turn_off
entity_id: switch.garage_lights

- alias: "Turn on garage light when motor light switches"
id: "garage_laser_trip"
trigger:
- platform: state
entity_id: binary_sensor.garage_motor_light_status
from: "off"
to: "on"
condition:
- condition: state
entity_id: switch.garage_lights
state: "off"
action:
service: homeassistant.turn_on
entity_id: switch.garage_lights

- alias: "Change entry switch LEDs based on garage door state"
id: "garage_opened_switch_leds"
trigger:
Expand Down
16 changes: 1 addition & 15 deletions scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,7 @@ home_occupied:
- group.under_cabinet_lights
- group.christmas # dining, office, master tree follow 'on' via appdaemon
- switch.master_bedroom_christmas_tree # manually turn on because of goodnight script
- if: "{{ now().hour <= 7 or now().hour >= 21 }}"
then:
- service: cover.close_cover
target:
entity_id:
- cover.office_blind_left
- cover.office_blind_right
- if: "{{ states('input_boolean.guest_mode') == 'off' }}"
then:
- service: cover.close_cover
target:
entity_id:
- cover.guest_bedroom_blinds

############
# SECURITY #
############
Expand Down Expand Up @@ -157,8 +145,6 @@ master_bedroom_bedtime:
- service: cover.close_cover
target:
entity_id:
- cover.office_blind_left # Christmas
- cover.dining_room_blinds
- service: script.turn_on # Calling this way allows the sequence to continue without blocking
entity_id: script.christmas_goodnight

Expand Down

0 comments on commit 28f47ae

Please sign in to comment.