Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- captive_portal:
- web_server:
- port: 80
- text_sensor:
- - platform: wifi_info
- ip_address:
- name: BarnCtrl1 IP Address
- ssid:
- name: BarnCtrl1 Connected SSID
- bssid:
- name: BarnCtrl1 Connected BSSID
- mac_address:
- name: BarnCtrl1 Mac Address
- scan_results:
- name: BarnCtrl1 Latest Scan Results
- - platform: template
- name: Uptime
- id: uptime_human_barn_sensor
- icon: mdi:clock-start
- - platform: template
- name: "Overhead Text"
- id: template_text
- sensor:
- - platform: uptime #Uptime in Seconds
- name: BarnCtrl Uptime Sensor
- id: uptime_sensor_barn
- update_interval: 240s
- internal: True
- on_raw_value:
- then:
- - text_sensor.template.publish:
- id: uptime_human_barn_sensor
- state: !lambda |-
- int seconds = round(id(uptime_sensor_barn).raw_state);
- int days = seconds / (24 * 3600);
- seconds = seconds % (24 * 3600);
- int hours = seconds / 3600;
- seconds = seconds % 3600;
- int minutes = seconds / 60;
- seconds = seconds % 60;
- return (
- (days ? String(days) + "d " : "") +
- (hours ? String(hours) + "h " : "") +
- (minutes ? String(minutes) + "m " : "") +
- (String(seconds) + "s")
- ).c_str();
- - platform: wifi_signal
- name: "WiFi Signal dB"
- id: wifi_signal_db
- update_interval: 300s
- entity_category: "diagnostic"
- - platform: copy
- source_id: wifi_signal_db
- name: "Barn Sensors WiFi"
- id: barn_sensors_wifi
- filters:
- - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
- unit_of_measurement: "Signal %"
- entity_category: "diagnostic"
- switch:
- - platform: template
- name: "Cover Switch"
- id: cover_switch
- internal: true
- #restore_state: false
- turn_on_action:
- - homeassistant.service:
- service: switch.toggle
- data:
- entity_id: switch.overhead_door_barn_overhead
- - platform: gpio
- name: 'Barn Siren'
- id: siren
- pin:
- number: 1
- mode:
- output: true
- #inverted: true
- inverted: true
- cover:
- - platform: feedback
- name: "Overhead"
- id: overhead_2
- has_built_in_endstop: true
- max_duration: 17s
- open_action:
- - switch.toggle: cover_switch
- - text_sensor.template.publish:
- id: template_text
- state: "Opening"
- open_duration: 16s
- open_endstop: top_reed_switch
- #open_sensor: open_movement_binary_sensor
- close_action:
- - switch.toggle: cover_switch
- - text_sensor.template.publish:
- id: template_text
- state: "Closing"
- close_duration: 16s
- close_endstop: bot_reed_switch
- #close_sensor: close_movement_binary_sensor
- stop_action:
- - switch.turn_off: cover_switch
- - text_sensor.template.publish:
- id: template_text
- state: "Stopped/Idle"
- button:
- - platform: restart
- name: "Barn Sensors Restart"
- - platform: safe_mode
- name: "Barn Sensors (Safe Mode)"
- binary_sensor:
- - platform: gpio
- pin:
- number: D1
- mode: INPUT_PULLUP
- inverted: true
- id: top_reed_switch
- name: "top reed"
- # filters:
- # delayed_on: 16s
- on_state:
- if:
- condition:
- binary_sensor.is_on: top_reed_switch
- then:
- - text_sensor.template.publish:
- id: template_text
- state: "Open"
- - platform: gpio
- pin:
- number: D5
- mode: INPUT_PULLUP
- # inverted: true
- id: bot_reed_switch
- name: "Bottom Reed"
- # filters:
- # delayed_off: 16s
- on_state:
- if:
- condition:
- binary_sensor.is_on: bot_reed_switch
- then:
- - text_sensor.template.publish:
- id: template_text
- state: "Closed"
- - platform: gpio
- pin:
- number: D7
- mode:
- input: true
- pullup: true
- inverted: true
- name: "Stand-up Freezer"
- device_class: Door
- - platform: gpio
- pin:
- number: D6
- mode:
- input: true
- pullup: true
- inverted: true
- name: "Black Deep Freezer"
- device_class: Door
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement