Advertisement
ddogman

esphome pulse meter sample

Aug 18th, 2022
960
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 6.27 KB | None | 0 0
  1. substitutions:
  2.   device_name: "Konyha"
  3.  
  4. esphome:
  5.   name: kitchen
  6.   comment: Konyha ESP32 controller
  7.   project:
  8.     name: "Peti.Konyha szenzor"
  9.     version: "0.2.0"
  10.    
  11. esp32:
  12.   board: esp32dev
  13.   framework:
  14.     type: arduino
  15.    
  16. web_server:
  17.   port: 80
  18.  
  19. # Enable logging
  20. logger:
  21.   level: ERROR
  22.  
  23. # Enable Home Assistant API
  24. api:
  25.   encryption:
  26.     key: "xxxxxxxxxxxxxxxxxxxxx"
  27.  
  28. ota:
  29.   password: "xxxxxxxxxxxxxxxxxxxxx"
  30.  
  31. wifi:
  32.   ssid: !secret wifi_ssid
  33.   password: !secret wifi_password
  34.  
  35.   manual_ip:
  36.    # Set this to the IP of the ESP
  37.     static_ip: xxx.xxx.xxx.xxx
  38.     # Set this to the IP address of the router. Often ends with .1
  39.     gateway: xxx.xxx.xxx.xxx
  40.     # The subnet of the network. 255.255.255.0 works for most home networks.
  41.     subnet: 255.255.255.0
  42.    
  43.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  44.   ap:
  45.     ssid: "Kitchen Fallback Hotspot"
  46.     password: !secret wifi_ap_password
  47.    
  48.   #use_address: xxx.xxx.xxx.xxx
  49.  
  50. time:
  51.   - platform: sntp
  52.     timezone: "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00" # Europe/Budapest -> https://sites.google.com/a/usapiens.com/opnode/time-zones
  53.     id: my_time
  54.  
  55. captive_portal:
  56. text_sensor:
  57.   - platform: wifi_info
  58.     ip_address:
  59.       name: "IP Address"
  60.     ssid:
  61.       name: "Connected SSID"
  62.     bssid:
  63.       name: "Connected BSSID"
  64.     mac_address:
  65.       name: "Mac Wifi Address"
  66.     scan_results:
  67.       name: "Latest Scan Results"
  68.  
  69. button:
  70.   - platform: restart
  71.     name: "Konyha Restart"
  72.    
  73.   - platform: template
  74.     name: "Teszt gomb"
  75.     id: my_button
  76.     # Optional variables:
  77.     icon: "mdi:emoticon-outline"
  78.     on_press:
  79.       - logger.log: "Teszt Button pressed"
  80.      
  81. binary_sensor:
  82.   - platform: gpio
  83.     pin: GPIO21
  84.     name: "Toggle Light1"
  85.     internal: true
  86.     filters:
  87.       - delayed_on: 10ms
  88.       - delayed_off: 10ms
  89.     on_click:
  90.       min_length: 50ms
  91.       max_length: 350ms
  92.       then:
  93.         - light.toggle: light1
  94.         - logger.log: "Clicked"
  95.  
  96. sensor:
  97.   - platform: uptime
  98.     name: ${device_name} Uptime
  99.     filters:
  100.       - lambda: return x / 3600;
  101.     unit_of_measurement: "hours"
  102.     accuracy_decimals: 2
  103.     update_interval: 300s
  104.  
  105.   - platform: wifi_signal
  106.     id: wifi_rssi
  107.     name: "RSSI"
  108.     update_interval: 120s
  109.  
  110.   # hőmérő: konyha bent, DHT11
  111.   - platform: dht
  112.     pin: GPIO33
  113.     temperature:
  114.       id: kitchen_temperature
  115.       name: "Kitchen Temperature"
  116.       filters:
  117.         - offset: -1.5
  118.     humidity:
  119.       id: kitchen_humidity
  120.       name: "Kitchen Humidity"
  121.     model: DHT22
  122.     update_interval: 60s
  123.  
  124.   # hőmérő: bejárat kint, DHT22
  125.   - platform: dht
  126.     pin: GPIO32
  127.     temperature:
  128.       id: outdoor_temperature
  129.       name: "Outdoor Temperature"
  130.       filters:
  131.         - offset: -1.5
  132.     humidity:
  133.       id: outdoor_humidity
  134.       name: "Outdoor Humidity"
  135.     model: DHT22
  136.     update_interval: 60s
  137.    
  138.    
  139.    
  140.    
  141.   # Fogyasztásmérő: Boiler (bojler)
  142.   - platform: pulse_meter
  143.     id: meter_power_boiler
  144.     state_class: total_increasing
  145.     device_class: power
  146.     pin: GPIO35
  147.     unit_of_measurement: 'kW'
  148.     name: 'Boiler Energy Usage'
  149.     internal_filter: 100ms
  150.     accuracy_decimals: 3
  151.     timeout: 60s
  152.     filters:
  153.       - multiply: 0.06
  154.   - platform: total_daily_energy
  155.     name: "Boiler Energy Total Daily"
  156.     accuracy_decimals: 2
  157.     power_id: meter_power_boiler
  158.     unit_of_measurement: "kWh"
  159.     device_class: energy
  160.     min_save_interval: 120s
  161.    
  162.    
  163.   # Fogyasztásmérő: AC (klíma)
  164.   - platform: pulse_meter
  165.     id: meter_power_ac
  166.     state_class: total_increasing
  167.     device_class: power
  168.     pin: GPIO39
  169.     unit_of_measurement: 'kW'
  170.     name: 'AC Energy Usage'
  171.     internal_filter: 100ms
  172.     accuracy_decimals: 3
  173.     timeout: 60s
  174.     filters:
  175.       - multiply: 0.06
  176.   - platform: total_daily_energy
  177.     name: "AC Energy Total Daily"
  178.     accuracy_decimals: 2
  179.     power_id: meter_power_ac
  180.     unit_of_measurement: "kWh"
  181.     device_class: energy
  182.     min_save_interval: 120s
  183.    
  184.    
  185.    
  186.   # Fogyasztásmérő: Stove (tűzhely)
  187.   - platform: pulse_meter
  188.     id: meter_power_stove
  189.     state_class: total_increasing
  190.     device_class: power
  191.     pin: GPIO34
  192.     unit_of_measurement: 'kW'
  193.     name: 'Stove Energy Usage'
  194.     internal_filter: 100ms
  195.     accuracy_decimals: 3
  196.     timeout: 60s
  197.     filters:
  198.       - multiply: 0.06
  199.   - platform: total_daily_energy
  200.     name: "Stove Energy Total Daily"
  201.     accuracy_decimals: 2
  202.     power_id: meter_power_stove
  203.     unit_of_measurement: "kWh"
  204.     device_class: energy
  205.     min_save_interval: 120s
  206.    
  207.   # Fogyasztásmérő: Incoming (teljes bejövő)
  208.   - platform: pulse_meter
  209.     id: meter_power_incoming
  210.     state_class: total_increasing
  211.     device_class: power
  212.     pin: GPIO36
  213.     unit_of_measurement: 'kW'
  214.     name: 'Incoming Energy Usage'
  215.     internal_filter: 100ms
  216.     accuracy_decimals: 3
  217.     timeout: 60s
  218.     filters:
  219.       - multiply: 0.06
  220.   - platform: total_daily_energy
  221.     name: "Incoming Energy Total Daily"
  222.     accuracy_decimals: 2
  223.     power_id: meter_power_incoming
  224.     unit_of_measurement: "kWh"
  225.     device_class: energy
  226.     min_save_interval: 120s
  227.    
  228. # Example configuration entry
  229. output:
  230.   - platform: ledc
  231.     pin: GPIO25
  232.     id: gpio_25
  233.     frequency: "2441Hz"
  234.        
  235.   - platform: ledc
  236.     pin: GPIO26
  237.     id: gpio_26
  238.     frequency: "2441Hz"
  239.  
  240. # Example usage in a light
  241. light:
  242.   - platform: monochromatic
  243.     output: gpio_25
  244.     name: "Kitchen Light1"
  245.     id: light1
  246.     effects:
  247.       - pulse:
  248.       - pulse:
  249.           name: "Fast Pulse"
  250.           transition_length: 0.5s
  251.           update_interval: 0.5s
  252.       - pulse:
  253.           name: "Slow Pulse"
  254.           # transition_length: 1s      # defaults to 1s
  255.           update_interval: 2s
  256.       - flicker:
  257.       - random:
  258.       - strobe:
  259.   - platform: monochromatic
  260.     output: gpio_26
  261.     name: "Kitchen Light2"
  262.     id: light2
  263.     effects:
  264.       - pulse:
  265.       - pulse:
  266.           name: "Fast Pulse"
  267.           transition_length: 0.5s
  268.           update_interval: 0.5s
  269.       - pulse:
  270.           name: "Slow Pulse"
  271.           # transition_length: 1s      # defaults to 1s
  272.           update_interval: 2s
  273.       - flicker:
  274.       - random:
  275.       - strobe:
  276.      
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement