Replaced the weekday package with a single sensor

This commit is contained in:
Jeffrey Stone 2020-04-03 21:56:28 -04:00
parent fe99c3c00a
commit a0e784abe4
2 changed files with 9 additions and 163 deletions

View File

@ -1,162 +0,0 @@
###############################################################################
# @author : Jeffrey Stone
# @date : 02/19/2019
# @package : Weekday
# @description : Weekday Sensor for use as a condition in automations and scripts
###############################################################################
sensor:
- platform: mqtt
name: weekday
state_topic: "house/week/day"
script:
monday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: mon
retain: true
tuesday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: tue
retain: true
wednesday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: wed
retain: true
thursday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: thu
retain: true
friday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: fri
retain: true
saturday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: sat
retain: true
sunday:
sequence:
- service: mqtt.publish
data:
topic: house/week/day
payload: sun
retain: true
automation:
- alias: set weekday mon
initial_state: true
trigger:
- platform: time
at: 00:00:01
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- mon
action:
- service: script.monday
id: set_weekday_mon
- alias: set weekday tue
initial_state: true
trigger:
- platform: time
at: 00:00:01
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- tue
action:
- service: script.tuesday
id: set_weekday_tue
- alias: set weekday wed
initial_state: true
trigger:
- platform: time
at: 00:00:01
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- wed
action:
- service: script.wednesday
id: set_weekday_wed
- alias: set weekday thu
initial_state: true
trigger:
- platform: time
at: '00:00:01'
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- thu
action:
- service: script.thursday
id: set_weekday_thu
- alias: set weekday fri
initial_state: true
trigger:
- platform: time
at: '00:00:01'
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- fri
action:
- service: script.friday
id: set_weekday_fri
- alias: set weekday sat
initial_state: true
trigger:
- platform: time
at: '00:00:01'
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- sat
action:
- service: script.saturday
id: set_weekday_sat
- alias: set weekday sun
initial_state: true
trigger:
- platform: time
at: '00:00:01'
- platform: homeassistant
event: start
condition:
- condition: time
weekday:
- sun
action:
- service: script.sunday
id: set_weekday_sun

View File

@ -47,6 +47,12 @@
- platform: mqtt - platform: mqtt
name: "COVID PV Critical" name: "COVID PV Critical"
state_topic: "covid/sensor/previous_critical_cases" state_topic: "covid/sensor/previous_critical_cases"
- platform: mqtt
name: "COVID Old New Count"
state_topic: "covid/sensor/old_new_cases"
- platform: mqtt
name: "COVID Old Dead Count"
state_topic: "covid/sensor/old_new_dead"
- platform: mqtt - platform: mqtt
name: "COVID Current Confirmed" name: "COVID Current Confirmed"
state_topic: "covid/sensor/current_confirmed" state_topic: "covid/sensor/current_confirmed"
@ -289,5 +295,7 @@
hvac_action: hvac_action:
friendly_name: 'HVAC Action' friendly_name: 'HVAC Action'
value_template: "{{states.climate.home.attributes.hvac_action}}" value_template: "{{states.climate.home.attributes.hvac_action}}"
today_is:
friendly_name: 'Today is'
value_template: "{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}"