Giter Site home page Giter Site logo

usb-tablet-phone-charger's Introduction

USB-Tablet-Phone-Charger

Info and ESPHome code for my USB Tablet and Phone Charger project

Watch the full build and coding tutorial here: https://youtu.be/4Ufxa1Fz5ko

esphome:
  name: charger-tablet # Use this to name your device
  platform: ESP8266
  board: d1_mini

logger:
  logs:
    sensor: none
    light: none
api:
ota:

substitutions:
  device: Tablet

# Set your Wi-Fi Name and Password
wifi:
  ssid: !secret ssid
  password: !secret wifi_password

switch:
  - platform: gpio
    name: ${device} Charger
    pin: D2
    id: mos
    icon: mdi:usb-port
    on_turn_on:
      then:
        light.turn_on:
          id: led
          effect: "pulse"
    on_turn_off:
      then:
        light.turn_off: led          


sensor:
  - platform: homeassistant
    entity_id: sensor.nexus_7_battery_level # Change this to your 'Battery Level' sensor from the APP
    id: battery
    internal: true
    filters:
      - heartbeat: 10s
    on_value:
      - if:
          condition:
              - lambda: "return id(battery).state < 70;" # '70' is the lower level, change if needed
          then:
            - switch.turn_on: mos
          else:
            - if:
                condition:
                  - lambda: "return id(battery).state > 80 ;" # '80' is the upper level, change if needed
                then:
                  - switch.turn_off: mos

light:
  - platform: monochromatic
    id: led
    output: ledout
    effects:
      - pulse:
          name: pulse
          transition_length: 1s
          update_interval: 1s          
output:
  - platform: esp8266_pwm
    id: ledout
    inverted: true
    pin: D4

๐ŸŽ Found this useful or want to say 'thanks' and support my efforts...

BMC And leave a me a message to let me know. โค

๐Ÿบ CHEERS! ๐Ÿ‘

usb-tablet-phone-charger's People

Contributors

3ative avatar

Watchers

James Cloos avatar

Forkers

giuseppe-p

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.