Skip to content

Commit

Permalink
Merge pull request #99 from Roving-Ronin/Add-MDI-Icons-SmartPlugV1
Browse files Browse the repository at this point in the history
Smart Plug v1 - Add MDI icons to sensors missing them
  • Loading branch information
tarontop authored Jan 3, 2025
2 parents 8b92cf9 + 49c8c2b commit 992c1c8
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion athom-smart-plug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ substitutions:
ipv6_enable: "false"
# Hide the ENERGY sensor that shows kWh consumed, but with no time period associated with it. Resets when device restarted and reflashed.
hide_energy_sensor: "true"
# Power plug icon selection. Change to reflect the type/country of powr plug in use, this will update the power plug icon shown next to the switch
power_plug_type: "power-socket-us" # Options: power-socket-au | power-socket-ch | power-socket-de | power-socket-eu | power-socket-fr | power-socket-it | power-socket-jp | power-socket-uk | power-socket-us |

########################## End of Substitutions #########################

esphome:
name: "${name}"
friendly_name: "${friendly_name}"
Expand Down Expand Up @@ -84,6 +88,7 @@ mdns:

web_server:
port: 80
# version: 3

network:
enable_ipv6: ${ipv6_enable}
Expand Down Expand Up @@ -122,6 +127,7 @@ select:
name: "Power On State"
id: "power_mode"
optimistic: true
icon: mdi:electric-switch
options:
- Always Off
- Always On
Expand All @@ -134,6 +140,7 @@ select:
binary_sensor:
- platform: status
name: "Status"
icon: mdi:check-network-outline
entity_category: diagnostic

- platform: gpio
Expand Down Expand Up @@ -193,6 +200,7 @@ sensor:
id: current
unit_of_measurement: A
accuracy_decimals: 2
icon: mdi:current-ac
filters:
- calibrate_linear:
- 0.0000 -> 0.0110 # Relay off no load
Expand All @@ -215,6 +223,7 @@ sensor:
id: voltage
unit_of_measurement: V
accuracy_decimals: 1
icon: mdi:sine-wave
filters:
- skip_initial: 2

Expand All @@ -223,6 +232,7 @@ sensor:
id: socket_my_power
unit_of_measurement: W
accuracy_decimals: 1
icon: mdi:power
filters:
- calibrate_linear:
- 0.0000 -> 0.5900 # Relay off no load
Expand All @@ -242,6 +252,7 @@ sensor:
energy:
name: "Energy"
id: energy
icon: mdi:lightning-bolt
unit_of_measurement: kWh
accuracy_decimals: 3
filters:
Expand All @@ -264,7 +275,7 @@ sensor:
unit_of_measurement: kWh
device_class: "energy"
state_class: "total_increasing"
icon: "mdi:lightning-bolt"
icon: mdi:lightning-bolt
accuracy_decimals: 3
lambda: |-
return id(total_energy);
Expand All @@ -274,6 +285,7 @@ sensor:
name: "Total Energy Since Boot"
power_id: socket_my_power
unit_of_measurement: kWh
icon: mdi:hours-24
accuracy_decimals: 3
restore: true
filters:
Expand All @@ -294,18 +306,21 @@ sensor:
# energy_yesterday:
# name: "Total Energy Yesterday"
# id: total_energy_yesterday
# icon: mdi:calendar-today
# accuracy_decimals: 3

# # Dentra Components - Adds Energy Week
# energy_week:
# name: "Total Energy Week"
# id: total_energy_week
# icon: mdi:calendar-week
# accuracy_decimals: 3

# # Dentra Components - Adds Energy Month
# energy_month:
# name: "Total Energy Month"
# id: total_energy_month
# icon: mdi:calendar-month
# accuracy_decimals: 3

button:
Expand All @@ -329,6 +344,7 @@ switch:
pin: GPIO14
id: relay
restore_mode: ${relay_restore_mode}
icon: mdi:${power_plug_type}
on_turn_on:
- light.turn_on: blue_led

Expand All @@ -339,6 +355,7 @@ light:
- platform: status_led
name: "Status LED"
id: blue_led
icon: mdi:lightbulb-outline
disabled_by_default: true
pin:
inverted: true
Expand All @@ -348,12 +365,15 @@ text_sensor:
- platform: wifi_info
ip_address:
name: "IP Address"
icon: mdi:ip-network
entity_category: diagnostic
ssid:
name: "Connected SSID"
icon: mdi:wifi-strength-2
entity_category: diagnostic
mac_address:
name: "Mac Address"
icon: mdi:network-pos
entity_category: diagnostic

# Creates a sensor showing when the device was last restarted
Expand Down

0 comments on commit 992c1c8

Please sign in to comment.