mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-20 12:10:28 +00:00
You can find the entire repo here.
This commit is contained in:
148
config/www/custom_ui/floorplan/clock.yaml
Executable file
148
config/www/custom_ui/floorplan/clock.yaml
Executable file
@@ -0,0 +1,148 @@
|
||||
page_id: clock
|
||||
image: /local/custom_ui/floorplan/clock.svg
|
||||
stylesheet: /local/custom_ui/floorplan/clock.css
|
||||
|
||||
variables:
|
||||
- name: floorplan.hours
|
||||
- name: floorplan.minutes
|
||||
|
||||
defaults:
|
||||
hover_over: false
|
||||
more_info: false
|
||||
|
||||
rules:
|
||||
|
||||
- element: floorplan.clock_button
|
||||
action:
|
||||
service: floorplan.page_navigate
|
||||
data:
|
||||
page_id: clock_config
|
||||
|
||||
- entity: sensor.clock_stacey_alarm_time
|
||||
text_template: '${entity.state ? entity.state.slice(0, 5) : "00:00"}'
|
||||
|
||||
|
||||
- entity: input_boolean.clock_snooze
|
||||
image_template: '/local/custom_ui/floorplan/buttons/${(entity.state === "on") ? "snooze_on" : "snooze"}.svg'
|
||||
action:
|
||||
service: input_boolean.toggle
|
||||
data:
|
||||
entity_id: input_boolean.clock_snooze
|
||||
|
||||
- entity: input_boolean.school_mode
|
||||
image_template: '/local/custom_ui/floorplan/buttons/${(entity.state === "on") ? "school_on" : "school_off"}.svg'
|
||||
action:
|
||||
service: input_boolean.toggle
|
||||
data:
|
||||
entity_id: input_boolean.school_mode
|
||||
|
||||
- entity: media_player.alarm_clock
|
||||
image_template: '/local/custom_ui/floorplan/buttons/${(entity.state === "playing") ? "stop" : "radio_on"}.svg'
|
||||
action:
|
||||
service_template: '${(entity.state === "playing") ? "media_player.media_stop" : "media_player.play_media"}'
|
||||
data:
|
||||
media_content_id: http://listen.djcmedia.com:80/americascountryhigh
|
||||
media_content_type: audio/mp4
|
||||
|
||||
- name: thermostats_temp
|
||||
entities:
|
||||
- climate.downstairs
|
||||
- climate.upstairs
|
||||
text_template: '${entity.attributes.current_temperature ? Math.ceil(entity.attributes.current_temperature) + "°": "undefined"}'
|
||||
class_template: 'return "static-temp";'
|
||||
|
||||
- name: temp_darksky
|
||||
entities:
|
||||
- sensor.dark_sky_temperature
|
||||
text_template: '${entity.state ? Math.ceil(entity.state) + "°": "undefined"}'
|
||||
class_template: 'return "static-temp";'
|
||||
|
||||
- name: text_states
|
||||
entities:
|
||||
- sensor.dark_sky_minutely_summary
|
||||
hover_over: false
|
||||
more_info: false
|
||||
text_template: '${entity.state ? entity.state : "undefined"}'
|
||||
class_template: 'return "static-text";'
|
||||
|
||||
- name: text_font_date
|
||||
entities:
|
||||
- sensor.clock_date
|
||||
- sensor.clock_day
|
||||
hover_over: false
|
||||
more_info: false
|
||||
text_template: '${entity.state ? entity.state : "undefined"}'
|
||||
class_template: 'return "static-text-date";'
|
||||
|
||||
- name: text_font_time
|
||||
entities:
|
||||
- sensor.clock_time
|
||||
hover_over: false
|
||||
more_info: false
|
||||
text_template: '${entity.state ? entity.state : "undefined"}'
|
||||
class_template: 'return "static-text-time";'
|
||||
|
||||
- name: text_font_am_pm
|
||||
entities:
|
||||
- sensor.clock_am_pm
|
||||
hover_over: false
|
||||
more_info: false
|
||||
text_template: '${entity.state ? entity.state : "undefined"}'
|
||||
class_template: 'return "static-text-am_pm";'
|
||||
|
||||
|
||||
# - name: Presence
|
||||
# entities:
|
||||
# - binary_sensor.sleepnumber_carlo_carlo_is_in_bed
|
||||
# - binary_sensor.sleepnumber_carlo_stacey_is_in_bed
|
||||
# states:
|
||||
# - state: 'on'
|
||||
# class: 'presence-on'
|
||||
# - state: 'off'
|
||||
# class: 'presence-off'
|
||||
|
||||
- name: Dark Sky Sensors
|
||||
entities:
|
||||
- entity: sensor.dark_sky_minutely_summary
|
||||
element: sensor.dark_sky_minutely_summary_icon
|
||||
|
||||
image_template: '
|
||||
var imageName = "";
|
||||
|
||||
switch (entity.attributes.entity_picture) {
|
||||
case "/static/images/darksky/weather-sunny.svg":
|
||||
imageName = "sunny-1";
|
||||
break;
|
||||
|
||||
case "/static/images/darksky/weather-night.svg":
|
||||
imageName = "night-1";
|
||||
break;
|
||||
|
||||
case "/static/images/darksky/weather-partlycloudy.svg":
|
||||
imageName = "partlycloudy-day-1";
|
||||
break;
|
||||
|
||||
case "/static/images/darksky/weather-cloudy.svg":
|
||||
imageName = "partlycloudy-night-1";
|
||||
break;
|
||||
|
||||
case "/static/images/darksky/weather-cloudy.svg":
|
||||
imageName = "cloudy-day-1";
|
||||
break;
|
||||
|
||||
case "/static/images/darksky/weather-pouring.svg":
|
||||
imageName = "thunder";
|
||||
break;
|
||||
|
||||
case "/static/images/darksky/weather-snowy.svg":
|
||||
imageName = "snowy-day-1";
|
||||
break;
|
||||
}
|
||||
|
||||
return "/local/custom_ui/floorplan/images/weather/" + imageName + ".svg";
|
||||
'
|
||||
|
||||
- name: Camera Images
|
||||
entities:
|
||||
- camera.stone_door
|
||||
image_template: '${entity.attributes.entity_picture}'
|
Reference in New Issue
Block a user