From a0e784abe45e120d5f93f497029a592267f39569 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Fri, 3 Apr 2020 21:56:28 -0400 Subject: [PATCH] Replaced the weekday package with a single sensor --- config/packages/weekday.yaml | 162 ----------------------------------- config/sensors/house.yaml | 10 ++- 2 files changed, 9 insertions(+), 163 deletions(-) delete mode 100755 config/packages/weekday.yaml diff --git a/config/packages/weekday.yaml b/config/packages/weekday.yaml deleted file mode 100755 index a895873..0000000 --- a/config/packages/weekday.yaml +++ /dev/null @@ -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 diff --git a/config/sensors/house.yaml b/config/sensors/house.yaml index 636697c..412286b 100755 --- a/config/sensors/house.yaml +++ b/config/sensors/house.yaml @@ -47,6 +47,12 @@ - platform: mqtt name: "COVID PV Critical" 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 name: "COVID Current Confirmed" state_topic: "covid/sensor/current_confirmed" @@ -289,5 +295,7 @@ hvac_action: friendly_name: '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()] }}"