├── groups.yaml ├── packages ├── panels.yaml ├── integrations │ ├── zha.yaml │ ├── custom_templates.yaml │ ├── wol.yaml │ ├── feedreader.yaml │ ├── KidsChores │ │ ├── kc_dashboard_uihelpers.yaml │ │ └── kc_auto_approve.yaml │ ├── telegram.yaml │ ├── system_health.yaml │ ├── pyscript.yaml │ ├── quest.yaml │ ├── smartir.yaml │ ├── android_tv.yaml │ ├── mqtt.yaml │ ├── hass_agent.yaml │ └── bluetooth.yaml ├── drop-in │ ├── write_file.yaml │ └── wled_set_colors.yaml ├── services │ └── debug_notification.yaml ├── automation │ ├── rooms │ │ ├── automations │ │ │ ├── hallway_automations.yaml │ │ │ ├── office_balcony_automations.yaml │ │ │ ├── living_room_balcony_automations.yaml │ │ │ └── bathroom_automations.yaml │ │ ├── state │ │ │ └── room_state.yaml │ │ └── media │ │ │ └── kitchen_media.yaml │ ├── updates.yaml │ ├── device_power │ │ └── device_sleep.yaml │ ├── dishwasher.yaml │ ├── health.yaml │ ├── telegram_yt_dlp.yaml │ ├── illuminance_sensor_filtering.yaml │ ├── guest_mode.yaml │ ├── phone_call.yaml │ └── microwave.yaml ├── logging.yaml └── themes.yaml ├── to_json_list.sh ├── www ├── b.png ├── segoeui.ttf ├── seguibl.ttf ├── seguisb.ttf ├── segoeuib.ttf ├── segoeuil.ttf ├── segoeuisl.ttf ├── blank1050x1680.png ├── blank1680x1050.png ├── blank720x1280.png └── style.css ├── esphome ├── Ubuntu-R.ttf ├── shared │ ├── mini_led_pwm.yaml │ ├── esp32_rgb.yaml │ ├── rgb.yaml │ ├── base.yaml │ ├── h801_pwm.yaml │ └── monochromatic_effects.yaml ├── microovn.yaml ├── pc_afbryder.yaml ├── projector_power.yaml ├── stue_tv_afbryder.yaml ├── 3d_printer_power.yaml ├── aircondition_afbryder.yaml ├── hobbybord-afbryder.yaml ├── packages │ ├── base.yaml │ └── btle_trackers.yaml ├── gang_bt_proxy.yaml ├── stue_bt_proxy.yaml ├── sovevaerelse_bt_proxy.yaml ├── ismaskine.yaml ├── bed_table.yaml ├── hallway_cupboard.yaml ├── kontor_bt_proxy.yaml ├── lyskaede.yaml ├── kitchen_stove.yaml ├── kitchen_sink.yaml ├── usb_switch_2.yaml ├── usb_switch_3.yaml ├── gang_tablet_lader.yaml ├── kokken_tablet_lader.yaml ├── door_spy.yaml ├── bedroom_shelf.yaml ├── 3d_printer_filament_camera.yaml ├── 3d_printer_enclosure.yaml ├── krydderurter.yaml ├── doorbell.yaml └── party_button.yaml ├── lovelace ├── decluttering_templates │ ├── thermostat.yaml │ ├── grouped_media_player.yaml │ ├── app_shortcut.yaml │ ├── room_state_and_light_profile.yaml │ ├── light_group.yaml │ ├── temp_graph_button.yaml │ ├── thermostat_state.yaml │ ├── compact_thermostat.yaml │ ├── set_browser_id.yaml │ ├── sonos_group_button.yaml │ ├── temp_graph_button_with_radiator.yaml │ ├── room_climate.yaml │ ├── sonos_group_buttons.yaml │ ├── room_state.yaml │ ├── light_groups.yaml │ ├── room_climate_with_thermostat.yaml │ ├── simple_thermostat.yaml │ └── vertical_thermostat.yaml ├── cards │ ├── hoveddor.yaml │ ├── weather │ │ ├── weather.yaml │ │ ├── weather_radar.yaml │ │ ├── weather_radar_small.yaml │ │ ├── dmi_kommende_varsler.yaml │ │ ├── dmi_aktuelle_varsler.yaml │ │ ├── dmi_weather.yaml │ │ ├── dmi_weather_report.yaml │ │ ├── simple_weather.yaml │ │ ├── temp_graph.yaml │ │ ├── dmi_weather_warnings.yaml │ │ └── weather_forecast.yaml │ ├── bathroom_occupied.yaml │ ├── bathroom_occupied_small.yaml │ ├── lights │ │ ├── rooms │ │ │ ├── balcony.yaml │ │ │ ├── hallway.yaml │ │ │ ├── workshop.yaml │ │ │ ├── bathroom.yaml │ │ │ ├── kitchen.yaml │ │ │ ├── living_room.yaml │ │ │ ├── office.yaml │ │ │ └── bedroom.yaml │ │ └── theme_button.yaml │ ├── date.yaml │ ├── hoveddor_laas.yaml │ ├── compact_hoveddor_laas.yaml │ ├── vacuum.yaml │ ├── header_cards │ │ └── date_time.yaml │ ├── clock.yaml │ ├── dorklokke.yaml │ ├── time_to_leave_countdown.yaml │ ├── kitchen_timers.yaml │ ├── fridge.yaml │ ├── calendar_work.yaml │ ├── transport │ │ ├── car_parking.yaml │ │ ├── upcoming_travel.yaml │ │ ├── car_destinations.yaml │ │ └── car.yaml │ ├── media_players │ │ ├── active_media_player_currently_playing.yaml │ │ ├── media_shortcuts.yaml │ │ ├── active_media_player_controls.yaml │ │ ├── living_room_media.yaml │ │ └── synx_box_controls.yaml │ ├── climate │ │ ├── target_temperature.yaml │ │ ├── compact_thermostats_3x2.yaml │ │ ├── indoor_sensors.yaml │ │ └── climate_sensors.yaml │ ├── mode_toggles.yaml │ ├── calendar.yaml │ ├── calendar_compact.yaml │ ├── conditional_timers.yaml │ ├── compact_clock.yaml │ ├── energy_prices │ │ └── power_price_graphs.yaml │ ├── gdq │ │ ├── compact_overview.yaml │ │ └── next_to_watch_compact.yaml │ ├── power_gauges_compact.yaml │ ├── mode_toggles_vertical.yaml │ ├── power_gauges.yaml │ ├── low_battery.yaml │ ├── laundry.yaml │ ├── weekday.yaml │ ├── vacuum_controls.yaml │ ├── kettle.yaml │ ├── thermostats.yaml │ ├── printer.yaml │ ├── compact_thermostats.yaml │ └── 3d_printer │ │ └── print_time_graph.yaml └── views │ ├── tablets │ └── living_room_tablet.yaml │ └── default │ └── hallway.yaml ├── custom_sentences └── da │ └── ask_nabu.yaml ├── lovelace-car.yaml ├── lovelace-work.yaml ├── lovelace-gdq.yaml ├── lovelace-3d-printer.yaml ├── lovelace-office-tablet.yaml ├── lovelace-living-room-tablet.yaml ├── podcasts.opml ├── lovelace-bathroom-tablet.yaml ├── lovelace-hallway-tablet.yaml ├── lovelace-kitchen-tablet.yaml ├── customize.yaml ├── lovelace-bedroom-tablet.yaml ├── themes └── mushroom │ ├── mushroom.yaml │ ├── mushroom-shadow.yaml │ ├── mushroom-square.yaml │ └── mushroom-square-shadow.yaml ├── lovelace-3d-printer-preview.yaml ├── scripts.yaml ├── ui-lovelace.yaml ├── blueprints ├── script │ └── mundschenk-at │ │ ├── valetudo-trigger-auto-empty-dock.yaml │ │ └── valetudo-send-vacuum-command.yaml ├── template │ └── homeassistant │ │ └── inverted_binary_sensor.yaml ├── disable_vacuum_camera_update_when_docked.yaml └── automation │ ├── homeassistant │ └── notify_leaving_zone.yaml │ └── andrew-codechimp │ └── battery_notes_battery_replaced.yaml ├── custom_templates ├── osm.jinja ├── geofence.jinja ├── group_totalizer.jinja ├── room_state.jinja ├── gdq.jinja └── light_profile.jinja ├── python_scripts ├── services.yaml └── input_select_set_options.py ├── pyscript └── duplicate_package_names.py ├── lovelace-android-auto.yaml ├── automations.yaml ├── .gitignore └── lovelace-living-room-remote.yaml /groups.yaml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/panels.yaml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /to_json_list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | jq -R -s -c '{ list:split("\n")}' 3 | -------------------------------------------------------------------------------- /www/b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/b.png -------------------------------------------------------------------------------- /www/segoeui.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/segoeui.ttf -------------------------------------------------------------------------------- /www/seguibl.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/seguibl.ttf -------------------------------------------------------------------------------- /www/seguisb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/seguisb.ttf -------------------------------------------------------------------------------- /packages/integrations/zha.yaml: -------------------------------------------------------------------------------- 1 | zha: 2 | zigpy_config: 3 | source_routing: true 4 | -------------------------------------------------------------------------------- /www/segoeuib.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/segoeuib.ttf -------------------------------------------------------------------------------- /www/segoeuil.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/segoeuil.ttf -------------------------------------------------------------------------------- /www/segoeuisl.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/segoeuisl.ttf -------------------------------------------------------------------------------- /esphome/Ubuntu-R.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/esphome/Ubuntu-R.ttf -------------------------------------------------------------------------------- /www/blank1050x1680.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/blank1050x1680.png -------------------------------------------------------------------------------- /www/blank1680x1050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/blank1680x1050.png -------------------------------------------------------------------------------- /www/blank720x1280.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DarkFox/ha-config/HEAD/www/blank720x1280.png -------------------------------------------------------------------------------- /lovelace/decluttering_templates/thermostat.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: thermostat 3 | entity: "[[entity]]" 4 | -------------------------------------------------------------------------------- /esphome/shared/mini_led_pwm.yaml: -------------------------------------------------------------------------------- 1 | - platform: esp8266_pwm 2 | frequency: 200 Hz 3 | pin: GPIO13 4 | id: light_pwm 5 | -------------------------------------------------------------------------------- /packages/integrations/custom_templates.yaml: -------------------------------------------------------------------------------- 1 | custom_templates: 2 | preload_translations: 3 | - en 4 | - da 5 | -------------------------------------------------------------------------------- /packages/drop-in/write_file.yaml: -------------------------------------------------------------------------------- 1 | shell_command: 2 | write_file: >- 3 | echo {{ content|tojson }} > {{ path|tojson }} 4 | -------------------------------------------------------------------------------- /lovelace/cards/hoveddor.yaml: -------------------------------------------------------------------------------- 1 | type: horizontal-stack 2 | cards: 3 | - !include ../cards/dorklokke.yaml 4 | - !include ../cards/hoveddor_laas.yaml 5 | -------------------------------------------------------------------------------- /lovelace/cards/weather/weather.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - !include weather_forecast.yaml 4 | - !include weather_radar.yaml 5 | -------------------------------------------------------------------------------- /lovelace/cards/bathroom_occupied.yaml: -------------------------------------------------------------------------------- 1 | type: "custom:button-card" 2 | entity: binary_sensor.bathroom_occupied 3 | icon: mdi:toilet 4 | show_name: false 5 | template: good_bad 6 | -------------------------------------------------------------------------------- /custom_sentences/da/ask_nabu.yaml: -------------------------------------------------------------------------------- 1 | language: "da" 2 | intents: 3 | AskNabu: 4 | data: 5 | - sentences: 6 | - "Spørg Nabu {query}" 7 | - "Bed Nabu {query}" 8 | -------------------------------------------------------------------------------- /lovelace/cards/bathroom_occupied_small.yaml: -------------------------------------------------------------------------------- 1 | type: "custom:button-card" 2 | entity: binary_sensor.bathroom_occupied 3 | icon: mdi:toilet 4 | size: 50px 5 | show_name: false 6 | template: good_bad 7 | -------------------------------------------------------------------------------- /lovelace/cards/lights/rooms/balcony.yaml: -------------------------------------------------------------------------------- 1 | type: entities 2 | entities: 3 | - type: custom:decluttering-card 4 | template: light_group 5 | variables: 6 | - group: altan_lamper 7 | - name: Lamper 8 | -------------------------------------------------------------------------------- /lovelace/cards/lights/rooms/hallway.yaml: -------------------------------------------------------------------------------- 1 | type: entities 2 | entities: 3 | - type: custom:decluttering-card 4 | template: light_group 5 | variables: 6 | - group: gang_lamper 7 | - name: Lamper 8 | -------------------------------------------------------------------------------- /lovelace/cards/lights/rooms/workshop.yaml: -------------------------------------------------------------------------------- 1 | type: entities 2 | entities: 3 | - type: custom:decluttering-card 4 | template: light_group 5 | variables: 6 | - group: vaerksted_lamper 7 | - name: Lamper 8 | -------------------------------------------------------------------------------- /lovelace-car.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | views: 5 | - !include lovelace/views/car.yaml 6 | -------------------------------------------------------------------------------- /lovelace-work.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | views: 5 | - !include lovelace/views/work.yaml 6 | -------------------------------------------------------------------------------- /lovelace/cards/date.yaml: -------------------------------------------------------------------------------- 1 | type: custom:button-card 2 | entity: sensor.date_text 3 | show_state: true 4 | show_name: false 5 | show_icon: false 6 | styles: 7 | card: 8 | - padding: 0 9 | - font-size: 32pt 10 | -------------------------------------------------------------------------------- /lovelace/cards/lights/rooms/bathroom.yaml: -------------------------------------------------------------------------------- 1 | type: entities 2 | entities: 3 | - type: custom:decluttering-card 4 | template: light_group 5 | variables: 6 | - group: badevaerelse_lamper 7 | - name: Lamper 8 | -------------------------------------------------------------------------------- /lovelace/cards/hoveddor_laas.yaml: -------------------------------------------------------------------------------- 1 | type: custom:button-card 2 | entity: lock.hoveddor_las 3 | show_name: false 4 | size: 40px 5 | tap_action: 6 | action: toggle 7 | lock: 8 | enabled: '[[[ return entity.state === "locked"; ]]]' 9 | -------------------------------------------------------------------------------- /lovelace/cards/compact_hoveddor_laas.yaml: -------------------------------------------------------------------------------- 1 | type: "custom:button-card" 2 | size: 40px 3 | layout: icon_name 4 | entity: lock.hoveddor_las 5 | tap_action: 6 | action: toggle 7 | lock: 8 | enabled: '[[[ return entity.state === "locked"; ]]]' 9 | -------------------------------------------------------------------------------- /esphome/shared/esp32_rgb.yaml: -------------------------------------------------------------------------------- 1 | - platform: rgb 2 | id: $devicename 3 | name: $upper_devicename 4 | red: red_pwm 5 | green: green_pwm 6 | blue: blue_pwm 7 | default_transition_length: 250ms 8 | effects: !include effects.yaml 9 | -------------------------------------------------------------------------------- /esphome/microovn.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: mikroovn 3 | upper_devicename: Mikroovn 4 | restore_mode: ALWAYS_OFF 5 | led_max_power: "1.0" 6 | 7 | packages: 8 | base: !include packages/base.yaml 9 | gosund: !include packages/gosund.yaml 10 | -------------------------------------------------------------------------------- /esphome/shared/rgb.yaml: -------------------------------------------------------------------------------- 1 | - platform: rgb 2 | id: $devicename 3 | name: $upper_devicename 4 | red: red_pwm 5 | green: green_pwm 6 | blue: blue_pwm 7 | gamma_correct: 1.8 8 | default_transition_length: 250ms 9 | effects: !include effects.yaml -------------------------------------------------------------------------------- /lovelace-gdq.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | hide_header: true 6 | 7 | views: 8 | - !include lovelace/views/gdq.yaml 9 | -------------------------------------------------------------------------------- /lovelace/cards/vacuum.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - !include vacuum_controls.yaml 4 | 5 | - type: conditional 6 | conditions: 7 | - entity: input_boolean.vacuum_show_card 8 | state: "on" 9 | card: !include vacuum_map.yaml 10 | -------------------------------------------------------------------------------- /lovelace-3d-printer.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | # kiosk_mode: 5 | # hide_header: true 6 | 7 | views: 8 | - !include lovelace/views/3d_printer.yaml 9 | -------------------------------------------------------------------------------- /esphome/pc_afbryder.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: pc_afbryder 3 | upper_devicename: PC Afbryder 4 | restore_mode: RESTORE_DEFAULT_OFF 5 | led_max_power: "1.0" 6 | 7 | packages: 8 | base: !include packages/base.yaml 9 | gosund: !include packages/gosund.yaml 10 | -------------------------------------------------------------------------------- /esphome/projector_power.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: projector_power 3 | upper_devicename: Projector Afbryder 4 | restore_mode: ALWAYS_OFF 5 | led_max_power: "1.0" 6 | 7 | packages: 8 | base: !include packages/base.yaml 9 | gosund: !include packages/gosund.yaml 10 | -------------------------------------------------------------------------------- /esphome/stue_tv_afbryder.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: stue_tv_afbryder 3 | upper_devicename: Stue TV Afbryder 4 | restore_mode: ALWAYS_OFF 5 | led_max_power: "1.0" 6 | 7 | packages: 8 | base: !include packages/base.yaml 9 | gosund: !include packages/gosund.yaml 10 | -------------------------------------------------------------------------------- /esphome/3d_printer_power.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: 3d_printer_power 3 | upper_devicename: 3D Printer Afbryder 4 | restore_mode: RESTORE_DEFAULT_OFF 5 | led_max_power: "1.0" 6 | 7 | packages: 8 | base: !include packages/base.yaml 9 | gosund: !include packages/gosund.yaml 10 | -------------------------------------------------------------------------------- /esphome/aircondition_afbryder.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: aircondition-afbryder 3 | upper_devicename: Aircondition Afbryder 4 | restore_mode: ALWAYS_OFF 5 | led_max_power: "0.2" 6 | 7 | packages: 8 | base: !include packages/base.yaml 9 | gosund: !include packages/gosund.yaml 10 | -------------------------------------------------------------------------------- /esphome/hobbybord-afbryder.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: hobbybord-afbryder 3 | upper_devicename: Hobbybord Afbryder 4 | restore_mode: RESTORE_DEFAULT_OFF 5 | led_max_power: "1.0" 6 | 7 | packages: 8 | base: !include packages/base.yaml 9 | gosund: !include packages/gosund.yaml 10 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/grouped_media_player.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: custom:mini-media-player 3 | entity: "[[entity]]" 4 | icon: mdi:speaker-wireless 5 | artwork: none 6 | group: true 7 | hide: 8 | controls: true 9 | progress: true 10 | info: true 11 | power: true 12 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/app_shortcut.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: custom:button-card 3 | name: "[[app]]" 4 | icon: "[[icon]]" 5 | size: 50px 6 | tap_action: 7 | action: call-service 8 | service: "rest_command.[[device]]_command" 9 | service_data: 10 | command: "[[app]]=:=open_app" 11 | -------------------------------------------------------------------------------- /packages/integrations/wol.yaml: -------------------------------------------------------------------------------- 1 | wake_on_lan: 2 | 3 | switch: 4 | - platform: wake_on_lan 5 | name: PC 6 | mac: "70-8B-CD-A3-CC-0D" 7 | host: 192.168.32.104 8 | turn_off: 9 | action: hassio.addon_stdin 10 | data: 11 | addon: core_rpc_shutdown 12 | input: desktop-pc 13 | -------------------------------------------------------------------------------- /packages/services/debug_notification.yaml: -------------------------------------------------------------------------------- 1 | script: 2 | debug_notification: 3 | alias: "Debug Notification" 4 | sequence: 5 | - action: persistent_notification.create 6 | data: 7 | message: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}: {{ message }}" 8 | title: "DEBUG: {{ title }}" 9 | -------------------------------------------------------------------------------- /lovelace-office-tablet.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | non_admin_settings: 6 | kiosk: true 7 | 8 | views: 9 | - !include lovelace/views/tablets/office_tablet.yaml 10 | -------------------------------------------------------------------------------- /lovelace-living-room-tablet.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | non_admin_settings: 6 | kiosk: true 7 | 8 | views: 9 | - !include lovelace/views/tablets/living_room_tablet.yaml 10 | -------------------------------------------------------------------------------- /podcasts.opml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lovelace-bathroom-tablet.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | non_admin_settings: 6 | hide_header: true 7 | hide_account: true 8 | 9 | views: 10 | - !include lovelace/views/tablets/bathroom_tablet.yaml 11 | -------------------------------------------------------------------------------- /lovelace-hallway-tablet.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | non_admin_settings: 6 | hide_header: true 7 | hide_account: true 8 | 9 | views: 10 | - !include lovelace/views/tablets/hallway_tablet.yaml 11 | -------------------------------------------------------------------------------- /lovelace-kitchen-tablet.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | non_admin_settings: 6 | hide_header: true 7 | hide_account: true 8 | 9 | views: 10 | - !include lovelace/views/tablets/kitchen_tablet.yaml 11 | -------------------------------------------------------------------------------- /lovelace/cards/weather/weather_radar.yaml: -------------------------------------------------------------------------------- 1 | type: "custom:weather-radar-card" 2 | data_source: "RainViewer-NEXRAD" 3 | map_style: "satellite" 4 | frame_count: 10 5 | frame_delay: 250 6 | show_zoom: true 7 | show_recenter: true 8 | show_playback: true 9 | show_marker: false 10 | zoom_level: 6 11 | center_latitude: 55.6803664 12 | center_longitude: 11.0714025 13 | -------------------------------------------------------------------------------- /lovelace/cards/header_cards/date_time.yaml: -------------------------------------------------------------------------------- 1 | type: markdown 2 | content: >- 3 | {{ states("sensor.time") }} {{ states("sensor.date_text") }} 4 | {{ ' - ' + state_attr('calendar.helligdage', 'message') if is_state('calendar.helligdage', 'on') }} 5 | card_mod: 6 | style: | 7 | ha-card { 8 | background: rgba(0,0,0,0); 9 | font-size: 130%; 10 | } 11 | -------------------------------------------------------------------------------- /lovelace/cards/clock.yaml: -------------------------------------------------------------------------------- 1 | type: custom:button-card 2 | entity: sensor.time 3 | state_display: >- 4 | [[[ 5 | var d = new Date() 6 | return d.toLocaleTimeString('da-DK', { timeStyle: "short" }); 7 | ]]] 8 | show_state: true 9 | show_name: false 10 | show_icon: false 11 | tap_action: 12 | action: none 13 | styles: 14 | card: 15 | - padding: 0 16 | - font-size: 64pt 17 | -------------------------------------------------------------------------------- /lovelace/cards/dorklokke.yaml: -------------------------------------------------------------------------------- 1 | type: "custom:button-card" 2 | entity: switch.dorklokke_forstyr_ikke 3 | show_name: false 4 | size: 40px 5 | state: 6 | - value: "on" 7 | icon: "mdi:bell-off" 8 | styles: 9 | icon: 10 | - color: "#ff0000" 11 | - value: "off" 12 | icon: "mdi:bell" 13 | styles: 14 | icon: 15 | - color: "var(--success-color)" 16 | -------------------------------------------------------------------------------- /lovelace/cards/time_to_leave_countdown.yaml: -------------------------------------------------------------------------------- 1 | type: custom:bignumber-card 2 | entity: sensor.next_scheduled_leave_in 3 | scale: 20px 4 | min: -15 5 | max: 60 6 | bnStyle: var(--label-badge-blue) 7 | severity: 8 | - value: 10 9 | bnStyle: var(--label-badge-red) 10 | - value: 30 11 | bnStyle: var(--label-badge-yellow) 12 | - value: 61 13 | bnStyle: var(--label-badge-green) 14 | -------------------------------------------------------------------------------- /lovelace/cards/weather/weather_radar_small.yaml: -------------------------------------------------------------------------------- 1 | type: "custom:weather-radar-card" 2 | data_source: "RainViewer-NEXRAD" 3 | map_style: "satellite" 4 | frame_count: 10 5 | frame_delay: 250 6 | show_zoom: true 7 | show_recenter: true 8 | show_playback: true 9 | show_marker: false 10 | zoom_level: 6 11 | center_latitude: 55.6803664 12 | center_longitude: 11.0714025 13 | square_map: true 14 | -------------------------------------------------------------------------------- /customize.yaml: -------------------------------------------------------------------------------- 1 | light.bathroom_tablet: 2 | icon: mdi:tablet 3 | input_select.theme: 4 | icon: mdi:palette 5 | switch.pc_tilbehor_afbryder: 6 | icon: mdi:speaker-multiple 7 | sensor.cpu_temperature: 8 | device_class: temperature 9 | sensor.sun_elevation: 10 | icon: mdi:weather-sunny 11 | switch.mikroovn: 12 | icon: mdi:microwave 13 | light.kitchen_tablet: 14 | icon: mdi:tablet 15 | -------------------------------------------------------------------------------- /lovelace-bedroom-tablet.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | non_admin_settings: 6 | hide_header: true 7 | hide_account: true 8 | hide_dialog_header_action_items: true 9 | 10 | views: 11 | - !include lovelace/views/tablets/bedroom_tablet.yaml 12 | -------------------------------------------------------------------------------- /themes/mushroom/mushroom.yaml: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT THIS FILE. 2 | # This file will be reset with updates. 3 | # If you want to customize it, copy the content in another folder and file and change the name. 4 | # https://www.home-assistant.io/integrations/frontend/#defining-themes 5 | Mushroom: 6 | # Nothing here as it's the default HA theme since 2022.11 7 | modes: 8 | light: {} 9 | dark: {} 10 | -------------------------------------------------------------------------------- /lovelace/cards/weather/dmi_kommende_varsler.yaml: -------------------------------------------------------------------------------- 1 | type: custom:list-card 2 | entity: sensor.dmi_kommende_varsler 3 | feed_attribute: warnings 4 | columns: 5 | - title: Varsel 6 | field: warningText 7 | - title: "⚠️" 8 | field: formattedCategory 9 | - title: Periode 10 | field: peiod 11 | card_mod: 12 | style: | 13 | ha-card { 14 | white-space: nowrap; 15 | } 16 | -------------------------------------------------------------------------------- /lovelace/cards/weather/dmi_aktuelle_varsler.yaml: -------------------------------------------------------------------------------- 1 | type: custom:list-card 2 | entity: sensor.dmi_aktuelle_varsler 3 | feed_attribute: warnings 4 | columns: 5 | - title: Varsel 6 | field: warningText 7 | - title: "⚠️" 8 | field: formattedCategory 9 | - title: Til 10 | field: validToText 11 | card_mod: 12 | style: | 13 | ha-card { 14 | white-space: nowrap; 15 | } 16 | -------------------------------------------------------------------------------- /esphome/shared/base.yaml: -------------------------------------------------------------------------------- 1 | wifi: 2 | ssid: !secret wifi_ssid 3 | password: !secret wifi_pass 4 | 5 | # Enable Home Assistant API 6 | api: 7 | encryption: 8 | key: !secret encryption_key 9 | 10 | ota: 11 | platform: esphome 12 | password: !secret ota_pass 13 | 14 | # Enable logging 15 | logger: 16 | 17 | # Sync time with Home Assistant 18 | time: 19 | - platform: homeassistant 20 | id: homeassistant_time 21 | -------------------------------------------------------------------------------- /lovelace/cards/kitchen_timers.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: custom:decluttering-card 4 | template: timer 5 | variables: 6 | - entity: timer.kitchen_1 7 | - type: custom:decluttering-card 8 | template: timer 9 | variables: 10 | - entity: timer.kitchen_2 11 | - type: custom:decluttering-card 12 | template: timer 13 | variables: 14 | - entity: timer.kitchen_3 15 | -------------------------------------------------------------------------------- /esphome/packages/base.yaml: -------------------------------------------------------------------------------- 1 | wifi: 2 | ssid: !secret wifi_ssid 3 | password: !secret wifi_pass 4 | 5 | # Enable Home Assistant API 6 | api: 7 | encryption: 8 | key: !secret encryption_key 9 | 10 | ota: 11 | platform: esphome 12 | password: !secret ota_pass 13 | 14 | # Enable logging 15 | logger: 16 | 17 | # Sync time with Home Assistant 18 | time: 19 | - platform: homeassistant 20 | id: homeassistant_time 21 | -------------------------------------------------------------------------------- /lovelace-3d-printer-preview.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | hide_header: true 6 | hide_sidebar: true 7 | 8 | views: 9 | - title: Home 10 | icon: mdi:printer-3d 11 | panel: true 12 | path: home 13 | cards: 14 | - !include lovelace/cards/3d_printer/preview.yaml 15 | -------------------------------------------------------------------------------- /lovelace/cards/fridge.yaml: -------------------------------------------------------------------------------- 1 | type: horizontal-stack 2 | cards: 3 | - type: "custom:button-card" 4 | entity: binary_sensor.koleskab_dor_abner 5 | layout: icon_name_state2nd 6 | icon: mdi:fridge-bottom 7 | name: Køleskab 8 | template: good_bad 9 | 10 | - type: "custom:button-card" 11 | entity: binary_sensor.fryser_dor 12 | layout: icon_name_state2nd 13 | icon: mdi:fridge-top 14 | name: Fryser 15 | template: good_bad 16 | -------------------------------------------------------------------------------- /packages/automation/rooms/automations/hallway_automations.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - id: doorbell_notification 3 | alias: Doorbell Notification 4 | mode: single 5 | triggers: 6 | - trigger: state 7 | entity_id: binary_sensor.dorklokke_knap 8 | from: "off" 9 | to: "on" 10 | actions: 11 | - parallel: 12 | - action: script.notify_everywhere 13 | data: 14 | message: "Ding dong!" 15 | -------------------------------------------------------------------------------- /lovelace/cards/weather/dmi_weather.yaml: -------------------------------------------------------------------------------- 1 | type: custom:button-card 2 | show_name: false 3 | show_icon: false 4 | show_state: true 5 | show_entity_picture: true 6 | entity: sensor.dmi_vejr 7 | styles: 8 | state: 9 | - font-size: 16pt 10 | - white-space: normal 11 | tap_action: 12 | action: fire-dom-event 13 | browser_mod: 14 | service: browser_mod.popup 15 | data: 16 | title: Vejrudsigt 17 | content: !include dmi_weather_report.yaml 18 | -------------------------------------------------------------------------------- /themes/mushroom/mushroom-shadow.yaml: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT THIS FILE. 2 | # This file will be reset with updates. 3 | # If you want to customize it, copy the content in another folder and file and change the name. 4 | # https://www.home-assistant.io/integrations/frontend/#defining-themes 5 | Mushroom Shadow: 6 | # Home Assistant override 7 | ha-card-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.16) 8 | ha-card-border-width: 0 9 | modes: 10 | light: {} 11 | dark: {} 12 | -------------------------------------------------------------------------------- /lovelace/cards/weather/dmi_weather_report.yaml: -------------------------------------------------------------------------------- 1 | type: custom:html-card 2 | ignore_line_breaks: true 3 | # picture_elements_mode: true 4 | content: | 5 | 6 | [[ sensor.dmi_vejr ]]
7 |
8 | 9 | 10 | [[ sensor.dmi_vejr.attributes.date ]] 11 | 12 | 13 |

[[ sensor.dmi_vejr.attributes.content ]]

14 | 15 | 16 | [[ sensor.dmi_vejr.attributes.validity ]] 17 | 18 | -------------------------------------------------------------------------------- /packages/logging.yaml: -------------------------------------------------------------------------------- 1 | logger: 2 | default: warning 3 | logs: 4 | {} 5 | # xiaomi_cloud_map_extractor: debug 6 | # homeassistant.components.xiaomi_cloud_map_extractor: debug 7 | # custom_components.xiaomi_cloud_map_extractor.camera: debug 8 | # rflink: debug 9 | # homeassistant.components.rflink: debug 10 | # Possible log severities are: 11 | # 12 | # critical 13 | # fatal 14 | # error 15 | # warning 16 | # warn 17 | # info 18 | # debug 19 | # notset 20 | -------------------------------------------------------------------------------- /esphome/shared/h801_pwm.yaml: -------------------------------------------------------------------------------- 1 | - platform: esp8266_pwm 2 | frequency: 200 Hz 3 | pin: GPIO15 4 | id: red_pwm 5 | 6 | - platform: esp8266_pwm 7 | frequency: 200 Hz 8 | pin: GPIO13 9 | id: green_pwm 10 | 11 | - platform: esp8266_pwm 12 | frequency: 200 Hz 13 | pin: GPIO12 14 | id: blue_pwm 15 | 16 | - platform: esp8266_pwm 17 | frequency: 200 Hz 18 | pin: GPIO14 19 | id: w1_pwm 20 | 21 | - platform: esp8266_pwm 22 | frequency: 200 Hz 23 | pin: GPIO4 24 | id: w2_pwm 25 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/room_state_and_light_profile.yaml: -------------------------------------------------------------------------------- 1 | default: 2 | - orientation: horizontal 3 | card: 4 | type: vertical-stack 5 | cards: 6 | - type: custom:decluttering-card 7 | template: room_light_profile 8 | variables: 9 | - room: "[[room]]" 10 | - orientation: "[[orientation]]" 11 | 12 | - type: custom:decluttering-card 13 | template: room_state 14 | variables: 15 | - room: "[[room]]" 16 | - orientation: "[[orientation]]" 17 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/light_group.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: custom:auto-entities 3 | filter: 4 | include: 5 | - group: group.[[group]] 6 | options: 7 | type: custom:slider-entity-row 8 | toggle: true 9 | step: 1 10 | exclude: 11 | - state: "unavailable" 12 | card: 13 | type: custom:fold-entity-row 14 | head: 15 | type: custom:slider-entity-row 16 | entity: light.[[group]] 17 | name: "[[name]]" 18 | toggle: true 19 | -------------------------------------------------------------------------------- /esphome/gang_bt_proxy.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | room: Gang 3 | devicename: gang_bt_proxy 4 | upper_devicename: Gang Bluetooth Proxy 5 | 6 | esp32: 7 | board: esp-wrover-kit 8 | framework: 9 | type: esp-idf 10 | version: recommended 11 | 12 | esphome: 13 | name: ${devicename} 14 | 15 | packages: 16 | base: !include packages/base.yaml 17 | btle_trackers: !include packages/btle_trackers.yaml 18 | 19 | status_led: 20 | pin: 21 | number: GPIO2 22 | inverted: true 23 | 24 | bluetooth_proxy: 25 | active: true 26 | -------------------------------------------------------------------------------- /esphome/stue_bt_proxy.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | room: Stue 3 | devicename: stue_bt_proxy 4 | upper_devicename: Stue Bluetooth Proxy 5 | 6 | esp32: 7 | board: esp-wrover-kit 8 | framework: 9 | type: esp-idf 10 | version: recommended 11 | 12 | esphome: 13 | name: ${devicename} 14 | 15 | packages: 16 | base: !include packages/base.yaml 17 | btle_trackers: !include packages/btle_trackers.yaml 18 | 19 | status_led: 20 | pin: 21 | number: GPIO2 22 | inverted: true 23 | 24 | bluetooth_proxy: 25 | active: true 26 | -------------------------------------------------------------------------------- /lovelace/cards/lights/rooms/kitchen.yaml: -------------------------------------------------------------------------------- 1 | type: entities 2 | entities: 3 | - type: custom:decluttering-card 4 | template: light_group 5 | variables: 6 | - group: kokken_lamper 7 | - name: Lamper 8 | 9 | - type: custom:decluttering-card 10 | template: light_group 11 | variables: 12 | - group: kokken_primaer_stemningslys 13 | - name: Primær 14 | 15 | - type: custom:decluttering-card 16 | template: light_group 17 | variables: 18 | - group: kokken_sekundaer_stemningslys 19 | - name: Sekundær 20 | -------------------------------------------------------------------------------- /packages/automation/updates.yaml: -------------------------------------------------------------------------------- 1 | script: 2 | update_all_esphome_devices: 3 | alias: "Update All ESPHome Devices" 4 | sequence: 5 | - alias: "Call update.install on all ESPHome devices with available updates" 6 | action: update.install 7 | target: 8 | entity_id: > 9 | [{% for entity in states.update %} 10 | {% if entity.state == 'on' and entity.attributes.title == 'ESPHome' -%} 11 | "{{ entity.entity_id }}", 12 | {%- endif -%} 13 | {%- endfor -%}] 14 | -------------------------------------------------------------------------------- /scripts.yaml: -------------------------------------------------------------------------------- 1 | valetudo_send_vacuum_command: 2 | alias: 'Valetudo: Send Vacuum Command' 3 | use_blueprint: 4 | path: mundschenk-at/valetudo-send-vacuum-command.yaml 5 | input: 6 | robot: RoborockS5 7 | icon: mdi:robot-vacuum 8 | valetudo_clean_rooms: 9 | alias: 'Valetudo: Clean Rooms' 10 | use_blueprint: 11 | path: mundschenk-at/valetudo-clean-rooms.yaml 12 | input: 13 | send_robot_command: script.valetudo_send_vacuum_command 14 | robot_map_segments: sensor.valetudo_roborocks5_map_segments 15 | icon: mdi:selection 16 | -------------------------------------------------------------------------------- /esphome/sovevaerelse_bt_proxy.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | room: Soveværelse 3 | devicename: sovevaerelse_bt_proxy 4 | upper_devicename: Soveværelse Bluetooth Proxy 5 | 6 | esp32: 7 | board: esp-wrover-kit 8 | framework: 9 | type: esp-idf 10 | version: recommended 11 | 12 | esphome: 13 | name: ${devicename} 14 | 15 | packages: 16 | base: !include packages/base.yaml 17 | btle_trackers: !include packages/btle_trackers.yaml 18 | 19 | status_led: 20 | pin: 21 | number: GPIO2 22 | inverted: true 23 | 24 | bluetooth_proxy: 25 | active: true 26 | -------------------------------------------------------------------------------- /packages/integrations/feedreader.yaml: -------------------------------------------------------------------------------- 1 | template: 2 | - trigger: 3 | - trigger: event 4 | event_type: feedreader 5 | event_data: 6 | feed_url: "https://www.dr.dk/nyheder/service/feeds/senestenyt" 7 | sensor: 8 | - name: "DR Seneste Nyt" 9 | state: "{{ as_timestamp(now()) | timestamp_custom('%H:%M:%S %d %b %Y', true) }}" 10 | attributes: 11 | latest: >- 12 | {% set old_stories = state_attr('sensor.dr_seneste_nyt', 'latest') or [] %} 13 | {{ ([trigger.event.data.title] + old_stories)[0:5] }} 14 | -------------------------------------------------------------------------------- /packages/integrations/KidsChores/kc_dashboard_uihelpers.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: "Update KidsChore UI Helpers" 3 | id: 888e8507-69cb-4726-9d2f-d9ef18d943c0 4 | triggers: 5 | - trigger: homeassistant 6 | event: start 7 | - trigger: time_pattern 8 | minutes: "/5" 9 | action: 10 | - action: input_datetime.set_datetime 11 | target: 12 | entity_id: input_datetime.kc_ui_set_date_helper 13 | data: 14 | datetime: "{{ (now().replace(hour=23, minute=0, second=0, microsecond=0) + timedelta(days=1)).isoformat() }}" 15 | -------------------------------------------------------------------------------- /lovelace/cards/calendar_work.yaml: -------------------------------------------------------------------------------- 1 | type: custom:calendar-card-pro 2 | max_height: 690px 3 | entities: 4 | - entity: calendar.vagtplan 5 | accent_color: Lightgreen 6 | label: mdi:calendar 7 | blocklist: Fri 8 | - entity: calendar.arbejdskalender 9 | blocklist: Fri 10 | label: mdi:briefcase 11 | accent_color: Darkgreen 12 | days_to_show: 3 13 | show_empty_days: true 14 | show_week_numbers: iso 15 | filter_duplicates: true 16 | today_indicator: dot 17 | today_indicator_position: 10% 30px 18 | date_vertical_alignment: top 19 | show_countdown: true 20 | show_progress_bar: true 21 | -------------------------------------------------------------------------------- /esphome/packages/btle_trackers.yaml: -------------------------------------------------------------------------------- 1 | esp32_ble_tracker: 2 | 3 | binary_sensor: 4 | - platform: ble_presence 5 | name: "${room} BLE Presence Darkphone" 6 | ibeacon_uuid: !secret darkphone_btle_uuid 7 | - platform: ble_presence 8 | name: "${room} BLE Presence DarkWatch" 9 | ibeacon_uuid: !secret darkwatch_btle_uuid 10 | 11 | sensor: 12 | - platform: ble_rssi 13 | name: "${room} BLE Darkphone RSSI value" 14 | ibeacon_uuid: !secret darkphone_btle_uuid 15 | - platform: ble_rssi 16 | name: "${room} BLE DarkWatch RSSI value" 17 | ibeacon_uuid: !secret darkwatch_btle_uuid 18 | -------------------------------------------------------------------------------- /packages/automation/device_power/device_sleep.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | # Whole Apartment # 3 | - alias: Away 4 | id: 8eb5e623-aa20-4c04-b260-d9eb2251583e 5 | initial_state: true 6 | triggers: 7 | trigger: state 8 | entity_id: binary_sensor.rook_presence_delayed 9 | to: "off" 10 | conditions: 11 | - alias: "Not in guest mode" 12 | condition: state 13 | entity_id: input_boolean.guests 14 | state: "off" 15 | actions: 16 | - action: homeassistant.turn_off 17 | target: 18 | entity_id: group.all_media 19 | -------------------------------------------------------------------------------- /packages/integrations/telegram.yaml: -------------------------------------------------------------------------------- 1 | notify: 2 | - name: telegram_darkfox 3 | platform: telegram 4 | chat_id: !secret telegram_darkfox_id 5 | 6 | automation: 7 | - id: update_telegram_keyboard 8 | alias: Update Telegram Keyboard 9 | initial_state: true 10 | triggers: 11 | trigger: homeassistant 12 | event: start 13 | actions: 14 | - action: script.notify_darkphone 15 | data: 16 | message: "Home Assistant er genstartet!" 17 | keyboard: 18 | - "/bil" # car_telegram_menu.yaml 19 | # - "/destination" # car_telegram_menu.yaml 20 | -------------------------------------------------------------------------------- /esphome/ismaskine.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: ismaskine 3 | upper_devicename: Ismaskine 4 | restore_mode: ALWAYS_OFF 5 | 6 | esphome: 7 | name: $devicename 8 | 9 | esp8266: 10 | board: nodemcuv2 11 | 12 | <<: !include shared/base.yaml 13 | 14 | switch: 15 | # Switch to toggle the relay 16 | - platform: gpio 17 | id: relay 18 | pin: D1 19 | restore_mode: $restore_mode 20 | 21 | - platform: template 22 | name: $upper_devicename 23 | icon: "mdi:delete-variant" 24 | turn_on_action: 25 | - switch.turn_on: relay 26 | - delay: 500ms 27 | - switch.turn_off: relay 28 | -------------------------------------------------------------------------------- /lovelace/cards/transport/car_parking.yaml: -------------------------------------------------------------------------------- 1 | type: conditional 2 | conditions: 3 | - entity: binary_sensor.parking_limit 4 | state: "on" 5 | card: 6 | type: horizontal-stack 7 | cards: 8 | - type: custom:button-card 9 | entity: sensor.parking_clock 10 | layout: icon_state 11 | show_name: false 12 | show_state: true 13 | - type: custom:button-card 14 | entity: sensor.parking_alarm_clock 15 | layout: icon_state 16 | show_name: false 17 | show_state: true 18 | - type: custom:button-card 19 | entity: sensor.parking_limit_clock 20 | layout: icon_state 21 | show_name: false 22 | show_state: true 23 | -------------------------------------------------------------------------------- /lovelace/cards/media_players/active_media_player_currently_playing.yaml: -------------------------------------------------------------------------------- 1 | type: conditional 2 | conditions: 3 | - entity: sensor.sonos_group_leader_room 4 | state_not: "" 5 | card: 6 | type: "custom:config-template-card" 7 | entities: 8 | - sensor.sonos_group_leader 9 | - sensor.sonos_group_leader_room 10 | - media_player.badevaerelse 11 | - media_player.kokken 12 | - media_player.kontor 13 | - media_player.roam 14 | - media_player.sovevaerelse 15 | - media_player.stue 16 | card: 17 | type: custom:decluttering-card 18 | template: currently_playing 19 | variables: 20 | - room: "${states['sensor.sonos_group_leader_room'].state}" 21 | -------------------------------------------------------------------------------- /themes/mushroom/mushroom-square.yaml: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT THIS FILE. 2 | # This file will be reset with updates. 3 | # If you want to customize it, copy the content in another folder and file and change the name. 4 | # https://www.home-assistant.io/integrations/frontend/#defining-themes 5 | Mushroom Square: 6 | # Home Assistant override 7 | ha-badge-border-radius: 6px 8 | ha-card-border-radius: 6px 9 | ha-card-features-border-radius: 6px 10 | ha-tile-icon-border-radius: 6px 11 | # Layout 12 | mush-spacing: 8px 13 | # Elements 14 | mush-icon-border-radius: 6px 15 | mush-control-border-radius: 6px 16 | # Chips 17 | mush-chip-border-radius: 6px 18 | modes: 19 | light: {} 20 | dark: {} 21 | -------------------------------------------------------------------------------- /lovelace/cards/lights/rooms/living_room.yaml: -------------------------------------------------------------------------------- 1 | type: entities 2 | entities: 3 | - type: custom:decluttering-card 4 | template: light_group 5 | variables: 6 | - group: stue_lamper 7 | - name: Lamper 8 | 9 | - type: custom:decluttering-card 10 | template: light_group 11 | variables: 12 | - group: stue_hvidt_stemningslys 13 | - name: Hvidt 14 | 15 | - type: custom:decluttering-card 16 | template: light_group 17 | variables: 18 | - group: stue_primaer_stemningslys 19 | - name: Primær 20 | 21 | - type: custom:decluttering-card 22 | template: light_group 23 | variables: 24 | - group: stue_sekundaer_stemningslys 25 | - name: Sekundær 26 | -------------------------------------------------------------------------------- /lovelace/cards/lights/rooms/office.yaml: -------------------------------------------------------------------------------- 1 | type: entities 2 | entities: 3 | - type: custom:decluttering-card 4 | template: light_group 5 | variables: 6 | - group: kontor_lamper 7 | - name: Lamper 8 | 9 | - type: custom:decluttering-card 10 | template: light_group 11 | variables: 12 | - group: kontor_hvidt_stemningslys 13 | - name: Hvidt 14 | 15 | - type: custom:decluttering-card 16 | template: light_group 17 | variables: 18 | - group: kontor_primaer_stemningslys 19 | - name: Primær 20 | 21 | - type: custom:decluttering-card 22 | template: light_group 23 | variables: 24 | - group: kontor_sekundaer_stemningslys 25 | - name: Sekundær 26 | -------------------------------------------------------------------------------- /lovelace/cards/climate/target_temperature.yaml: -------------------------------------------------------------------------------- 1 | type: horizontal-stack 2 | cards: 3 | - type: custom:mushroom-number-card 4 | entity: input_number.target_temperature 5 | name: Termostat 6 | icon: mdi:thermostat 7 | display_mode: buttons 8 | fill_container: true 9 | 10 | - type: custom:button-card 11 | name: Detaljer 12 | icon: mdi:vector-polyline 13 | styles: 14 | card: 15 | - height: 100px 16 | tap_action: 17 | action: fire-dom-event 18 | browser_mod: 19 | service: browser_mod.popup 20 | data: 21 | title: Detaljer 22 | content: 23 | type: vertical-stack 24 | cards: 25 | - !include temp_graph.yaml 26 | -------------------------------------------------------------------------------- /lovelace/cards/lights/rooms/bedroom.yaml: -------------------------------------------------------------------------------- 1 | type: entities 2 | entities: 3 | - type: custom:decluttering-card 4 | template: light_group 5 | variables: 6 | - group: sovevaerelse_lamper 7 | - name: Lamper 8 | 9 | - type: custom:decluttering-card 10 | template: light_group 11 | variables: 12 | - group: sovevaerelse_hvidt_stemningslys 13 | - name: Hvidt 14 | 15 | - type: custom:decluttering-card 16 | template: light_group 17 | variables: 18 | - group: sovevaerelse_primaer_stemningslys 19 | - name: Primær 20 | 21 | - type: custom:decluttering-card 22 | template: light_group 23 | variables: 24 | - group: sovevaerelse_sekundaer_stemningslys 25 | - name: Sekundær 26 | -------------------------------------------------------------------------------- /esphome/bed_table.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: bed_table 3 | upper_devicename: Bed Table 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: huzzah 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO5 30 | inverted: true 31 | # pin: GPIO05 32 | # id: status_red_pwm 33 | # pin: GPIO01 34 | # id: status_green_pwm 35 | 36 | output: !include shared/h801_pwm.yaml 37 | 38 | light: !include shared/rgb.yaml 39 | -------------------------------------------------------------------------------- /esphome/hallway_cupboard.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: hallway_cupboard 3 | upper_devicename: Gang Kommode 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: huzzah 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO5 30 | inverted: true 31 | # pin: GPIO05 32 | # id: status_red_pwm 33 | # pin: GPIO01 34 | # id: status_green_pwm 35 | 36 | output: !include shared/h801_pwm.yaml 37 | 38 | light: !include shared/rgb.yaml 39 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/temp_graph_button.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: custom:stack-in-card 3 | mode: vertical 4 | cards: 5 | - type: custom:button-card 6 | size: 20px 7 | show_name: false 8 | show_state: true 9 | layout: icon_state 10 | color_type: icon 11 | icon: "[[icon]]" 12 | color: "[[color]]" 13 | entity: "sensor.[[room]]_temperatur" 14 | styles: 15 | state: 16 | - font-size: 18pt 17 | - font-weight: bold 18 | 19 | - type: custom:button-card 20 | size: 20px 21 | show_name: false 22 | show_state: true 23 | layout: icon_state 24 | entity: "sensor.[[room]]_luftfugtighed" 25 | icon: mdi:water-percent 26 | styles: 27 | state: 28 | - font-size: 14pt 29 | -------------------------------------------------------------------------------- /lovelace/cards/mode_toggles.yaml: -------------------------------------------------------------------------------- 1 | type: horizontal-stack 2 | cards: 3 | - type: "custom:button-card" 4 | entity: input_boolean.vacation_mode 5 | tap_action: 6 | action: none 7 | hold_action: 8 | action: call-service 9 | service: input_boolean.toggle 10 | service_data: 11 | entity_id: input_boolean.vacation_mode 12 | - type: conditional 13 | conditions: 14 | - condition: user 15 | users: 16 | - 363204d3b6c1483f83ace3eb418e4170 17 | card: 18 | type: "custom:button-card" 19 | entity: input_boolean.guests 20 | tap_action: 21 | action: none 22 | hold_action: 23 | action: call-service 24 | service: input_boolean.toggle 25 | service_data: 26 | entity_id: input_boolean.guests 27 | -------------------------------------------------------------------------------- /themes/mushroom/mushroom-square-shadow.yaml: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT THIS FILE. 2 | # This file will be reset with updates. 3 | # If you want to customize it, copy the content in another folder and file and change the name. 4 | # https://www.home-assistant.io/integrations/frontend/#defining-themes 5 | Mushroom Square Shadow: 6 | # Home Assistant override 7 | ha-badge-border-radius: 6px 8 | ha-card-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.16) 9 | ha-card-border-width: 0 10 | ha-card-border-radius: 6px 11 | ha-card-features-border-radius: 6px 12 | ha-tile-icon-border-radius: 6px 13 | # Layout 14 | mush-spacing: 8px 15 | # Elements 16 | mush-icon-border-radius: 6px 17 | mush-control-border-radius: 6px 18 | # Chips 19 | mush-chip-border-radius: 6px 20 | modes: 21 | light: {} 22 | dark: {} 23 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/thermostat_state.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: "custom:button-card" 3 | entity: "[[entity]]" 4 | icon: "[[icon]]" 5 | triggers_update: 6 | - "[[entity]]" 7 | name: "[[[return states['[[entity]]'].attributes['temperature'] + '°']]]" 8 | label: "[[[return states['[[entity]]'].attributes['current_temperature'] + '°']]]" 9 | show_state: false 10 | show_label: true 11 | color: var(--climate-state) 12 | tap_action: 13 | action: toggle 14 | hold_action: 15 | action: more-info 16 | styles: 17 | name: 18 | - font-size: 120% 19 | label: 20 | - font-size: 80% 21 | card_mod: 22 | style: | 23 | ha-icon { 24 | --climate-state: {% if state_attr('[[entity]]', 'hvac_action') == 'heating' %} var(--state-active-color) {% endif %}; 25 | } 26 | -------------------------------------------------------------------------------- /esphome/shared/monochromatic_effects.yaml: -------------------------------------------------------------------------------- 1 | - strobe: 2 | name: Strobe (Slow) 3 | - strobe: 4 | name: Strobe (Medium) 5 | colors: 6 | - state: true 7 | brightness: 100% 8 | duration: 100ms 9 | - state: false 10 | duration: 100ms 11 | - strobe: 12 | name: Strobe (Fast) 13 | colors: 14 | - state: true 15 | brightness: 100% 16 | duration: 25ms 17 | - state: false 18 | duration: 25ms 19 | - flicker: 20 | - flicker: 21 | name: Candle 22 | alpha: 90% 23 | intensity: 5% 24 | - pulse: 25 | name: Fade (Slow) 26 | update_interval: 2s 27 | - pulse: 28 | name: Fade 29 | - pulse: 30 | name: Fade (Fast) 31 | transition_length: 0.5s 32 | update_interval: 0.5s 33 | min_brightness: 0% 34 | max_brightness: 100% 35 | -------------------------------------------------------------------------------- /lovelace/cards/calendar.yaml: -------------------------------------------------------------------------------- 1 | type: custom:calendar-card-pro 2 | max_height: 400px 3 | entities: 4 | - entity: calendar.calendar 5 | label: mdi:account 6 | blocklist: Fri 7 | accent_color: lightblue 8 | - entity: calendar.helligdage 9 | label: mdi:flag 10 | - entity: calendar.tripit 11 | label: mdi:train-car 12 | accent_color: darkorange 13 | - entity: calendar.helligdage 14 | label: mdi:palm-tree 15 | accent_color: salmon 16 | - entity: calendar.vagtplan 17 | accent_color: Lightgreen 18 | label: mdi:calendar 19 | blocklist: Fri 20 | days_to_show: 5 21 | show_empty_days: true 22 | show_week_numbers: iso 23 | filter_duplicates: true 24 | today_indicator: dot 25 | today_indicator_position: 10% 30px 26 | date_vertical_alignment: top 27 | show_countdown: true 28 | show_progress_bar: true 29 | -------------------------------------------------------------------------------- /lovelace/cards/calendar_compact.yaml: -------------------------------------------------------------------------------- 1 | type: custom:calendar-card-pro 2 | max_height: 300px 3 | entities: 4 | - entity: calendar.calendar 5 | label: mdi:account 6 | blocklist: Fri 7 | accent_color: lightblue 8 | - entity: calendar.helligdage 9 | label: mdi:flag 10 | - entity: calendar.tripit 11 | label: mdi:train-car 12 | accent_color: darkorange 13 | - entity: calendar.helligdage 14 | label: mdi:palm-tree 15 | accent_color: salmon 16 | - entity: calendar.vagtplan 17 | accent_color: Lightgreen 18 | label: mdi:calendar 19 | blocklist: Fri 20 | days_to_show: 5 21 | show_empty_days: true 22 | show_week_numbers: iso 23 | filter_duplicates: true 24 | today_indicator: dot 25 | today_indicator_position: 10% 30px 26 | date_vertical_alignment: top 27 | show_countdown: true 28 | show_progress_bar: true 29 | -------------------------------------------------------------------------------- /lovelace/cards/transport/upcoming_travel.yaml: -------------------------------------------------------------------------------- 1 | type: conditional 2 | conditions: 3 | - condition: numeric_state 4 | entity: sensor.next_scheduled_leave_in 5 | above: -15 6 | below: 720 7 | card: 8 | type: custom:button-card 9 | entity: sensor.next_scheduled_leave_at 10 | label: >- 11 | [[[ return 'Afgang ' + 12 | states['sensor.next_scheduled_leave_at_relative'].state; ]]] 13 | name: >- 14 | [[[ return states['sensor.upcoming_travel_location'].attributes['name'] || 15 | states['sensor.upcoming_travel_location'].state ]]] 16 | icon: "[[[ return states['sensor.upcoming_travel_location'].attributes['icon'] ]]]" 17 | show_state: true 18 | show_label: true 19 | layout: icon_name_state2nd 20 | styles: 21 | grid: 22 | - grid-template-areas: '"i n" "i l" "i s"' 23 | - grid-template-columns: 1fr 75% 24 | -------------------------------------------------------------------------------- /packages/integrations/system_health.yaml: -------------------------------------------------------------------------------- 1 | system_health: 2 | 3 | command_line: 4 | - sensor: 5 | name: CPU Temperature Raw 6 | unique_id: 28bd1247-595c-4ec2-8fcb-03edf09f0241 7 | command: "cat /sys/class/thermal/thermal_zone2/temp" 8 | unit_of_measurement: "°C" 9 | value_template: "{{ value | float | multiply(0.001) | int }}" 10 | scan_interval: 30 11 | 12 | sensor: 13 | - platform: statistics 14 | name: CPU Temperature 15 | entity_id: sensor.cpu_temperature_raw 16 | state_characteristic: mean 17 | sampling_size: 20 18 | 19 | template: 20 | - binary_sensor: 21 | - name: "Internet" 22 | unique_id: ef64c7a1-81cc-4417-947a-e6098807eb10 23 | state: "{{ is_state('binary_sensor.gateway_wan_status', 'on') }}" 24 | device_class: connectivity 25 | icon: "mdi:web" 26 | -------------------------------------------------------------------------------- /ui-lovelace.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | title: Home 5 | views: 6 | - !include lovelace/views/default/home.yaml 7 | - !include lovelace/views/default/living_room.yaml 8 | - !include lovelace/views/default/bedroom.yaml 9 | - !include lovelace/views/default/office.yaml 10 | - !include lovelace/views/default/kitchen.yaml 11 | - !include lovelace/views/default/bathroom.yaml 12 | - !include lovelace/views/default/workshop.yaml 13 | - !include lovelace/views/default/hallway.yaml 14 | - !include lovelace/views/default/balcony.yaml 15 | - !include lovelace/views/default/transport.yaml 16 | - !include lovelace/views/default/maintenance.yaml 17 | - !include lovelace/views/default/power.yaml 18 | -------------------------------------------------------------------------------- /esphome/kontor_bt_proxy.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | room: Kontor 3 | devicename: kontor_bt_proxy 4 | upper_devicename: Kontor Bluetooth Proxy 5 | 6 | esp32: 7 | board: esp-wrover-kit 8 | framework: 9 | type: esp-idf 10 | version: recommended 11 | 12 | esphome: 13 | name: ${devicename} 14 | 15 | packages: 16 | base: !include packages/base.yaml 17 | btle_trackers: !include packages/btle_trackers.yaml 18 | 19 | wifi: 20 | ssid: !secret main_wifi_ssid 21 | password: !secret main_wifi_pass 22 | 23 | status_led: 24 | pin: 25 | number: GPIO2 26 | inverted: true 27 | 28 | bluetooth_proxy: 29 | active: true 30 | 31 | button: 32 | - platform: wake_on_lan 33 | name: "Rook PC WoL" 34 | target_mac_address: !secret rook_pc_mac 35 | 36 | - platform: wake_on_lan 37 | name: "Bar Computer WoL" 38 | target_mac_address: !secret bar_computer_mac 39 | -------------------------------------------------------------------------------- /lovelace/cards/conditional_timers.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: conditional 4 | conditions: 5 | - entity: binary_sensor.kitchen_timer_1_active 6 | state: "on" 7 | card: 8 | type: custom:decluttering-card 9 | template: timer 10 | variables: 11 | - entity: timer.kitchen_1 12 | 13 | - type: conditional 14 | conditions: 15 | - entity: binary_sensor.kitchen_timer_2_active 16 | state: "on" 17 | card: 18 | type: custom:decluttering-card 19 | template: timer 20 | variables: 21 | - entity: timer.kitchen_2 22 | 23 | - type: conditional 24 | conditions: 25 | - entity: binary_sensor.kitchen_timer_3_active 26 | state: "on" 27 | card: 28 | type: custom:decluttering-card 29 | template: timer 30 | variables: 31 | - entity: timer.kitchen_3 32 | -------------------------------------------------------------------------------- /blueprints/script/mundschenk-at/valetudo-trigger-auto-empty-dock.yaml: -------------------------------------------------------------------------------- 1 | blueprint: 2 | name: 'Valetudo: Trigger Auto-Empty Dock' 3 | description: Tells the auto-empty dock to do its thing. 4 | source_url: https://github.com/mundschenk-at/ha-valetudo-blueprints/blob/main/yaml/script/valetudo-trigger-auto-empty-dock.yaml 5 | domain: script 6 | homeassistant: 7 | min_version: 2022.6.0 8 | input: 9 | send_robot_command: 10 | name: Send Vacuum Command 11 | description: The "send vacuum command" script (taking an MQTT topic and payload 12 | as parameters). 13 | selector: 14 | entity: 15 | domain: 16 | - script 17 | multiple: false 18 | sequence: 19 | - service: !input send_robot_command 20 | data: 21 | mqtt_topic: AutoEmptyDockManualTriggerCapability/trigger/set 22 | mqtt_payload: PERFORM 23 | mode: single 24 | icon: mdi:trash-can-outline 25 | -------------------------------------------------------------------------------- /esphome/lyskaede.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: lyskaede 3 | upper_devicename: Lyskæde 4 | 5 | esphome: 6 | name: ${devicename} 7 | 8 | esp8266: 9 | board: huzzah 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO5 30 | inverted: true 31 | # pin: GPIO05 32 | # id: status_red_pwm 33 | # pin: GPIO01 34 | # id: status_green_pwm 35 | 36 | output: !include shared/h801_pwm.yaml 37 | 38 | light: 39 | - platform: monochromatic 40 | id: lyskaede 41 | name: Lyskæde 42 | output: red_pwm 43 | gamma_correct: 1.8 44 | default_transition_length: 250ms 45 | effects: !include shared/monochromatic_effects.yaml 46 | -------------------------------------------------------------------------------- /packages/automation/rooms/state/room_state.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: Room activity override on 3 | id: room_activity_override_on 4 | initial_state: true 5 | mode: parallel 6 | triggers: 7 | trigger: state 8 | entity_id: 9 | - input_boolean.bathroom_activity_override 10 | - input_boolean.bedroom_activity_override 11 | - input_boolean.hallway_activity_override 12 | - input_boolean.kitchen_activity_override 13 | - input_boolean.living_room_activity_override 14 | - input_boolean.office_activity_override 15 | - input_boolean.workshop_activity_override 16 | - input_boolean.balcony_activity_override 17 | to: "on" 18 | actions: 19 | - action: input_select.select_option 20 | data: 21 | entity_id: "input_select.{{ trigger.entity_id.replace('input_boolean.', '').replace('_activity_override', '') }}_room_state" 22 | option: "active" 23 | -------------------------------------------------------------------------------- /packages/drop-in/wled_set_colors.yaml: -------------------------------------------------------------------------------- 1 | rest_command: 2 | wled_send_colors: 3 | url: "http://{{ host or states('sensor.' + entity_id | replace('light.', '') + '_ip') }}/json" 4 | method: POST 5 | headers: 6 | accept: "application/json, text/html" 7 | content_type: "application/json; charset=utf-8" 8 | payload: >- 9 | { 10 | "seg":[ 11 | { 12 | "col":[ 13 | [ 14 | {{ state_attr(entity_id, "rgb_color")[0] }}, 15 | {{ state_attr(entity_id, "rgb_color")[1] }}, 16 | {{ state_attr(entity_id, "rgb_color")[2] }} 17 | ], 18 | [ 19 | {{ state_attr(entity_id + "_2nd_color", "rgb_color")[0] }}, 20 | {{ state_attr(entity_id + "_2nd_color", "rgb_color")[1] }}, 21 | {{ state_attr(entity_id + "_2nd_color", "rgb_color")[2] }} 22 | ] 23 | ] 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /esphome/kitchen_stove.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: kitchen_stove 3 | upper_devicename: Kitchen Stove 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: esp01_1m 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO13 30 | inverted: yes 31 | 32 | binary_sensor: 33 | - platform: gpio 34 | id: button 35 | pin: 36 | number: GPIO0 37 | mode: INPUT_PULLUP 38 | inverted: True 39 | on_press: 40 | - light.toggle: light_output 41 | 42 | output: 43 | - platform: gpio 44 | id: relay 45 | pin: GPIO12 46 | 47 | light: 48 | - platform: binary 49 | id: light_output 50 | name: $upper_devicename 51 | output: relay 52 | -------------------------------------------------------------------------------- /esphome/kitchen_sink.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: kitchen_sink 3 | upper_devicename: Kitchen Sink 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: esp01_1m 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO13 30 | inverted: yes 31 | 32 | binary_sensor: 33 | - platform: gpio 34 | id: button 35 | pin: 36 | number: GPIO0 37 | mode: INPUT_PULLUP 38 | inverted: True 39 | on_press: 40 | - light.toggle: $devicename 41 | 42 | output: 43 | - platform: gpio 44 | id: light_relay 45 | pin: GPIO12 46 | 47 | light: 48 | - platform: binary 49 | id: $devicename 50 | name: $upper_devicename 51 | output: light_relay 52 | -------------------------------------------------------------------------------- /lovelace/cards/compact_clock.yaml: -------------------------------------------------------------------------------- 1 | type: custom:button-card 2 | entity: sensor.time 3 | label: "[[[ return states['sensor.date_text_short'].state;]]]" 4 | show_icon: false 5 | show_name: false 6 | show_state: true 7 | show_label: true 8 | tap_action: 9 | action: none 10 | styles: 11 | card: 12 | - height: 130px 13 | - color: | 14 | [[[ 15 | if (states['binary_sensor.workday'] && states['binary_sensor.workday'].state == 'off') return '#FFFFFF'; 16 | else return 'var(--primary-text-color)'; 17 | ]]] 18 | - background-color: | 19 | [[[ 20 | if (states['binary_sensor.workday'] && states['binary_sensor.workday'].state == 'off') return '#8EFA00AA'; 21 | else return 'var( --ha-card-background, var(--card-background-color, white) )'; 22 | ]]] 23 | grid: 24 | - grid-template-areas: '"i" "n" "s" "l"' 25 | - grid-template-rows: min-content 26 | state: 27 | - font-size: clamp(2em, 7vw, 4em) 28 | label: 29 | - opacity: 66% 30 | -------------------------------------------------------------------------------- /packages/integrations/pyscript.yaml: -------------------------------------------------------------------------------- 1 | pyscript: 2 | allow_all_imports: true 3 | hass_is_global: true 4 | 5 | script: 6 | run_pyscript: 7 | mode: parallel 8 | fields: 9 | actions: 10 | description: "Pyscript to run" 11 | example: "pyscript.my_script" 12 | selector: 13 | action: 14 | data: 15 | description: "Data to pass to the pyscript" 16 | example: "{'key': 'value'}" 17 | selector: 18 | object: 19 | sequence: 20 | # Pyscript is slow to load the actions, so we need to check if it's missing using watchman 21 | - wait_template: >- 22 | {{ 23 | 'entities' in states.sensor.watchman_missing_services.attributes 24 | and state_attr('sensor.watchman_missing_services', 'entities') | selectattr('id', 'eq', action) | list | length == 0 25 | }} 26 | timeout: 00:00:30 27 | continue_on_timeout: false 28 | - action: "{{ action }}" 29 | data: "{{ data or {} if data is defined else {} }}" 30 | -------------------------------------------------------------------------------- /lovelace/cards/energy_prices/power_price_graphs.yaml: -------------------------------------------------------------------------------- 1 | type: custom:layout-card 2 | layout_type: custom:grid-layout 3 | layout: 4 | grid-template-columns: 1fr 1fr 1fr 5 | grid-template-rows: auto 6 | grid-template-areas: | 7 | "header header header" 8 | "left middle right" 9 | mediaquery: 10 | "(max-width: 1000px)": 11 | grid-template-columns: 100% 12 | grid-template-areas: | 13 | "header" 14 | "left" 15 | "middle" 16 | "right" 17 | "(max-width: 1400px)": 18 | grid-template-columns: 50% 50% 19 | grid-template-areas: | 20 | "header header" 21 | "left middle" 22 | "right right" 23 | cards: 24 | - type: custom:tabbed-card 25 | view_layout: 26 | grid-area: header 27 | tabs: 28 | - card: !include power_prices_day.yaml 29 | attributes: 30 | label: Dag 31 | icon: mdi:calendar-today 32 | 33 | - card: !include power_prices_week.yaml 34 | attributes: 35 | label: Uge 36 | icon: mdi:calendar-week 37 | -------------------------------------------------------------------------------- /packages/integrations/KidsChores/kc_auto_approve.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: Auto approve all chores for Rook 3 | id: bf25eccf-deca-4c0c-8931-6fe727034ab5 4 | description: Automatically presses the correct approval button for claimed chores. 5 | initial_state: true 6 | mode: queued 7 | trigger: 8 | - trigger: state 9 | entity_id: sensor.rook_chores_claimed 10 | attribute: chores 11 | condition: 12 | - condition: numeric_state 13 | entity_id: sensor.rook_chores_claimed 14 | above: 0 15 | variables: 16 | approval_buttons: >- 17 | {{ 18 | state_attr('sensor.rook_chores_claimed', 'chores') 19 | | map('regex_replace', 20 | '^sensor\\.kc_([a-zA-Z0-9_]+)_chore_status_', 21 | 'button.kc_\\1_chore_approval_') 22 | | list 23 | }} 24 | action: 25 | - repeat: 26 | for_each: "{{ approval_buttons }}" 27 | sequence: 28 | - action: button.press 29 | target: 30 | entity_id: "{{ repeat.item }}" 31 | -------------------------------------------------------------------------------- /lovelace/cards/gdq/compact_overview.yaml: -------------------------------------------------------------------------------- 1 | type: conditional 2 | conditions: 3 | - entity: group.gdq_automations 4 | state: "on" 5 | card: 6 | type: vertical-stack 7 | cards: 8 | - type: conditional 9 | conditions: 10 | - entity: sensor.gamesdonequick 11 | state: "streaming" 12 | card: 13 | type: custom:html-card 14 | content: >- 15 | 29 | Currently streaming: [[ sensor.gamesdonequick.attributes.game ]] 30 | 31 | - type: horizontal-stack 32 | cards: 33 | - !include on_deck_compact.yaml 34 | - !include next_to_watch_compact.yaml 35 | -------------------------------------------------------------------------------- /blueprints/template/homeassistant/inverted_binary_sensor.yaml: -------------------------------------------------------------------------------- 1 | blueprint: 2 | name: Invert a binary sensor 3 | description: Creates a binary_sensor which holds the inverted value of a reference binary_sensor 4 | domain: template 5 | source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/template/blueprints/inverted_binary_sensor.yaml 6 | input: 7 | reference_entity: 8 | name: Binary sensor to be inverted 9 | description: The binary_sensor which needs to have its value inverted 10 | selector: 11 | entity: 12 | domain: binary_sensor 13 | variables: 14 | reference_entity: !input reference_entity 15 | binary_sensor: 16 | state: > 17 | {% if states(reference_entity) == 'on' %} 18 | off 19 | {% elif states(reference_entity) == 'off' %} 20 | on 21 | {% else %} 22 | {{ states(reference_entity) }} 23 | {% endif %} 24 | # delay_on: not_used in this example 25 | # delay_off: not_used in this example 26 | # auto_off: not_used in this example 27 | availability: "{{ states(reference_entity) not in ('unknown', 'unavailable') }}" 28 | -------------------------------------------------------------------------------- /esphome/usb_switch_2.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: usb_switch_2 3 | upper_devicename: USB Switch 2 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: esp8285 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO16 30 | #inverted: yes 31 | 32 | binary_sensor: 33 | - platform: gpio 34 | id: button 35 | pin: 36 | number: GPIO4 37 | mode: INPUT_PULLUP 38 | inverted: yes 39 | on_press: 40 | - switch.toggle: $devicename 41 | 42 | switch: 43 | - platform: gpio 44 | id: $devicename 45 | name: $upper_devicename 46 | pin: GPIO5 47 | on_turn_on: 48 | - switch.turn_on: relay_led 49 | on_turn_off: 50 | - switch.turn_off: relay_led 51 | 52 | - platform: gpio 53 | id: relay_led 54 | pin: 55 | number: GPIO14 56 | inverted: yes 57 | -------------------------------------------------------------------------------- /esphome/usb_switch_3.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: usb_switch_3 3 | upper_devicename: USB Switch 3 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: esp8285 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO16 30 | #inverted: yes 31 | 32 | binary_sensor: 33 | - platform: gpio 34 | id: button 35 | pin: 36 | number: GPIO4 37 | mode: INPUT_PULLUP 38 | inverted: yes 39 | on_press: 40 | - switch.toggle: $devicename 41 | 42 | switch: 43 | - platform: gpio 44 | id: $devicename 45 | name: $upper_devicename 46 | pin: GPIO5 47 | on_turn_on: 48 | - switch.turn_on: relay_led 49 | on_turn_off: 50 | - switch.turn_off: relay_led 51 | 52 | - platform: gpio 53 | id: relay_led 54 | pin: 55 | number: GPIO14 56 | inverted: yes 57 | -------------------------------------------------------------------------------- /lovelace/cards/media_players/media_shortcuts.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - type: "custom:button-card" 6 | name: Watch Later 7 | icon: si:youtube 8 | size: 50px 9 | tap_action: 10 | action: call-service 11 | service: script.turn_on 12 | service_data: 13 | entity_id: script.shield_tv_play 14 | variables: 15 | entity_id: media_player.stue_shield_adb 16 | url: "https://www.youtube.com/playlist?list=WL" 17 | activity: org.smarttube.stable/com.liskovsoft.smartyoutubetv2.tv.ui.main.SplashActivity 18 | press_enter: yes 19 | - type: "custom:button-card" 20 | name: GDQ 21 | icon: mdi:timer-outline 22 | size: 50px 23 | tap_action: 24 | action: call-service 25 | service: remote.turn_on 26 | service_data: 27 | entity_id: script.shield_tv_play 28 | variables: 29 | entity_id: media_player.stue_shield_adb 30 | url: "twitch://stream/gamesdonequick" 31 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/compact_thermostat.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: horizontal-stack 3 | cards: 4 | - type: "custom:button-card" 5 | entity: "[[entity]]" 6 | icon: "[[icon]]" 7 | triggers_update: 8 | - "[[entity]]" 9 | name: "[[[return states['[[entity]]'].attributes['temperature'] + '°']]]" 10 | label: "[[[return states['[[entity]]'].attributes['current_temperature'] + '°']]]" 11 | show_state: false 12 | show_label: true 13 | layout: icon_state_name2nd 14 | color: var(--climate-state) 15 | hold_action: 16 | action: toggle 17 | tap_action: 18 | action: more-info 19 | styles: 20 | name: 21 | - font-size: 120% 22 | - margin-top: -16px 23 | label: 24 | - font-size: 80% 25 | - margin-bottom: 4px 26 | card: 27 | - padding-top: 1px 28 | - padding-bottom: 1px 29 | card_mod: 30 | style: | 31 | ha-icon { 32 | --climate-state: {% if state_attr('[[entity]]', 'hvac_action') == 'heating' %} var(--state-active-color) {% endif %}; 33 | } 34 | -------------------------------------------------------------------------------- /esphome/gang_tablet_lader.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: gang_tablet_lader 3 | upper_devicename: Gang Tablet Lader 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: esp8285 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO16 30 | #inverted: yes 31 | 32 | binary_sensor: 33 | - platform: gpio 34 | id: button 35 | pin: 36 | number: GPIO4 37 | mode: INPUT_PULLUP 38 | inverted: yes 39 | on_press: 40 | - switch.toggle: $devicename 41 | 42 | switch: 43 | - platform: gpio 44 | id: $devicename 45 | name: $upper_devicename 46 | pin: GPIO5 47 | on_turn_on: 48 | - switch.turn_on: relay_led 49 | on_turn_off: 50 | - switch.turn_off: relay_led 51 | 52 | - platform: gpio 53 | id: relay_led 54 | pin: 55 | number: GPIO14 56 | inverted: yes 57 | -------------------------------------------------------------------------------- /esphome/kokken_tablet_lader.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: kokken_tablet_lader 3 | upper_devicename: Køkken Tablet Lader 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: esp8285 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO16 30 | #inverted: yes 31 | 32 | binary_sensor: 33 | - platform: gpio 34 | id: button 35 | pin: 36 | number: GPIO4 37 | mode: INPUT_PULLUP 38 | inverted: yes 39 | on_press: 40 | - switch.toggle: $devicename 41 | 42 | switch: 43 | - platform: gpio 44 | id: $devicename 45 | name: $upper_devicename 46 | pin: GPIO5 47 | on_turn_on: 48 | - switch.turn_on: relay_led 49 | on_turn_off: 50 | - switch.turn_off: relay_led 51 | 52 | - platform: gpio 53 | id: relay_led 54 | pin: 55 | number: GPIO14 56 | inverted: yes 57 | -------------------------------------------------------------------------------- /lovelace/cards/lights/theme_button.yaml: -------------------------------------------------------------------------------- 1 | type: "custom:config-template-card" 2 | variables: 3 | theme_name: states['sensor.theme'].state 4 | primary_color_hue: states['sensor.theme'].attributes['primary_color'][0] 5 | primary_color_saturation: states['sensor.theme'].attributes['primary_color'][1] 6 | secondary_color_hue: states['sensor.theme'].attributes['secondary_color'][0] 7 | secondary_color_saturation: states['sensor.theme'].attributes['secondary_color'][1] 8 | entities: 9 | - sensor.theme 10 | card: 11 | type: "custom:button-card" 12 | name: "${ theme_name }" 13 | entity: input_select.theme 14 | show_name: false 15 | size: 40px 16 | color_type: card 17 | color: "${ 'hsl(' + primary_color_hue + ',' + primary_color_saturation + '%, 50%)' }" 18 | styles: 19 | icon: 20 | - color: "${ 'hsl(' + secondary_color_hue + ',' + secondary_color_saturation + '%, ' + (primary_color_hue != secondary_color_hue ? '50' : '20') + '%)' }" 21 | tap_action: 22 | action: fire-dom-event 23 | browser_mod: 24 | service: browser_mod.popup 25 | data: 26 | title: Temaer 27 | content: !include theme_selector.yaml 28 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/set_browser_id.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: custom:button-card 3 | name: "Set Browser ID to [[browser_id]]" 4 | label: >- 5 | [[[ 6 | // Get browser_mod-browser-id from local storage 7 | let currentBrowserId = localStorage.getItem('browser_mod-browser-id'); 8 | return currentBrowserId ? `Current Browser ID: ${currentBrowserId}` : 'Browser ID: Not set'; 9 | ]]] 10 | show_label: true 11 | show_name: true 12 | tap_action: 13 | action: fire-dom-event 14 | browser_mod: 15 | service: browser_mod.javascript 16 | data: 17 | code: > 18 | // Set the browser_mod-browser-id in local storage 19 | localStorage.setItem('browser_mod-browser-id', '[[browser_id]]'); 20 | // Reload lovelace to apply the new browser ID 21 | lovelace_reload(); 22 | styles: 23 | card: 24 | - background-color: "#bb0000" 25 | - display: | 26 | [[[ 27 | let currentBrowserId = localStorage.getItem('browser_mod-browser-id'); 28 | return currentBrowserId == '[[browser_id]]' 29 | ? 'none' 30 | : 'block'; 31 | ]]] 32 | -------------------------------------------------------------------------------- /custom_templates/osm.jinja: -------------------------------------------------------------------------------- 1 | {%- macro geocodejson_to_vw(feature, dest_name=none) -%} 2 | {%- set properties = feature.get('properties', {}) -%} 3 | {%- set geocoding = properties.get('geocoding', {}) -%} 4 | {%- set address = { 5 | 'country': geocoding.get('country', ''), 6 | 'zipCode': geocoding.get('postcode', ''), 7 | 'city': geocoding.get('city', ''), 8 | 'street': geocoding.get('street', '') ~ (' ' ~ geocoding.get('housenumber', '') if 'housenumber' in geocoding else '') 9 | } -%} 10 | {%- set fallback_name = address.get('street', '') ~ ', ' ~ address.get('city', '') -%} 11 | {%- set name = dest_name if dest_name else geocoding.get('name', fallback_name) -%} 12 | {%- set coordinates = feature.get('geometry', {}).get('coordinates', []) -%} 13 | {%- set lat = coordinates[1] if coordinates else None -%} 14 | {%- set lon = coordinates[0] if coordinates else None -%} 15 | {%- set vw = { 16 | 'name': name, 17 | 'address': address, 18 | 'geoCoordinate': { 19 | 'latitude': lat, 20 | 'longitude': lon 21 | } 22 | } -%} 23 | {{ vw | to_json }} 24 | {%- endmacro -%} 25 | -------------------------------------------------------------------------------- /www/style.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "SegoeUI"; 3 | font-weight: normal; 4 | src: url("/local/segoeui.ttf"); 5 | } 6 | 7 | @font-face { 8 | font-family: "SegoeUI"; 9 | font-weight: 100; 10 | src: url("/local/segoeuil.ttf"); 11 | } 12 | 13 | @font-face { 14 | font-family: "SegoeUI"; 15 | font-weight: 200; 16 | src: url("/local/segoeuisl.ttf"); 17 | } 18 | 19 | @font-face { 20 | font-family: "SegoeUI"; 21 | font-weight: 500; 22 | src: url("/local/seguisb.ttf"); 23 | } 24 | 25 | @font-face { 26 | font-family: "SegoeUI"; 27 | font-weight: bold; 28 | src: url("/local/segoeuib.ttf"); 29 | } 30 | 31 | @font-face { 32 | font-family: "SegoeUI"; 33 | font-weight: 900; 34 | src: url("/local/seguibl.ttf"); 35 | } 36 | 37 | body { 38 | font-family: Segoe UI Variable Static Text, Segoe UI, SegoeUI, -apple-system,BlinkMacSystemFont, sans-serif; 39 | } 40 | 41 | html { 42 | font-family: Segoe UI Variable Static Text, Segoe UI, SegoeUI, -apple-system,BlinkMacSystemFont, sans-serif; 43 | --paper-font-common-base_-_font-family: Segoe UI Variable Static Text, Segoe UI, SegoeUI, -apple-system,BlinkMacSystemFont, sans-serif; 44 | } 45 | -------------------------------------------------------------------------------- /blueprints/disable_vacuum_camera_update_when_docked.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | blueprint: 3 | name: Disable vacuum camera update when docked 4 | description: Disable the automatic update of the vacuum camera when the robot is docked. 5 | domain: automation 6 | source_url: https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/blob/master/blueprints/automation/disable_vacuum_camera_update_when_docked.yaml 7 | input: 8 | vacuum: 9 | name: Vacuum device 10 | selector: 11 | entity: 12 | domain: vacuum 13 | camera: 14 | name: Vacuum camera 15 | selector: 16 | entity: 17 | domain: camera 18 | 19 | mode: restart 20 | 21 | trigger: 22 | - platform: state 23 | entity_id: !input vacuum 24 | 25 | condition: 26 | - condition: template 27 | value_template: "{{ trigger.to_state.state != trigger.from_state.state }}" 28 | 29 | action: 30 | - condition: trigger 31 | id: 0 32 | - action: | 33 | {% if trigger.to_state.state in ["unavailable", "unknown", "docked"] %} 34 | camera.turn_off 35 | {% else %} 36 | camera.turn_on 37 | {% endif %} 38 | entity_id: !input camera 39 | -------------------------------------------------------------------------------- /python_scripts/services.yaml: -------------------------------------------------------------------------------- 1 | input_select_set_options: 2 | name: Set Options for Input Select 3 | description: Set online input_select option_list from entity state, attribute or string 4 | fields: 5 | entity_id: 6 | name: Entity ID 7 | description: The entity_id of the input_select 8 | selector: 9 | entity: 10 | domain: input_select 11 | data_source: 12 | name: Data Source 13 | description: | 14 | The source of the data to use for the options. This can be any one of the following: 15 | - An entity_id (e.g., `media_player.stue`) 16 | - An entity_id with an attribute (e.g., `media_player.stue.source_list`) 17 | - A comma-separated list of strings (e.g., `'On,Off'`) 18 | - A single string (e.g., `'Pause'`) 19 | selector: 20 | text: {} 21 | prepend_items: 22 | name: Prepend Items 23 | description: Items to add to the beginning of the list 24 | selector: 25 | text: 26 | multiple: true 27 | append_items: 28 | name: Append Items 29 | description: Items to add to the end of the list 30 | selector: 31 | text: 32 | multiple: true 33 | -------------------------------------------------------------------------------- /lovelace/cards/transport/car_destinations.yaml: -------------------------------------------------------------------------------- 1 | type: grid 2 | columns: 3 3 | square: false 4 | cards: 5 | - type: custom:button-card 6 | entity: script.send_upcoming_travel_location 7 | name: Næste tur 8 | icon: mdi:map-marker-path 9 | show_name: true 10 | show_icon: true 11 | tap_action: 12 | action: toggle 13 | - type: custom:button-card 14 | entity: script.send_home_destination 15 | name: Hjem 16 | icon: mdi:home 17 | show_name: true 18 | show_icon: true 19 | tap_action: 20 | action: toggle 21 | - type: custom:button-card 22 | entity: script.send_rsh_destination 23 | name: RSH 24 | icon: mdi:hospital-building 25 | show_name: true 26 | show_icon: true 27 | tap_action: 28 | action: toggle 29 | - type: custom:button-card 30 | entity: script.send_rsr_destination 31 | name: RSR 32 | icon: mdi:hospital-building 33 | show_name: true 34 | show_icon: true 35 | tap_action: 36 | action: toggle 37 | - type: custom:button-card 38 | entity: script.send_foraeldre_destination 39 | name: Forældre 40 | icon: mdi:home-heart 41 | show_name: true 42 | show_icon: true 43 | tap_action: 44 | action: toggle 45 | -------------------------------------------------------------------------------- /lovelace/cards/power_gauges_compact.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: custom:stack-in-card 4 | mode: horizontal 5 | cards: 6 | - type: custom:button-card 7 | entity: sensor.energi_data_service 8 | icon: mdi:cash 9 | show_state: true 10 | show_name: false 11 | show_icon: false 12 | state_display: | 13 | [[[ 14 | var result = Number(entity.state).toFixed(2).replace('.',','); 15 | return result.concat(" DKK/kWt"); 16 | ]]] 17 | tap_action: 18 | action: fire-dom-event 19 | browser_mod: 20 | service: browser_mod.popup 21 | data: 22 | size: wide 23 | timeout: 60000 24 | content: 25 | type: vertical-stack 26 | cards: 27 | - !include energy_prices/power_price_graphs.yaml 28 | - type: custom:button-card 29 | entity: sensor.pow_k_import_active 30 | show_state: true 31 | show_name: false 32 | show_icon: false 33 | - type: custom:button-card 34 | entity: sensor.energy_cost_hourly 35 | show_state: true 36 | show_name: false 37 | show_icon: false 38 | -------------------------------------------------------------------------------- /pyscript/duplicate_package_names.py: -------------------------------------------------------------------------------- 1 | import os 2 | from collections import defaultdict 3 | 4 | 5 | async def find_duplicate_filenames(folder_path): 6 | filename_dict = defaultdict(list) 7 | 8 | for dirpath, dirnames, filenames in os.walk(folder_path): 9 | for filename in filenames: 10 | # Ignore hidden files and directories 11 | if ( 12 | filename.startswith('.') 13 | or os.sep+"." in dirpath 14 | ): 15 | continue 16 | 17 | full_path = os.path.join(dirpath, filename) 18 | filename_dict[filename].append(full_path) 19 | 20 | # Filter out filenames that do not have duplicates 21 | duplicates = { 22 | filename: paths 23 | for filename, paths in filename_dict.items() if len(paths) > 1 24 | } 25 | 26 | return duplicates 27 | 28 | 29 | @service # noqa: F821 30 | async def find_duplicate_package_names(): 31 | """yaml 32 | name: Find Duplicate Package Names 33 | description: Find duplicate filenames in the config folder. 34 | """ 35 | folder_path = "/config/packages" 36 | duplicates = find_duplicate_filenames(folder_path) 37 | 38 | event.fire("duplicate_package_names", duplicates=duplicates) # noqa: F821 39 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/sonos_group_button.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: custom:button-card 3 | entity: "sensor.[[room]]_speaker_group_state" 4 | name: | 5 | [[[ 6 | return states['media_player.[[room]]'].attributes.friendly_name; 7 | ]]] 8 | styles: 9 | name: 10 | - font-size: 70% 11 | icon: mdi:speaker 12 | color: orange 13 | state: 14 | - value: | 15 | [[[ 16 | return "leader - "+states["sensor.[[room]]_speaker_lead_by"].state; 17 | ]]] 18 | icon: mdi:speaker-wireless 19 | color: green 20 | - value: | 21 | [[[ 22 | return "member - "+states["sensor.[[room]]_speaker_lead_by"].state; 23 | ]]] 24 | icon: mdi:speaker-multiple 25 | color: green 26 | - operator: regex 27 | value: "leader - (.+)" 28 | icon: mdi:speaker-wireless 29 | color: orange 30 | - operator: regex 31 | value: "member - (.+)" 32 | icon: mdi:speaker-multiple 33 | color: orange 34 | tap_action: 35 | action: call-service 36 | service: script.join_unjoin_sonos_group 37 | data: 38 | entity_id: "media_player.[[room]]" 39 | leader_entity_id: | 40 | [[[ 41 | return states["sensor.[[origin_room]]_speaker_lead_by"].state; 42 | ]]] 43 | -------------------------------------------------------------------------------- /lovelace/cards/mode_toggles_vertical.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: "custom:button-card" 4 | entity: input_boolean.vacation_mode 5 | tap_action: 6 | action: none 7 | hold_action: 8 | action: call-service 9 | service: input_boolean.toggle 10 | service_data: 11 | entity_id: input_boolean.vacation_mode 12 | - type: conditional 13 | conditions: 14 | - condition: user 15 | users: 16 | - 363204d3b6c1483f83ace3eb418e4170 17 | card: 18 | type: "custom:button-card" 19 | entity: input_boolean.guests 20 | tap_action: 21 | action: none 22 | hold_action: 23 | action: call-service 24 | service: input_boolean.toggle 25 | service_data: 26 | entity_id: input_boolean.guests 27 | - type: "custom:button-card" 28 | entity: script.migraine_mode 29 | tap_action: 30 | action: call-service 31 | service: script.turn_on 32 | service_data: 33 | entity_id: script.migraine_mode 34 | - type: "custom:button-card" 35 | entity: automation.delivery_unlock_front_door 36 | tap_action: 37 | action: call-service 38 | service: automation.toggle 39 | service_data: 40 | entity_id: automation.delivery_unlock_front_door 41 | -------------------------------------------------------------------------------- /lovelace/cards/power_gauges.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: custom:stack-in-card 4 | mode: horizontal 5 | cards: 6 | - type: gauge 7 | entity: sensor.energi_data_service 8 | name: Elpris 9 | unit: kr 10 | max: 10 11 | severity: 12 | green: 0 13 | yellow: 3 14 | red: 5 15 | min: 0 16 | needle: true 17 | tap_action: 18 | action: fire-dom-event 19 | browser_mod: 20 | service: browser_mod.popup 21 | data: 22 | size: wide 23 | timeout: 60000 24 | content: 25 | type: vertical-stack 26 | cards: 27 | - !include energy_prices/power_price_graphs.yaml 28 | 29 | - type: gauge 30 | entity: sensor.pow_k_import_active 31 | name: Forbrug 32 | max: 8000 33 | severity: 34 | green: 0 35 | yellow: 1000 36 | red: 3000 37 | needle: true 38 | 39 | - type: gauge 40 | entity: sensor.energy_cost_hourly 41 | name: Omkostning 42 | max: 10 43 | severity: 44 | green: 0 45 | yellow: 3 46 | red: 5 47 | min: 0 48 | needle: true 49 | -------------------------------------------------------------------------------- /custom_templates/geofence.jinja: -------------------------------------------------------------------------------- 1 | {%- macro point_in_polygon(lat, lon, points) -%} 2 | {#- 3 | Function to check if a point is inside a polygon. 4 | 5 | :param lat: Latitude of the point 6 | :param lon: Longitude of the point 7 | :param points: The vertices of the polygon. The loop is closed automatically. 8 | :return: True if the point is inside the polygon, False otherwise 9 | 10 | Example usage: 11 | ```yaml 12 | {{ point_in_polygon(55.734315, 12.441919, [ 13 | [55.734315, 12.441919], 14 | [55.734315, 12.440052], 15 | [55.733696, 12.440052], 16 | [55.733696, 12.441919] 17 | ]) }} 18 | ``` 19 | -#} 20 | {%- if points|length < 4 -%} 21 | The polygon must have at least 3 vertices 22 | {%- else -%} 23 | {%- set points = points + [[points[0][0], points[0][1]]] -%} 24 | {%- set ns = namespace(inside = False) -%} 25 | {%- for i in range(points | length - 1) -%} 26 | {%- set lat1, lon1 = points[i] -%} 27 | {%- set lat2, lon2 = points[i + 1] -%} 28 | {%- 29 | if (lon > lon1) != (lon > lon2) and 30 | (lat < (lat2 - lat1) * (lon - lon1) / (lon2 - lon1) + lat1) 31 | -%} 32 | {%- set ns.inside = not ns.inside -%} 33 | {%- endif -%} 34 | {%- endfor -%} 35 | {{ ns.inside }} 36 | {%- endif -%} 37 | {%- endmacro -%} 38 | -------------------------------------------------------------------------------- /lovelace/cards/low_battery.yaml: -------------------------------------------------------------------------------- 1 | type: custom:auto-entities 2 | card: 3 | type: entities 4 | title: Lavt Batteri 5 | show_header_toggle: false 6 | show_empty: false 7 | unique: true 8 | filter: 9 | include: 10 | - entity_id: "*_batter*" 11 | state: "<= 15" 12 | attributes: 13 | device_class: battery 14 | options: 15 | secondary_info: last-changed 16 | - entity_id: "*_batter*" 17 | state: "unavailable" 18 | attributes: 19 | device_class: battery 20 | options: 21 | secondary_info: last-changed 22 | - entity_id: "*_batter*" 23 | state: "low" 24 | options: 25 | secondary_info: last-changed 26 | - entity_id: "*_batter*" 27 | state: "on" 28 | attributes: 29 | device_class: battery 30 | options: 31 | secondary_info: last-changed 32 | exclude: 33 | - entity_id: "*_battery_power" 34 | - entity_id: "*_battery_state" 35 | - entity_id: "*_battery_health" 36 | - entity_id: "*_battery_temperature*" 37 | - entity_id: "*_batteritilstand" 38 | - entity_id: "*_batteriets_sundhed" 39 | - entity_id: "*_browser_battery" 40 | - entity_id: "*_target_state_of_charge" 41 | - entity_id: "*_tablet_kamera_battery_level" 42 | - entity_id: "*_tablet_kamera_battery_voltage" 43 | -------------------------------------------------------------------------------- /lovelace/cards/laundry.yaml: -------------------------------------------------------------------------------- 1 | type: horizontal-stack 2 | cards: 3 | - type: custom:button-card 4 | entity: binary_sensor.vaskemaskine 5 | name: | 6 | [[[ 7 | let program = states['sensor.vaskemaskine_program'].state; 8 | if (['unavailable', 'unknown'].includes(program)) 9 | return 'Vaskemaskine'; 10 | return program; 11 | ]]] 12 | state_display: | 13 | [[[ 14 | let status = states['sensor.vaskemaskine_status'].state; 15 | if (['unavailable', 'unknown'].includes(status)) 16 | return ' '; 17 | return status; 18 | ]]] 19 | label: | 20 | [[[ 21 | let time = states['sensor.wash_cycle_remaining_time'].state; 22 | if (['unavailable', 'unknown'].includes(time)) 23 | return ' '; 24 | return "~" + time + " min tilbage"; 25 | ]]] 26 | layout: icon_name_state2nd 27 | show_state: true 28 | show_label: true 29 | - type: custom:button-card 30 | entity: binary_sensor.torretumbler 31 | layout: icon_name_state2nd 32 | label: | 33 | [[[ 34 | let status = states['binary_sensor.torretumbler'].state; 35 | if (status == 'on') 36 | return Math.round(states['sensor.pow_k_l2_power'].state) + 'W'; 37 | return ' '; 38 | ]]] 39 | show_state: true 40 | show_label: true 41 | -------------------------------------------------------------------------------- /lovelace/cards/weekday.yaml: -------------------------------------------------------------------------------- 1 | type: custom:button-card 2 | entity: sensor.day_name 3 | show_state: true 4 | show_label: true 5 | show_name: false 6 | show_icon: false 7 | label: "[[[ if (states['calendar.helligdage'] && states['calendar.helligdage'].state == 'on') return states['calendar.helligdage'].attributes['message'] ]]]" 8 | tap_action: 9 | action: none 10 | triggers_update: 11 | - sensor.day_name 12 | - binary_sensor.workday 13 | - calendar.helligdage 14 | styles: 15 | grid: 16 | - grid-template-areas: '"s" "l"' 17 | - grid-template-rows: min-content min-content 18 | - grid-template-columns: 1fr 19 | state: 20 | - font-size: 48pt 21 | - text-shadow: "2px 2px 1px var(--secondary-text-color)" 22 | label: 23 | - font-size: 16pt 24 | - text-shadow: "1px 1px 1px var(--secondary-text-color)" 25 | card: 26 | - padding: 0 0 8px 0 27 | - color: | 28 | [[[ 29 | if (states['binary_sensor.workday'] && states['binary_sensor.workday'].state == 'off') return '#FFFFFF'; 30 | else return 'var(--primary-text-color)'; 31 | ]]] 32 | - background-color: | 33 | [[[ 34 | if (states['binary_sensor.workday'] && states['binary_sensor.workday'].state == 'off') return '#8EFA00AA'; 35 | else return 'var( --ha-card-background, var(--card-background-color, white) )'; 36 | ]]] 37 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/temp_graph_button_with_radiator.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: custom:stack-in-card 3 | mode: vertical 4 | cards: 5 | - type: custom:button-card 6 | size: 20px 7 | show_name: false 8 | show_state: true 9 | layout: icon_state 10 | color_type: icon 11 | icon: "[[icon]]" 12 | color: "[[color]]" 13 | entity: "sensor.[[room]]_temperatur" 14 | styles: 15 | state: 16 | - font-size: 18pt 17 | - font-weight: bold 18 | 19 | - type: custom:button-card 20 | size: 20px 21 | show_name: false 22 | show_state: true 23 | layout: icon_state 24 | icon: mdi:radiator 25 | entity: "sensor.[[room]]_radiator_temp" 26 | styles: 27 | icon: 28 | - color: > 29 | [[[ 30 | if (states['sensor.[[room]]_termostat_varmer'].state == '1') 31 | return "darkorange"; 32 | else 33 | return "var(--state-inactive-color)"; 34 | ]]] 35 | state: 36 | - font-size: 14pt 37 | 38 | - type: custom:button-card 39 | size: 20px 40 | show_name: false 41 | show_state: true 42 | layout: icon_state 43 | entity: "sensor.[[room]]_luftfugtighed" 44 | styles: 45 | state: 46 | - font-size: 14pt 47 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/room_climate.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: horizontal-stack 3 | cards: 4 | - type: custom:mini-graph-card 5 | name: "Temperatur" 6 | icon: mdi:thermometer 7 | points_per_hour: 12 8 | hours_to_show: 6 9 | hour24: true 10 | line_color: DarkOrange 11 | line_width: 8 12 | font_size: 75 13 | height: 250 14 | show: 15 | name: false 16 | icon: false 17 | labels: true 18 | entities: 19 | - sensor.[[rum]]_temperatur 20 | 21 | - type: custom:mini-graph-card 22 | name: "Luftfugtighed" 23 | icon: mdi:water-percent 24 | points_per_hour: 12 25 | hours_to_show: 6 26 | hour24: true 27 | line_color: DodgerBlue 28 | line_width: 8 29 | font_size: 75 30 | height: 250 31 | show: 32 | name: false 33 | icon: false 34 | labels: true 35 | entities: 36 | - sensor.[[rum]]_luftfugtighed 37 | 38 | - type: custom:mini-graph-card 39 | name: "Lys" 40 | points_per_hour: 12 41 | hours_to_show: 6 42 | hour24: true 43 | line_color: "#e74c3c" 44 | line_width: 8 45 | font_size: 75 46 | height: 250 47 | show: 48 | name: false 49 | icon: false 50 | labels: true 51 | entities: 52 | - sensor.[[rum]]_lysstyrke 53 | -------------------------------------------------------------------------------- /packages/automation/dishwasher.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: Dishwasher leak warning 3 | id: dishwasher_leak_warning 4 | initial_state: true 5 | triggers: 6 | trigger: state 7 | entity_id: binary_sensor.opvaskemaskine_lak 8 | to: "on" 9 | actions: 10 | - action: script.notify_everywhere 11 | data: 12 | message: "Vand under opvaskemaskinen!" 13 | 14 | - alias: Dishwasher running claim chore 15 | id: 5a97b74e-24c9-4926-a442-2d2877cd6810 16 | initial_state: true 17 | triggers: 18 | trigger: state 19 | entity_id: 20 | - sensor.opvaskemaskine_operationstate 21 | to: "BSH.Common.EnumType.OperationState.Run" 22 | actions: 23 | - action: kidschores.claim_chore 24 | data: 25 | kid_name: "Rook" 26 | chore_name: "Opvask" 27 | 28 | - alias: Dishwasher done set chore due date 29 | id: 98c85620-147c-44c4-a250-302572907883 30 | initial_state: true 31 | triggers: 32 | trigger: state 33 | entity_id: sensor.opvaskemaskine_operationstate 34 | to: "BSH.Common.EnumType.OperationState.End" 35 | actions: 36 | - action: kidschores.set_chore_due_date 37 | data: 38 | chore_name: "Tøm opvaskemaskine" 39 | due_date: "{{ (now() + timedelta(seconds=2)).strftime('%Y-%m-%dT%H:%M:%S') }}" 40 | -------------------------------------------------------------------------------- /packages/integrations/quest.yaml: -------------------------------------------------------------------------------- 1 | template: 2 | - binary_sensor: 3 | - name: Quest In Use Delayed 4 | unique_id: cbc142d8-2500-4fe7-ac68-b4332f220312 5 | state: "{{ is_state('binary_sensor.quest_in_use', 'on') }}" 6 | icon: mdi:virtual-reality 7 | delay_off: 8 | seconds: 30 9 | 10 | # Steam VR running sensor in HASS.Agent 11 | # Sensor setup: ProcessActive - vrserver 12 | - name: Rook-PC Steam VR 13 | unique_id: 40d907d5-33c7-4dd2-8459-81ab7f043818 14 | state: "{{ states('sensor.rook_pc_steam_vr_processes')|int(0) > 0 }}" 15 | icon: mdi:virtual-reality 16 | delay_off: 17 | seconds: 30 18 | 19 | - name: Quest Virtual Desktop In Use 20 | unique_id: 543bdd83-9f94-411f-8068-8f4f50f47ca3 21 | state: "{{ is_state('binary_sensor.quest_in_use', 'on') and is_state('binary_sensor.rook_pc_steam_vr', 'on') }}" 22 | icon: mdi:virtual-reality 23 | delay_off: 24 | seconds: 30 25 | 26 | automation: 27 | - alias: "Switch PC sound to VR" 28 | id: switch_pc_sound_to_vr 29 | mode: single 30 | initial_state: true 31 | triggers: 32 | - trigger: state 33 | entity_id: binary_sensor.quest_in_use 34 | to: "on" 35 | actions: 36 | - action: button.press 37 | target: 38 | entity_id: button.rook_pc_vr_sound 39 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/sonos_group_buttons.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: vertical-stack 3 | cards: 4 | - type: horizontal-stack 5 | cards: 6 | - type: custom:decluttering-card 7 | template: sonos_group_button 8 | variables: 9 | - room: stue 10 | - origin_room: "[[origin_room]]" 11 | 12 | - type: custom:decluttering-card 13 | template: sonos_group_button 14 | variables: 15 | - room: kokken 16 | - origin_room: "[[origin_room]]" 17 | 18 | - type: custom:decluttering-card 19 | template: sonos_group_button 20 | variables: 21 | - room: kontor 22 | - origin_room: "[[origin_room]]" 23 | 24 | - type: horizontal-stack 25 | cards: 26 | - type: custom:decluttering-card 27 | template: sonos_group_button 28 | variables: 29 | - room: sovevaerelse 30 | - origin_room: "[[origin_room]]" 31 | 32 | - type: custom:decluttering-card 33 | template: sonos_group_button 34 | variables: 35 | - room: badevaerelse 36 | - origin_room: "[[origin_room]]" 37 | 38 | - type: custom:decluttering-card 39 | template: sonos_group_button 40 | variables: 41 | - room: roam 42 | - origin_room: "[[origin_room]]" 43 | -------------------------------------------------------------------------------- /packages/automation/health.yaml: -------------------------------------------------------------------------------- 1 | script: 2 | migraine_mode: 3 | alias: Migræne Mode 4 | icon: mdi:head-flash 5 | sequence: 6 | - parallel: 7 | - event: set_light_profile 8 | event_data: 9 | profile: Night 10 | room: living_room 11 | - action: cover.close_cover 12 | target: 13 | entity_id: 14 | - cover.kontor_gardin 15 | - cover.stue_gardin 16 | - cover.sovevaerelse_gardin 17 | - action: script.set_volume_preset 18 | data: 19 | preset: low 20 | 21 | automation: 22 | - alias: Claim weight chore on weight update 23 | id: ca020a4b-bbe0-4e8f-869e-ba2dfacd67d5 24 | initial_state: true 25 | triggers: 26 | - trigger: state 27 | entity_id: sensor.withings_weight 28 | actions: 29 | - action: kidschores.claim_chore 30 | data: 31 | kid_name: "Rook" 32 | chore_name: "Vægt" 33 | 34 | - alias: Claim blood pressure chore on BP update 35 | id: ab734918-2f34-4e43-b48c-55e383d58855 36 | initial_state: true 37 | triggers: 38 | - trigger: state 39 | entity_id: sensor.darkphone_systolic_blood_pressure 40 | actions: 41 | - action: kidschores.claim_chore 42 | data: 43 | kid_name: "Rook" 44 | chore_name: "Blodtryk" 45 | -------------------------------------------------------------------------------- /esphome/door_spy.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: door_spy 3 | upper_devicename: Dørspion 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp32: 9 | board: esp32dev 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | # ESP32-CAM 28 | esp32_camera: 29 | external_clock: 30 | pin: GPIO0 31 | frequency: 20MHz 32 | i2c_pins: 33 | sda: GPIO26 34 | scl: GPIO27 35 | data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35] 36 | vsync_pin: GPIO25 37 | href_pin: GPIO23 38 | pixel_clock_pin: GPIO22 39 | power_down_pin: GPIO32 40 | 41 | name: $upper_devicename 42 | vertical_flip: true 43 | horizontal_mirror: true 44 | max_framerate: 2 fps 45 | idle_framerate: 0.05 fps 46 | resolution: 1024x768 47 | jpeg_quality: 10 48 | contrast: 2 49 | brightness: -2 50 | saturation: -2 51 | 52 | esp32_camera_web_server: 53 | - port: 8080 54 | mode: stream 55 | - port: 8081 56 | mode: snapshot 57 | 58 | # Flashlight 59 | output: 60 | - platform: gpio 61 | pin: GPIO4 62 | id: gpio_4 63 | light: 64 | - platform: binary 65 | output: gpio_4 66 | name: $upper_devicename Light 67 | -------------------------------------------------------------------------------- /packages/automation/rooms/automations/office_balcony_automations.yaml: -------------------------------------------------------------------------------- 1 | input_boolean: 2 | office_balcony_door_activity: 3 | initial: off 4 | name: Kontor Altan Dør Aktivitet 5 | 6 | template: 7 | - binary_sensor: 8 | - default_entity_id: binary_sensor.office_balcony_door_activity 9 | name: Kontor Altan Dør Aktivitet 10 | unique_id: 019b0416-4c65-729a-9cf3-fb5b9e1ce62e 11 | device_class: motion 12 | delay_off: 0:00:30 13 | state: "{{ is_state('input_boolean.office_balcony_door_activity', 'on') }}" 14 | 15 | automation: 16 | - alias: office_balcony_door_activity_on 17 | id: 3e1c2b9f-ad00-4781-b346-b0da8fbec9e8 18 | initial_state: true 19 | triggers: 20 | - trigger: state 21 | entity_id: binary_sensor.kontor_altandor 22 | to: "on" 23 | actions: 24 | - action: input_boolean.turn_on 25 | data: 26 | entity_id: input_boolean.office_balcony_door_activity 27 | 28 | - alias: office_balcony_door_activity_off 29 | id: e1204019-f3e1-472c-ba71-41015227f4cc 30 | initial_state: true 31 | triggers: 32 | - trigger: state 33 | entity_id: input_boolean.office_balcony_door_activity 34 | to: "on" 35 | for: 36 | seconds: 5 37 | actions: 38 | - action: input_boolean.turn_off 39 | data: 40 | entity_id: input_boolean.office_balcony_door_activity 41 | -------------------------------------------------------------------------------- /packages/integrations/smartir.yaml: -------------------------------------------------------------------------------- 1 | # https://github.com/smartHomeHub/SmartIRs 2 | smartir: 3 | check_updates: false 4 | 5 | climate: 6 | - platform: smartir 7 | name: Aircondition 8 | unique_id: 1abbddf2-edab-4b6b-9c99-f09eabb6a4a6 9 | device_code: 1382 10 | controller_data: remote.sovevarelse_ir_remote 11 | temperature_sensor: sensor.sovevaerelse_temperatur 12 | humidity_sensor: sensor.sovevaerelse_luftfugtighed 13 | # Disabled because it leads to inconsistent behavior 14 | # power_sensor: binary_sensor.aircondition_power 15 | # power_sensor_restore_state: true 16 | 17 | template: 18 | - binary_sensor: 19 | - name: Aircondition Power 20 | state: >- 21 | {{ states('sensor.aircondition_afbryder_forbrug') | float(0.0) > 0.1 }} 22 | 23 | automation: 24 | - alias: Ensure AC power on when ac climate started 25 | id: 2a88ce77-de4b-4454-9e57-b69ac7deba33 26 | initial_state: true 27 | mode: single 28 | triggers: 29 | - trigger: state 30 | entity_id: climate.aircondition 31 | not_to: "off" 32 | conditions: 33 | - condition: state 34 | entity_id: switch.aircondition_afbryder 35 | state: "off" 36 | actions: 37 | - action: switch.turn_on 38 | entity_id: switch.aircondition_afbryder 39 | - delay: 40 | seconds: 5 41 | - action: climate.turn_on 42 | entity_id: climate.aircondition 43 | -------------------------------------------------------------------------------- /packages/automation/rooms/automations/living_room_balcony_automations.yaml: -------------------------------------------------------------------------------- 1 | input_boolean: 2 | living_room_balcony_door_activity: 3 | initial: off 4 | name: Stue Altan Dør Aktivitet 5 | 6 | template: 7 | - binary_sensor: 8 | - default_entity_id: binary_sensor.living_room_balcony_door_activity 9 | name: Stue Altan Dør Aktivitet 10 | unique_id: 019b0415-9bcf-77c9-8dc4-d6ba630f77e1 11 | device_class: motion 12 | delay_off: 0:00:30 13 | state: "{{ is_state('input_boolean.living_room_balcony_door_activity', 'on') }}" 14 | 15 | automation: 16 | - alias: living_room_balcony_door_activity_on 17 | id: a9ab798e-6086-4054-b31f-9430bbc860b0 18 | initial_state: true 19 | triggers: 20 | - trigger: state 21 | entity_id: binary_sensor.stue_altandor 22 | to: "on" 23 | actions: 24 | - action: input_boolean.turn_on 25 | data: 26 | entity_id: input_boolean.living_room_balcony_door_activity 27 | 28 | - alias: living_room_balcony_door_activity_off 29 | id: f2716cf8-226a-408c-b7ef-8ff6ffdda3f5 30 | initial_state: true 31 | triggers: 32 | - trigger: state 33 | entity_id: input_boolean.living_room_balcony_door_activity 34 | to: "on" 35 | for: 36 | seconds: 5 37 | actions: 38 | - action: input_boolean.turn_off 39 | data: 40 | entity_id: input_boolean.living_room_balcony_door_activity 41 | -------------------------------------------------------------------------------- /custom_templates/group_totalizer.jinja: -------------------------------------------------------------------------------- 1 | {%- macro group_total(group_entity) -%} 2 | {%- set group_entities = state_attr(group_entity, 'entity_id')|default([]) -%} 3 | {%- set ns = namespace({'total': 0}) -%} 4 | {%- for entity in group_entities -%} 5 | {%- set value = states(entity) | int(0) -%} 6 | {%- set ns.total = ns.total + value -%} 7 | {%- endfor -%} 8 | {{ ns.total }} 9 | {%- endmacro -%} 10 | 11 | {%- macro group_max_possible(group_entity, default_max=10) -%} 12 | {%- set group_entities = state_attr(group_entity, 'entity_id')|default([]) -%} 13 | {%- set ns = namespace({'max': 0}) -%} 14 | {%- for entity in group_entities -%} 15 | {%- set max_value = state_attr(entity, 'max') | int(default_max) -%} 16 | {%- set ns.max = ns.max + max_value -%} 17 | {%- endfor -%} 18 | {{ ns.max }} 19 | {%- endmacro -%} 20 | 21 | {%- macro gropu_entity_count(group_entity) -%} 22 | {%- set group_entities = state_attr(group_entity, 'entity_id')|default([]) -%} 23 | {{ group_entities | length }} 24 | {%- endmacro -%} 25 | 26 | {%- macro group_totalizer(group_entity, default_max=10) -%} 27 | {%- set total = group_total(group_entity) | int(0) -%} 28 | {%- set max_possible = group_max_possible(group_entity, default_max) | int(0) -%} 29 | {%- if max_possible > 0 -%} 30 | {{ (total / max_possible * 100) | round(1) | int(0) }} 31 | {%- else -%} 32 | 0 33 | {%- endif -%} 34 | {%- endmacro -%} 35 | -------------------------------------------------------------------------------- /blueprints/automation/homeassistant/notify_leaving_zone.yaml: -------------------------------------------------------------------------------- 1 | blueprint: 2 | name: Zone Notification 3 | description: Send a notification to a device when a person leaves a specific zone. 4 | domain: automation 5 | source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml 6 | input: 7 | person_entity: 8 | name: Person 9 | selector: 10 | entity: 11 | domain: person 12 | zone_entity: 13 | name: Zone 14 | selector: 15 | entity: 16 | domain: zone 17 | notify_device: 18 | name: Device to notify 19 | description: Device needs to run the official Home Assistant app to receive notifications. 20 | selector: 21 | device: 22 | integration: mobile_app 23 | 24 | trigger: 25 | platform: state 26 | entity_id: !input person_entity 27 | 28 | variables: 29 | zone_entity: !input zone_entity 30 | # This is the state of the person when it's in this zone. 31 | zone_state: "{{ states[zone_entity].name }}" 32 | person_entity: !input person_entity 33 | person_name: "{{ states[person_entity].name }}" 34 | 35 | condition: 36 | condition: template 37 | value_template: "{{ trigger.from_state.state == zone_state and trigger.to_state.state != zone_state }}" 38 | 39 | action: 40 | domain: mobile_app 41 | type: notify 42 | device_id: !input notify_device 43 | message: "{{ person_name }} has left {{ zone_state }}" 44 | -------------------------------------------------------------------------------- /blueprints/automation/andrew-codechimp/battery_notes_battery_replaced.yaml: -------------------------------------------------------------------------------- 1 | blueprint: 2 | name: Battery Notes - Battery Replaced 3 | description: Set the battery replaced automatically when the battery increased 4 | author: andrew-codechimp 5 | source_url: https://raw.githubusercontent.com/andrew-codechimp/HA-Battery-Notes/main/docs/blueprints/battery_notes_battery_replaced.yaml 6 | domain: automation 7 | input: 8 | additional_conditions: 9 | name: Additional conditions 10 | description: 'Extra conditions you may want to add to this automation 11 | 12 | (Example: Home occupied) 13 | 14 | ' 15 | default: [] 16 | selector: 17 | condition: {} 18 | on_replaced_actions: 19 | name: On Replaced Actions 20 | description: User actions to run on battery replacement, the battery is marked 21 | as replaced automatically. Use any event data via trigger.event.data.xxx 22 | default: [] 23 | selector: 24 | action: {} 25 | triggers: 26 | - trigger: event 27 | event_type: battery_notes_battery_increased 28 | conditions: 29 | - alias: User pick 30 | condition: !input additional_conditions 31 | actions: 32 | - action: battery_notes.set_battery_replaced 33 | data: 34 | device_id: '{{ trigger.event.data.device_id }}' 35 | source_entity_id: '{{ trigger.event.data.source_entity_id }}' 36 | - alias: Run user on replaced actions 37 | choose: [] 38 | default: !input on_replaced_actions 39 | mode: queued 40 | -------------------------------------------------------------------------------- /lovelace-android-auto.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | non_admin_settings: 6 | kiosk: true 7 | 8 | views: 9 | - icon: mdi:menu 10 | title: Menu 11 | path: menu 12 | type: panel 13 | cards: 14 | - type: grid 15 | columns: 4 16 | square: false 17 | cards: 18 | - type: custom:button-card 19 | name: Bil 20 | icon: mdi:car 21 | show_state: false 22 | tap_action: 23 | action: navigate 24 | navigation_path: /lovelace-android-auto/car 25 | - type: custom:button-card 26 | name: Ladere 27 | icon: mdi:ev-station 28 | show_state: false 29 | tap_action: 30 | action: navigate 31 | navigation_path: /lovelace-android-auto/ladere 32 | - type: custom:button-card 33 | color_type: blank-card 34 | - type: custom:button-card 35 | color_type: blank-card 36 | 37 | - type: "custom:button-card" 38 | entity: input_boolean.vacation_mode 39 | tap_action: 40 | action: call-service 41 | service: input_boolean.toggle 42 | service_data: 43 | entity_id: input_boolean.vacation_mode 44 | - !include lovelace/cards/hoveddor_laas.yaml 45 | 46 | - !include lovelace/views/car.yaml 47 | -------------------------------------------------------------------------------- /lovelace/cards/vacuum_controls.yaml: -------------------------------------------------------------------------------- 1 | type: horizontal-stack 2 | cards: 3 | - type: custom:button-card 4 | tap_action: 5 | action: call-service 6 | service: script.turn_on 7 | service_data: 8 | entity_id: script.toggle_vacuum 9 | hold_action: 10 | action: more-info 11 | entity: vacuum.valetudo_roborocks5 12 | show_state: true 13 | show_name: false 14 | show_icon: true 15 | icon_height: 50px 16 | state: 17 | - value: "cleaning" 18 | styles: 19 | icon: 20 | - color: var(--state-active-color) 21 | - value: "docked" 22 | styles: 23 | icon: 24 | - color: var(--light-primary-color) 25 | - value: "returning" 26 | styles: 27 | icon: 28 | - color: var(--secondary-color) 29 | - value: "paused" 30 | styles: 31 | icon: 32 | - color: var(--secondary-color) 33 | - value: "idle" 34 | styles: 35 | icon: 36 | - color: var(--secondary-color) 37 | - value: "error" 38 | styles: 39 | icon: 40 | - color: var(--error-color) 41 | - type: custom:button-card 42 | tap_action: 43 | action: toggle 44 | entity: script.send_vacuum_to_emptying_position 45 | name: Tømmeposition 46 | icon: mdi:trash-can 47 | icon_height: 50px 48 | - type: custom:button-card 49 | tap_action: 50 | action: toggle 51 | entity: input_boolean.vacuum_show_card 52 | hold_action: 53 | action: none 54 | icon: mdi:menu 55 | icon_height: 50px 56 | -------------------------------------------------------------------------------- /lovelace/cards/kettle.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: custom:button-card 4 | entity: sensor.elkedel_status 5 | show_state: true 6 | show_label: true 7 | triggers_update: all 8 | name: "[[[ return Math.round(states['sensor.elkedel_temperatur'].state) + ' / ' + Math.round(states['number.elkedel_temperatur'].state) + ' °C' ]]]" 9 | label: > 10 | [[[ 11 | if (states['switch.elkedel_varmholdning'].state == 'on') 12 | return 'Varmholdning: ' + parseInt(states['number.elkedel_varmholdningstid'].state) + ' min tilbage'; 13 | else 14 | return 'Varmholdning slukket'; 15 | ]]] 16 | layout: icon_state_name2nd 17 | tap_action: 18 | action: call-service 19 | service: switch.toggle 20 | service_data: 21 | entity_id: switch.elkedel 22 | hold_action: 23 | action: call-service 24 | service: switch.toggle 25 | service_data: 26 | entity_id: switch.elkedel_varmholdning 27 | 28 | - type: entities 29 | show_header_toggle: false 30 | entities: 31 | - type: custom:slider-entity-row 32 | entity: number.elkedel_temperatur 33 | full_row: true 34 | - type: custom:slider-entity-row 35 | entity: number.elkedel_varmholdningstid 36 | full_row: true 37 | 38 | - type: history-graph 39 | title: Temperaturhistorik 40 | hours_to_show: 2 41 | refresh_interval: 60 42 | entities: 43 | - entity: sensor.elkedel_temperatur 44 | name: Temperatur 45 | - entity: number.elkedel_temperatur 46 | name: Ønsket temperatur 47 | -------------------------------------------------------------------------------- /lovelace/cards/weather/simple_weather.yaml: -------------------------------------------------------------------------------- 1 | type: custom:stack-in-card 2 | mode: vertical 3 | cards: 4 | - type: custom:config-template-card 5 | variables: 6 | - states['sensor.weather_card_name_text'].state 7 | entities: 8 | - weather.forecast_home 9 | - sensor.weather_card_name_text 10 | - sensor.translated_weather_title 11 | - sensor.dmi_vejr 12 | - binary_sensor.show_dmi_weather_warnings 13 | - sensor.dmi_aktuel_varsel 14 | - binary_sensor.show_dmi_coming_weather_warnings 15 | - sensor.dmi_kommende_varsler 16 | card: 17 | show_current: true 18 | show_forecast: false 19 | type: weather-forecast 20 | entity: weather.forecast_home 21 | name: ${vars[0]} 22 | forecast_type: daily 23 | secondary_info_attribute: wind_speed 24 | card_mod: 25 | style: 26 | .: | 27 | .state { 28 | font-size: 120% !important; 29 | float: left !important; 30 | } 31 | 32 | tap_action: 33 | action: fire-dom-event 34 | browser_mod: 35 | service: browser_mod.popup 36 | data: 37 | # title: Vejr 38 | size: wide 39 | timeout: 60000 40 | content: 41 | type: vertical-stack 42 | cards: 43 | - type: horizontal-stack 44 | cards: 45 | - !include weather_forecast.yaml 46 | - !include weather_radar.yaml 47 | - !include temp_graph.yaml 48 | 49 | - !include dmi_weather_warnings.yaml 50 | -------------------------------------------------------------------------------- /lovelace/cards/thermostats.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - type: custom:decluttering-card 6 | template: simple_thermostat 7 | variables: 8 | - entity: climate.stue 9 | - icon: mdi:sofa 10 | 11 | - type: custom:decluttering-card 12 | template: simple_thermostat 13 | variables: 14 | - entity: climate.kontor 15 | - icon: mdi:desktop-tower-monitor 16 | 17 | - type: horizontal-stack 18 | cards: 19 | - type: custom:decluttering-card 20 | template: simple_thermostat 21 | variables: 22 | - entity: climate.sovevaerelse 23 | - icon: mdi:bed 24 | 25 | - type: custom:decluttering-card 26 | template: simple_thermostat 27 | variables: 28 | - entity: climate.vaerksted 29 | - icon: mdi:hand-saw 30 | 31 | - type: horizontal-stack 32 | cards: 33 | - type: custom:decluttering-card 34 | template: simple_thermostat 35 | variables: 36 | - entity: climate.badevaerelse 37 | - icon: mdi:shower 38 | 39 | - type: custom:button-card 40 | name: Detaljer 41 | icon: mdi:vector-polyline 42 | styles: 43 | card: 44 | - height: 100px 45 | tap_action: 46 | action: fire-dom-event 47 | browser_mod: 48 | service: browser_mod.popup 49 | data: 50 | title: Detaljer 51 | content: 52 | type: vertical-stack 53 | cards: 54 | - !include climate/temp_graph.yaml 55 | -------------------------------------------------------------------------------- /packages/automation/telegram_yt_dlp.yaml: -------------------------------------------------------------------------------- 1 | shell_command: 2 | # Download videos using yt-dlp and return filenames of downloaded files as a json list 3 | yt_dlp: >- 4 | yt-dlp --print after_move:filepath -N 4 -f {{format_prefs}} {{flags}} -P {{output_folder}} -o {{output_file}} {{url}} 5 | 6 | script: 7 | yt_dlp: 8 | alias: "yt-dlp" 9 | mode: parallel 10 | sequence: 11 | - action: shell_command.yt_dlp 12 | data: 13 | url: "{{ url }}" 14 | format_prefs: "best[ext=mp4]/bestvideo[height<=?720][ext=mp4][vcodec=avc1]+bestaudio[ext=m4a]/best" 15 | output_folder: "{{ output_folder or '/config/www/downlaod/telegram/'}}" 16 | output_file: "%(epoch+3600>%Y-%m%d)s/%(playlist_index|)s%(playlist_index& - |)s%(uploader).24s - %(title).48s.%(ext)s" 17 | flags: "--no-mtime --hls-use-mpegts --embed-metadata --restrict-filenames --trim-filenames 120 {{ additional_flags if additional_flags is defined else '' }}" 18 | target: 19 | entity_id: shell_command.yt_dlp 20 | 21 | automation: 22 | - alias: "Telegram yt-dlp" 23 | id: fedddc04-a5ac-4412-811d-b54d5f03cb0e 24 | triggers: 25 | trigger: event 26 | event_type: telegram_command 27 | event_data: 28 | command: "/yt-dlp" 29 | actions: 30 | - action: shell_command.yt_dlp 31 | response_variable: file_path 32 | data: 33 | url: "{{ trigger.event.data.text }}" 34 | # Send the file to the user as uncompressed file 35 | - action: telegram_bot.send_document 36 | data: 37 | target: "{{ trigger.event.data.chat_id }}" 38 | document: "{{ file_path }}" 39 | -------------------------------------------------------------------------------- /lovelace/cards/weather/temp_graph.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - type: custom:button-card 6 | size: 20px 7 | show_name: false 8 | show_state: true 9 | layout: icon_state 10 | entity: sensor.humidity 11 | styles: 12 | state: 13 | - font-size: 10pt 14 | 15 | - type: custom:button-card 16 | size: 20px 17 | show_name: false 18 | show_state: true 19 | layout: icon_state 20 | entity: sensor.pressure 21 | styles: 22 | state: 23 | - font-size: 10pt 24 | 25 | - type: custom:button-card 26 | size: 20px 27 | show_name: false 28 | show_state: true 29 | layout: icon_state 30 | entity: sensor.sun_elevation 31 | tap_action: 32 | action: more-info 33 | hold_action: 34 | action: more-info 35 | styles: 36 | state: 37 | - font-size: 10pt 38 | 39 | - type: custom:mini-graph-card 40 | points_per_hour: 4 41 | hours_to_show: 24 42 | hour24: true 43 | # line_width: 2 44 | upper_bound_secondary: 100 45 | lower_bound_secondary: 1 46 | show: 47 | labels: true 48 | labels_secondary: false 49 | entities: 50 | - entity: sensor.altan_temperatur 51 | name: Udenfor 52 | show_fill: false 53 | color: "#1ACF6D" 54 | - entity: sensor.sun_elevation_pct 55 | color: "#FFE67F" 56 | name: Sun Elevation 57 | show_line: false 58 | show_points: false 59 | show_legend: false 60 | y_axis: secondary 61 | -------------------------------------------------------------------------------- /blueprints/script/mundschenk-at/valetudo-send-vacuum-command.yaml: -------------------------------------------------------------------------------- 1 | blueprint: 2 | name: 'Valetudo: Send Vacuum Command' 3 | description: Sends a command to a vacuum robot running Valetudo 4 | source_url: https://github.com/mundschenk-at/ha-valetudo-blueprints/blob/main/yaml/script/valetudo-send-vacuum-command.yaml 5 | domain: script 6 | homeassistant: 7 | min_version: 2022.6.0 8 | input: 9 | robot: 10 | name: Robot 11 | description: The MQTT handle of the robot. 12 | selector: 13 | text: 14 | multiline: false 15 | multiple: false 16 | valetudo_mqtt_prefix: 17 | name: Valetudo MQTT prefix 18 | description: The MQTT prefix set in the Valetudo connectivity configuration. 19 | default: valetudo 20 | selector: 21 | text: 22 | multiline: false 23 | multiple: false 24 | variables: 25 | valetudo_prefix: !input valetudo_mqtt_prefix 26 | robot_prefix: !input robot 27 | sequence: 28 | - alias: Publish MQTT topic 29 | service: mqtt.publish 30 | data: 31 | topic: '{{valetudo_prefix|trim}}/{{robot_prefix|trim}}/{{mqtt_topic|trim}}' 32 | payload: '{{mqtt_payload|trim}}' 33 | fields: 34 | mqtt_topic: 35 | name: Topic 36 | description: The MQTT topic (without the Valetudo and robot prefixes). 37 | example: MapSegmentationCapability/clean/set 38 | required: true 39 | selector: 40 | text: 41 | multiline: false 42 | mqtt_payload: 43 | name: Payload 44 | description: The MQTT payload. 45 | default: 46 | example: '{}' 47 | required: true 48 | selector: 49 | text: 50 | multiline: true 51 | mode: parallel 52 | icon: mdi:robot-vacuum 53 | -------------------------------------------------------------------------------- /automations.yaml: -------------------------------------------------------------------------------- 1 | - id: "1654539328000" 2 | alias: Kontor TV - Turn On Action 3 | description: "" 4 | use_blueprint: 5 | path: cvroque/webostv_turn_on.yaml 6 | input: 7 | webostv: media_player.kontor_tv 8 | webostv_mac: 78:5D:C8:87:4C:10 9 | on_action: 10 | - action: media_player.select_source 11 | data: 12 | source: Chromecast 13 | target: 14 | entity_id: media_player.kontor_tv 15 | - id: "1654539426907" 16 | alias: Stue TV - Turn On Action 17 | description: "" 18 | use_blueprint: 19 | path: cvroque/webostv_turn_on.yaml 20 | input: 21 | webostv: media_player.stue_tv 22 | webostv_mac: 58:FD:B1:D3:FF:23 23 | on_action: 24 | - action: media_player.select_source 25 | data: 26 | source: HDMI 1 27 | target: 28 | entity_id: media_player.stue_tv 29 | - id: "1745586392158" 30 | alias: Battery Notes - Battery Replaced 31 | description: "" 32 | use_blueprint: 33 | path: andrew-codechimp/battery_notes_battery_replaced.yaml 34 | input: 35 | additional_conditions: 36 | - condition: state 37 | entity_id: binary_sensor.rook_presence_delayed 38 | state: "on" 39 | - id: "1746698110233" 40 | alias: "Valetudo: Notifications" 41 | description: "" 42 | use_blueprint: 43 | path: mundschenk-at/valetudo-notifications.yaml 44 | input: 45 | notify_device: 46 | - 38bb46d3e8c3d60f15a6beaf4d2974fa 47 | vacuum: vacuum.valetudo_roborocks5 48 | rendered_map: camera.valetudo_s5_camera 49 | error_message: sensor.valetudo_roborocks5_error 50 | status_flag: sensor.valetudo_roborocks5_status_flag 51 | -------------------------------------------------------------------------------- /packages/integrations/android_tv.yaml: -------------------------------------------------------------------------------- 1 | script: 2 | shield_tv_play: 3 | alias: "Play URL on Shield TV" 4 | fields: 5 | entity_id: 6 | description: "The entity_id of the Shield TV" 7 | example: media_player.stue_shield_adb 8 | url: 9 | description: "The URL to play" 10 | example: "https://www.youtube.com/watch?v=123456" 11 | intent: 12 | description: "(Optional) The intent to use" 13 | example: "android.intent.action.VIEW" 14 | activity: 15 | description: "(Optional) The activity to use" 16 | example: "com.google.android.youtube.tv" 17 | press_enter: 18 | description: "(Optional) Press enter after 10 seconds" 19 | example: "true" 20 | sequence: 21 | - choose: 22 | - conditions: 23 | - condition: template 24 | value_template: "{{ is_state(entity_id, 'off') }}" 25 | sequence: 26 | - action: media_player.turn_on 27 | data: 28 | entity_id: "{{ entity_id }}" 29 | - delay: 30 | seconds: 5 31 | - action: androidtv.adb_command 32 | data: 33 | entity_id: "{{ entity_id }}" 34 | command: >- 35 | am start -a {{ intent if intent else "android.intent.action.VIEW" }} -d "{{ url }}" {{ "-n "~activity if activity else "" }} 36 | - condition: "{{ True if press_enter != undefined else False }}" 37 | - delay: 38 | seconds: 5 39 | - action: remote.send_command 40 | data: 41 | command: DPAD_CENTER 42 | target: 43 | entity_id: "{{ entity_id.replace('media_player', 'remote').replace('_adb', '') }}" 44 | -------------------------------------------------------------------------------- /packages/integrations/mqtt.yaml: -------------------------------------------------------------------------------- 1 | shell_command: 2 | read_mqtt_dump: "cat /config/mqtt_dump.txt" 3 | 4 | script: 5 | mqtt_clear_retained_messages: 6 | fields: 7 | topic: 8 | description: "The topic to clear retained messages for" 9 | example: "my/topic/#" 10 | sequence: 11 | # Dump retained messages to /config/mqtt_dump.txt 12 | - action: mqtt.dump 13 | data: 14 | topic: "{{ topic }}" 15 | duration: 1 16 | # Read the dump 17 | - delay: 18 | seconds: 2 19 | - action: shell_command.read_mqtt_dump 20 | response_variable: mqtt_dump 21 | - variables: 22 | topics: >- 23 | {% set lines = (mqtt_dump.stdout | trim).split('\n') %} 24 | {% set ns = namespace(ret=[]) %} 25 | {% for line in lines %} 26 | {% if line == '' %}{% continue %}{% endif %} 27 | {% set topic, _ = line.split(',') %} 28 | {% set ns.ret = ns.ret + [topic] %} 29 | {% endfor %} 30 | 31 | {{ ns.ret }} 32 | # Clear retained messages 33 | - repeat: 34 | count: "{{ topics | length }}" 35 | sequence: 36 | - variables: 37 | topic: "{{ topics[repeat.index-1] }}" 38 | - condition: template 39 | value_template: "{{ topic and topic != '' }}" 40 | - action: mqtt.publish 41 | data: 42 | topic: "{{ topic }}" 43 | payload: "" 44 | retain: true 45 | 46 | - variables: 47 | return: 48 | topics: "{{ topics }}" 49 | 50 | - stop: Return cleared topics 51 | response_variable: "return" 52 | -------------------------------------------------------------------------------- /lovelace/cards/media_players/active_media_player_controls.yaml: -------------------------------------------------------------------------------- 1 | type: conditional 2 | conditions: 3 | - entity: sensor.sonos_group_leader_room 4 | state_not: "" 5 | card: 6 | type: "custom:config-template-card" 7 | entities: 8 | # Must include every entity that is used in the templates and included cards 9 | - sensor.sonos_group_leader 10 | - sensor.sonos_group_leader_room 11 | - media_player.badevaerelse 12 | - media_player.kokken 13 | - media_player.kontor 14 | - media_player.roam 15 | - media_player.sovevaerelse 16 | - media_player.stue 17 | # "input_boolean.show_[[room]]_speaker_details" 18 | - input_boolean.show_badevaerelse_speaker_details 19 | - input_boolean.show_kokken_speaker_details 20 | - input_boolean.show_kontor_speaker_details 21 | - input_boolean.show_roam_speaker_details 22 | - input_boolean.show_sovevaerelse_speaker_details 23 | - input_boolean.show_stue_speaker_details 24 | # "sensor.[[room]]_speaker_group_state" 25 | - sensor.badevaerelse_speaker_group_state 26 | - sensor.kokken_speaker_group_state 27 | - sensor.kontor_speaker_group_state 28 | - sensor.roam_speaker_group_state 29 | - sensor.sovevaerelse_speaker_group_state 30 | - sensor.stue_speaker_group_state 31 | # "sensor.[[room]]_speaker_lead_by" 32 | - sensor.badevaerelse_speaker_lead_by 33 | - sensor.kokken_speaker_lead_by 34 | - sensor.kontor_speaker_lead_by 35 | - sensor.roam_speaker_lead_by 36 | - sensor.sovevaerelse_speaker_lead_by 37 | - sensor.stue_speaker_lead_by 38 | card: 39 | type: custom:decluttering-card 40 | template: speaker_control_v2 41 | variables: 42 | - room: "${states['sensor.sonos_group_leader_room'].state}" 43 | -------------------------------------------------------------------------------- /lovelace/cards/transport/car.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - !include car_card.yaml 6 | 7 | - type: custom:apexcharts-card 8 | header: 9 | show: false 10 | graph_span: 12h 11 | apex_config: 12 | chart: 13 | height: 105px 14 | offsetX: -2 15 | sparkline: 16 | enabled: true 17 | legend: 18 | show: false 19 | yaxis: 20 | - id: pct 21 | min: 0 22 | max: 100 23 | apex_config: 24 | labels: 25 | show: false 26 | - id: kw 27 | min: 0 28 | max: 100 29 | apex_config: 30 | labels: 31 | show: false 32 | all_series_config: 33 | stroke_width: 2 34 | series: 35 | - entity: number.id_3_pro_charging_target_level 36 | yaxis_id: pct 37 | color: lightblue 38 | name: Max 39 | fill_raw: last 40 | curve: stepline 41 | type: area 42 | opacity: 0.2 43 | show: 44 | legend_value: false 45 | - entity: sensor.id_3_pro_soc_primary 46 | yaxis_id: pct 47 | color: green 48 | name: SoC 49 | fill_raw: last 50 | curve: stepline 51 | show: 52 | legend_value: false 53 | - entity: sensor.id_3_pro_charging_power 54 | yaxis_id: kw 55 | color: DarkOrange 56 | name: kW 57 | fill_raw: last 58 | curve: stepline 59 | show: 60 | legend_value: false 61 | 62 | - !include car_parking.yaml 63 | -------------------------------------------------------------------------------- /lovelace/cards/weather/dmi_weather_warnings.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: conditional 4 | conditions: 5 | - entity: binary_sensor.show_dmi_weather_warnings 6 | state: "on" 7 | card: 8 | type: custom:button-card 9 | card_mod: 10 | style: > 11 | #card { 12 | padding: 2px 0 !important; 13 | } 14 | #container { 15 | margin: 0 8px !important; 16 | grid-template-columns: 20% 1fr !important; 17 | } 18 | #icon { 19 | width: 50% !important; 20 | 21 | background-color: white; 22 | border-radius: 5px; 23 | border: 1px solid #ccc; 24 | } 25 | show_name: false 26 | show_icon: false 27 | show_state: true 28 | show_entity_picture: true 29 | layout: icon_state 30 | entity: sensor.dmi_aktuel_varsel 31 | styles: 32 | state: 33 | - font-size: 14pt 34 | - white-space: normal 35 | tap_action: 36 | action: fire-dom-event 37 | browser_mod: 38 | service: browser_mod.popup 39 | data: 40 | title: Alle Varsler 41 | content: !include dmi_aktuelle_varsler.yaml 42 | 43 | - type: conditional 44 | conditions: 45 | - entity: binary_sensor.show_dmi_coming_weather_warnings 46 | state: "on" 47 | card: 48 | type: custom:button-card 49 | show_icon: false 50 | layout: name_state 51 | entity: sensor.dmi_kommende_varsler 52 | tap_action: 53 | action: fire-dom-event 54 | browser_mod: 55 | service: browser_mod.popup 56 | data: 57 | title: Kommende Varsler 58 | content: !include dmi_kommende_varsler.yaml 59 | -------------------------------------------------------------------------------- /packages/automation/illuminance_sensor_filtering.yaml: -------------------------------------------------------------------------------- 1 | template: 2 | - sensor: 3 | - name: Stue Lysstyrke 4 | state: >- 5 | {{ '200.0' if states('sensor.stue_illuminance')|int > 199 else states('sensor.stue_illuminance') }} 6 | unit_of_measurement: lx 7 | device_class: illuminance 8 | state_class: measurement 9 | - name: Køkken Lysstyrke 10 | state: >- 11 | {{ '200.0' if states('sensor.kokken_illuminance')|int > 199 else states('sensor.kokken_illuminance') }} 12 | unit_of_measurement: lx 13 | device_class: illuminance 14 | state_class: measurement 15 | - name: Kontor Lysstyrke 16 | state: >- 17 | {{ '200.0' if states('sensor.kontor_illuminance')|int > 199 else states('sensor.kontor_illuminance') }} 18 | unit_of_measurement: lx 19 | device_class: illuminance 20 | state_class: measurement 21 | - name: Badeværelse Lysstyrke 22 | state: >- 23 | {{ '200.0' if states('sensor.badevaerelse_illuminance')|int > 199 else states('sensor.badevaerelse_illuminance') }} 24 | unit_of_measurement: lx 25 | device_class: illuminance 26 | state_class: measurement 27 | - name: Soveværelse Lysstyrke 28 | state: >- 29 | {{ '200.0' if states('sensor.sovevaerelse_illuminance')|int > 199 else states('sensor.sovevaerelse_illuminance') }} 30 | unit_of_measurement: lx 31 | device_class: illuminance 32 | state_class: measurement 33 | - name: Værksted Lysstyrke 34 | state: >- 35 | {{ '200.0' if states('sensor.vaerksted_illuminance')|int > 199 else states('sensor.vaerksted_illuminance') }} 36 | unit_of_measurement: lx 37 | device_class: illuminance 38 | state_class: measurement 39 | -------------------------------------------------------------------------------- /esphome/bedroom_shelf.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: bedroom_shelf 3 | upper_devicename: Bedroom Shelf 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: huzzah 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO5 30 | inverted: true 31 | # pin: GPIO05 32 | # id: status_red_pwm 33 | # pin: GPIO01 34 | # id: status_green_pwm 35 | 36 | output: !include shared/h801_pwm.yaml 37 | 38 | light: 39 | - platform: rgb 40 | id: ${devicename} 41 | name: ${upper_devicename} Spots 42 | red: red_pwm 43 | green: green_pwm 44 | blue: blue_pwm 45 | gamma_correct: 1.8 46 | default_transition_length: 250ms 47 | effects: !include shared/effects.yaml 48 | 49 | - platform: monochromatic 50 | id: ${devicename}_strip 51 | name: ${upper_devicename} Strip 52 | output: w1_pwm 53 | gamma_correct: 1.8 54 | default_transition_length: 250ms 55 | effects: 56 | - strobe: 57 | - flicker: 58 | - lambda: 59 | name: Fade 60 | update_interval: 1s 61 | lambda: |- 62 | static bool state = false; 63 | auto call = id(bedroom_shelf_strip).turn_on(); 64 | // Transtion of 1000ms = 1s 65 | call.set_transition_length(1000); 66 | if (state == false) { 67 | call.set_brightness(1.0); 68 | state = true; 69 | } else { 70 | call.set_brightness(0.01); 71 | state = false; 72 | } 73 | call.perform(); 74 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pid 2 | *.xml 3 | *.csr 4 | *.crt 5 | *.key 6 | *.pyc 7 | id_rsa 8 | id_rsa.pub 9 | OZW_Log.txt 10 | home-assistant.log* 11 | home-assistant_v2.db 12 | *.db-journal 13 | *.db-shm 14 | *.db-wal 15 | lib 16 | deps 17 | tts 18 | config 19 | haaska 20 | secrets.yaml 21 | known_devices.yaml 22 | google_calendars.yaml 23 | *.conf 24 | plex.conf 25 | phue.conf 26 | harmony_media_room.conf 27 | pyozw.sqlite 28 | zwcfg_*.xml 29 | zwscene.xml 30 | options.xml 31 | .* 32 | !/.gitignore 33 | !/.travis.yml 34 | html5_push_registrations.conf 35 | ip_bans.yaml 36 | /icloud/* 37 | feedreader.pickle 38 | /podcasts/* 39 | /templates/* 40 | emulated_hue_ids.json 41 | __pycache__/ 42 | *.py[cod] 43 | *$py.class 44 | entity_registry.yaml 45 | packages/zones.yaml 46 | packages/personal 47 | packages/personal/* 48 | lovelace/personal 49 | lovelace/personal/* 50 | lovelace-personal.yaml 51 | custom_templates/personal.jinja 52 | core 53 | notebooks/ 54 | appdaemon/appdaemon.yaml 55 | www/wifi.png 56 | www/downloads 57 | www/community 58 | www/custom_lovelace 59 | www/media 60 | www/camera 61 | www/chime_tts 62 | bluetooth_trackers.yaml 63 | custom_components/* 64 | googlecloud.json 65 | grocy/ 66 | bbconfig/ 67 | android/ 68 | 69 | music_assistant.db 70 | 71 | testbild.png 72 | ssocr-*.png 73 | 74 | node-red/ 75 | rtsp2webrtc_* 76 | go2rtc-* 77 | 78 | *.http 79 | ssh/* 80 | openvpn/* 81 | addons_autoscripts/* 82 | addons_config/* 83 | 84 | *-credentials.txt 85 | 86 | ui_lovelace_minimalist/* 87 | 88 | www/*.png 89 | media/sounds/temp/* 90 | 91 | www/dr-logoer/* 92 | 93 | vpn-configs-contrib 94 | vpn-configs-contrib/* 95 | 96 | mqtt_dump.txt 97 | 98 | git_status.txt 99 | zigbee.db 100 | blueprints/switch_manager/* 101 | data_examples 102 | data_examples/* 103 | custom_icons/* -------------------------------------------------------------------------------- /esphome/3d_printer_filament_camera.yaml: -------------------------------------------------------------------------------- 1 | external_components: 2 | - source: 3 | type: git 4 | url: https://github.com/MichaKersloot/esphome_custom_components 5 | components: [ esp32_camera ] 6 | 7 | substitutions: 8 | devicename: 3d_printer_filament_camera 9 | upper_devicename: 3D Printer Filament Camera 10 | 11 | esphome: 12 | name: $devicename 13 | 14 | esp32: 15 | board: esp32dev 16 | 17 | wifi: 18 | ssid: !secret wifi_ssid 19 | password: !secret wifi_pass 20 | 21 | # Enable logging 22 | logger: 23 | 24 | # Enable Home Assistant API 25 | api: 26 | encryption: 27 | key: !secret encryption_key 28 | 29 | ota: 30 | platform: esphome 31 | password: !secret ota_pass 32 | 33 | switch: 34 | - platform: restart 35 | name: "3D Printer Filament Camera Restart" 36 | 37 | # Flashlight 38 | output: 39 | - platform: ledc 40 | pin: GPIO4 41 | channel: 2 # channel 1 is used for esp32_camera 42 | id: led 43 | light: 44 | - platform: monochromatic 45 | output: led 46 | name: $upper_devicename Light 47 | 48 | esp32_camera_web_server: 49 | - port: 8080 50 | mode: stream 51 | - port: 8081 52 | mode: snapshot 53 | 54 | # ESP32-CAM 55 | esp32_camera: 56 | external_clock: 57 | pin: GPIO0 58 | frequency: 20MHz 59 | i2c_pins: 60 | sda: GPIO26 61 | scl: GPIO27 62 | data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35] 63 | vsync_pin: GPIO25 64 | href_pin: GPIO23 65 | pixel_clock_pin: GPIO22 66 | power_down_pin: GPIO32 67 | 68 | name: $upper_devicename 69 | vertical_flip: false 70 | horizontal_mirror: false 71 | # max_framerate: 5 fps 72 | # idle_framerate: 0.1 fps 73 | # resolution: 640x480 74 | # jpeg_quality: 30 75 | contrast: 1 76 | brightness: 2 77 | saturation: 0 78 | agc_gain_ceiling: 8x 79 | ae_level: 2 80 | # aec2: True 81 | -------------------------------------------------------------------------------- /lovelace/cards/gdq/next_to_watch_compact.yaml: -------------------------------------------------------------------------------- 1 | type: custom:button-card 2 | entity: sensor.gdq_next_watch_run 3 | name: "Next to Watch" 4 | state_display: "[[[ return entity.attributes.next_run.summary ]]]" 5 | label: "[[[ return entity.attributes.compact_time ]]]" 6 | custom_fields: 7 | category: "[[[ return '💯 '+entity.attributes.next_run.category ]]]" 8 | runner: "[[[ return '🏃‍♀️ '+entity.attributes.next_run.runner ]]]" 9 | layout: icon_name 10 | show_state: true 11 | show_name: true 12 | show_label: true 13 | size: 10% 14 | tap_action: 15 | action: url 16 | url_path: "https://gamesdonequick.com/schedule/" 17 | styles: 18 | grid: 19 | - grid-template-areas: | 20 | "i n n" 21 | "s s s" 22 | "runner runner runner" 23 | "category category category" 24 | "l l l" 25 | icon: 26 | - color: var(--success-color) 27 | - width: 1.8em 28 | - margin-right: 10px 29 | name: 30 | - margin-right: auto 31 | state: 32 | - font-weight: bold 33 | - color: >- 34 | [[[ 35 | if (entity.attributes.next_run.watch_game) return 'var(--success-color)'; 36 | else return 'inherit'; 37 | ]]] 38 | label: 39 | - font-size: 0.8em 40 | - font-weight: bold 41 | custom_fields: 42 | category: 43 | - text-align: left 44 | - margin-left: 0.1em 45 | - font-size: 0.75em 46 | - color: >- 47 | [[[ 48 | if (entity.attributes.next_run.watch_category) return 'var(--success-color)'; 49 | else return 'inherit'; 50 | ]]] 51 | runner: 52 | - text-align: left 53 | - margin-left: 0.1em 54 | - font-size: 0.75em 55 | - color: >- 56 | [[[ 57 | if (entity.attributes.next_run.watch_runner) return 'var(--success-color)'; 58 | else return 'inherit'; 59 | ]]] 60 | -------------------------------------------------------------------------------- /lovelace/cards/media_players/living_room_media.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - type: "custom:button-card" 6 | name: "Power" 7 | icon: mdi:power 8 | entity: switch.stue_tv_active 9 | lock: 10 | enabled: '[[[ return entity.state === "on"; ]]]' 11 | 12 | - type: "custom:button-card" 13 | name: Nvidia Shield 14 | icon: si:nvidia 15 | tap_action: 16 | action: call-service 17 | service: select.select_option 18 | service_data: 19 | entity_id: select.sync_box_hdmi_input 20 | option: "Nvidia Shield" 21 | state: 22 | - operator: template 23 | value: > 24 | [[[ 25 | return (states['select.sync_box_hdmi_input'].state === 'Nvidia Shield') 26 | ]]] 27 | color: "#76B900" 28 | lock: 29 | enabled: > 30 | [[[ 31 | return (states['select.sync_box_hdmi_input'].state !== 'Nvidia Shield') 32 | ]]] 33 | 34 | - type: "custom:button-card" 35 | name: Nintendo Switch 36 | icon: mdi:nintendo-switch 37 | tap_action: 38 | action: call-service 39 | service: select.select_option 40 | service_data: 41 | entity_id: select.sync_box_hdmi_input 42 | option: "Nintendo Switch" 43 | state: 44 | - operator: template 45 | value: > 46 | [[[ 47 | return (states['select.sync_box_hdmi_input'].state === 'Nintendo Switch') 48 | ]]] 49 | color: "#E60012" 50 | lock: 51 | enabled: > 52 | [[[ 53 | return (states['select.sync_box_hdmi_input'].state !== 'Nintendo Switch') 54 | ]]] 55 | -------------------------------------------------------------------------------- /esphome/3d_printer_enclosure.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: 3d_printer_enclosure 3 | upper_devicename: 3D Printer Enclosure 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: huzzah 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO5 30 | inverted: true 31 | # pin: GPIO05 32 | # id: status_red_pwm 33 | # pin: GPIO01 34 | # id: status_green_pwm 35 | 36 | output: 37 | - platform: esp8266_pwm 38 | frequency: 30000 Hz 39 | pin: GPIO15 40 | id: red_pwm 41 | 42 | - platform: esp8266_pwm 43 | frequency: 30000 Hz 44 | pin: GPIO13 45 | id: green_pwm 46 | 47 | - platform: esp8266_pwm 48 | frequency: 30000 Hz 49 | pin: GPIO12 50 | id: blue_pwm 51 | 52 | - platform: esp8266_pwm 53 | frequency: 200 Hz 54 | pin: GPIO14 55 | id: w1_pwm 56 | 57 | - platform: esp8266_pwm 58 | frequency: 200 Hz 59 | pin: GPIO4 60 | id: w2_pwm 61 | 62 | light: 63 | - platform: monochromatic 64 | output: w1_pwm 65 | name: $upper_devicename Light 66 | restore_mode: RESTORE_DEFAULT_ON 67 | 68 | fan: 69 | - platform: speed 70 | output: green_pwm 71 | id: fan_in 72 | name: "${upper_devicename} Ind" 73 | restore_mode: RESTORE_DEFAULT_OFF 74 | 75 | - platform: speed 76 | output: red_pwm 77 | id: fan_out_1 78 | name: "${upper_devicename} Ud" 79 | restore_mode: RESTORE_DEFAULT_OFF 80 | 81 | - platform: speed 82 | output: blue_pwm 83 | id: fan_out_2 84 | name: "${upper_devicename} Resin Ud" 85 | restore_mode: RESTORE_DEFAULT_OFF 86 | -------------------------------------------------------------------------------- /packages/automation/rooms/automations/bathroom_automations.yaml: -------------------------------------------------------------------------------- 1 | input_boolean: 2 | bathroom_door_activity: 3 | initial: off 4 | name: Badeværelse Dør Aktivitet 5 | showering: 6 | name: Bruser 7 | 8 | template: 9 | - binary_sensor: 10 | - default_entity_id: binary_sensor.bathroom_door_activity 11 | name: Badeværelse Dør Aktivitet 12 | unique_id: 019b0412-edbe-75fa-953e-85ba9d203d90 13 | device_class: motion 14 | delay_off: 0:00:30 15 | state: "{{ is_state('input_boolean.bathroom_door_activity', 'on') }}" 16 | - default_entity_id: binary_sensor.bathroom_occupied 17 | name: Badeværelse Optaget 18 | unique_id: 019b0413-faa0-73f5-8f82-790a9191e229 19 | device_class: occupancy 20 | state: "{{ is_state('binary_sensor.badevarelse_dor', 'off') and is_state('binary_sensor.badevarelse_las', 'off') }}" 21 | 22 | automation: 23 | - alias: bathroom_door_activity_on 24 | id: e7500347-c170-40a2-a12b-9228a83bd56a 25 | initial_state: true 26 | triggers: 27 | - trigger: state 28 | entity_id: binary_sensor.badevarelse_dor 29 | to: 30 | - "on" 31 | - "off" 32 | not_from: 33 | - "unavailable" 34 | - "unknown" 35 | actions: 36 | - action: input_boolean.turn_on 37 | data: 38 | entity_id: input_boolean.bathroom_door_activity 39 | 40 | - alias: bathroom_door_activity_off 41 | id: 21421df7-95cf-4e18-823f-b1c9dc88d03a 42 | initial_state: true 43 | triggers: 44 | - trigger: state 45 | entity_id: input_boolean.bathroom_door_activity 46 | to: 47 | - "on" 48 | - "off" 49 | for: 50 | seconds: 5 51 | actions: 52 | - action: input_boolean.turn_off 53 | data: 54 | entity_id: input_boolean.bathroom_door_activity 55 | -------------------------------------------------------------------------------- /custom_templates/room_state.jinja: -------------------------------------------------------------------------------- 1 | {%- macro room_group_active(room) -%} 2 | {%- set activity_entity_ids = state_attr('group.'+room+'_activity_entities', 'entity_id') or [] -%} 3 | {%- set motion_entity_ids = state_attr('group.'+room+'_motion_entities', 'entity_id') or [] -%} 4 | {%- set entity_ids = activity_entity_ids + motion_entity_ids -%} 5 | {%- set entity_states = entity_ids | map('states') | list -%} 6 | {%- set on_states = [ 7 | 'on', 8 | 'true', 9 | ] -%} 10 | {%- set active = entity_states | select('in', on_states) | list -%} 11 | {{ active | length > 0 }} 12 | {%- endmacro -%} 13 | 14 | {%- macro room_activity_state(room) -%} 15 | {%- if is_state('binary_sensor.'+room+'_activity', 'on') -%} 16 | on 17 | {%- elif is_state('binary_sensor.'+room+'_activity_predicted', 'on') -%} 18 | predicted 19 | {%- else -%} 20 | off 21 | {%- endif -%} 22 | {%- endmacro -%} 23 | 24 | {%- macro room_activity(room, force_off=false) -%} 25 | {%- if is_state('input_boolean.'+room+'_activity_override', 'on') -%} 26 | {{ 'true' if is_state('input_select.'+room+'_room_state', 'active') else 'false' }} 27 | {%- elif bool(room_group_active(room), false) -%} 28 | {%- if force_off -%} 29 | false 30 | {%- else -%} 31 | true 32 | {%- endif -%} 33 | {%- else -%} 34 | false 35 | {%- endif -%} 36 | {%- endmacro -%} 37 | 38 | {%- macro room_state(room) -%} 39 | {%- if is_state('input_boolean.'+room+'_activity_override', 'on') -%} 40 | {{ states('input_select.'+room+'_room_state') }} 41 | {%- elif is_state('binary_sensor.'+room+'_active', 'on') -%} 42 | active 43 | {%- elif is_state('binary_sensor.'+room+'_inactive', 'on') -%} 44 | inactive 45 | {%- else -%} 46 | off 47 | {%- endif -%} 48 | {%- endmacro -%} 49 | -------------------------------------------------------------------------------- /lovelace/views/tablets/living_room_tablet.yaml: -------------------------------------------------------------------------------- 1 | title: Stue Tablet 2 | path: kiosk 3 | icon: mdi:tablet 4 | panel: true 5 | cards: 6 | - type: vertical-stack 7 | cards: 8 | - type: horizontal-stack 9 | cards: 10 | - type: vertical-stack 11 | cards: 12 | - !include ../../cards/clock.yaml 13 | - !include ../../cards/weekday.yaml 14 | - !include ../../cards/weather/simple_weather.yaml 15 | 16 | - type: custom:decluttering-card 17 | template: room_light_profile 18 | variables: 19 | - room: living_room 20 | 21 | - type: custom:decluttering-card 22 | template: speaker_control_active_or_room 23 | variables: 24 | - room: stue 25 | 26 | - type: entities 27 | state_color: true 28 | entities: 29 | - cover.stue_gardin 30 | 31 | - !include ../../cards/climate/target_temperature.yaml 32 | 33 | - type: conditional 34 | conditions: 35 | - entity: input_boolean.guests 36 | state: "on" 37 | card: 38 | type: custom:html-card 39 | title: WiFi 40 | content: !secret ui_wifi_content 41 | 42 | - type: vertical-stack 43 | cards: 44 | - !include ../../cards/media_players/living_room_media.yaml 45 | 46 | - !include ../../cards/conditional_timers.yaml 47 | 48 | - type: conditional 49 | conditions: 50 | - entity: binary_sensor.octoprint_printing 51 | state: "on" 52 | card: !include ../../cards/3d_printer/preview.yaml 53 | 54 | - !include ../../cards/power_gauges.yaml 55 | -------------------------------------------------------------------------------- /packages/integrations/hass_agent.yaml: -------------------------------------------------------------------------------- 1 | template: 2 | - binary_sensor: 3 | - name: Rook PC 4 | unique_id: 98bac15b-619e-4626-be93-d4f61f3cb7d2 5 | state: >- 6 | {{ states('sensor.rook_pc_satellite_lastsystemstatechange') in [ 7 | 'ApplicationStarted', 8 | 'SessionUnlock', 9 | ] }} 10 | 11 | - name: Rook PC Unlocked 12 | unique_id: cd94651a-2680-4521-b072-30d0080d158a 13 | state: "{{ is_state('sensor.rook_pc_sessionstate', 'Unlocked') }}" 14 | 15 | - name: Rook PC Activity 16 | unique_id: 63675f4b-e97e-42be-b8dc-aa237bfe616f 17 | state: >- 18 | {{ 19 | not is_state('sensor.rook_pc_lastactive', 'unavailable') 20 | and not is_state('sensor.rook_pc_lastactive', 'unknown') 21 | and as_timestamp(now()) - (as_timestamp(states('sensor.rook_pc_lastactive'))|int(0)) < 300 22 | }} 23 | 24 | - trigger: 25 | trigger: event 26 | event_type: state_changed 27 | event_data: 28 | entity_id: sensor.rook_pc_lastactive 29 | binary_sensor: 30 | - name: Rook PC Activity Ping 31 | unique_id: ae7fe058-b8de-4613-927b-b801a1320e9a 32 | state: "{{ (states('sensor.rook_pc_lastactive') | as_timestamp) - (now() | as_timestamp) | int < 15 }}" 33 | device_class: motion 34 | auto_off: 1 35 | 36 | automation: 37 | - id: refresh_hass_agent_on_startup 38 | alias: Refresh HASS.agent on startup 39 | triggers: 40 | trigger: homeassistant 41 | event: start 42 | actions: 43 | - alias: "Refresh HASS.agent Satellite" 44 | action: switch.turn_on 45 | target: 46 | entity_id: switch.rook_pc_satellite_publishallsensors 47 | - alias: "Refresh HASS.agent" 48 | action: button.press 49 | target: 50 | entity_id: button.rook_pc_publishallsensors 51 | -------------------------------------------------------------------------------- /lovelace/cards/weather/weather_forecast.yaml: -------------------------------------------------------------------------------- 1 | type: custom:stack-in-card 2 | mode: vertical 3 | cards: 4 | - type: "custom:config-template-card" 5 | variables: 6 | - states['sensor.translated_weather_title'].state 7 | entities: 8 | - sensor.translated_weather_title 9 | card: 10 | type: weather-forecast 11 | entity: weather.forecast_home 12 | name: "${vars[0]}" 13 | forecast_type: daily 14 | show_forecast: false 15 | card_mod: 16 | style: 17 | .: | 18 | ha-card { 19 | background-color: transparent; 20 | box-shadow: none; 21 | padding-bottom: 2% !important; 22 | } 23 | span.title { 24 | left: 4em; 25 | font-size: 2em; 26 | } 27 | 28 | - type: custom:hourly-weather 29 | entity: weather.forecast_home 30 | name: " " 31 | icons: true 32 | show_wind: "speed" 33 | card_mod: 34 | style: 35 | $: | 36 | h1.card-header { 37 | padding: 0; 38 | margin: 0; 39 | } 40 | weather-bar $: | 41 | .wind { 42 | height: 1em; 43 | text-wrap: none; 44 | white-space: nowrap; 45 | } 46 | .: | 47 | ha-card { 48 | background-color: transparent; 49 | box-shadow: none; 50 | } 51 | .card-content { 52 | padding-bottom: 2px !important; 53 | } 54 | 55 | - type: custom:clock-weather-card 56 | entity: weather.forecast_home 57 | hide_today_section: true 58 | 59 | - !include dmi_weather_warnings.yaml 60 | - type: custom:mod-card 61 | card_mod: 62 | style: | 63 | #htmlCard { 64 | font-size: 120%; 65 | background: inherit; 66 | border: 0px; 67 | } 68 | card: !include dmi_weather_report.yaml 69 | -------------------------------------------------------------------------------- /lovelace/cards/printer.yaml: -------------------------------------------------------------------------------- 1 | type: conditional 2 | conditions: 3 | - entity: sensor.hp_colorlaserjet_m255_m256 4 | state_not: "unavailable" 5 | card: 6 | type: custom:button-card 7 | entity: sensor.hp_colorlaserjet_m255_m256 8 | name: Printer 9 | color: gray 10 | show_state: true 11 | styles: 12 | card: 13 | - padding: 0 0 5px 0 14 | icon: 15 | - width: 100% 16 | state: 17 | - text-align: left 18 | - width: 100% 19 | grid: 20 | - grid-template-areas: '"i c m y k" "n s s s s"' 21 | - grid-template-columns: 1fr 1fr 1fr 1fr 1fr 22 | - grid-template-rows: auto 1em 23 | custom_fields: 24 | k: 25 | - width: 80% 26 | - margin: auto 27 | c: 28 | - width: 80% 29 | - margin: auto 30 | m: 31 | - width: 80% 32 | - margin: auto 33 | y: 34 | - width: 80% 35 | - margin: auto 36 | custom_fields: 37 | k: 38 | card: 39 | type: custom:button-card 40 | template: inkwell 41 | icon: mdi:water 42 | entity: sensor.hp_colorlaserjet_m255_m256_black_cartridge_hp_w2210a 43 | variables: 44 | color: black 45 | c: 46 | card: 47 | type: custom:button-card 48 | template: inkwell 49 | icon: mdi:water 50 | entity: sensor.hp_colorlaserjet_m255_m256_cyan_cartridge_hp_w2211a 51 | variables: 52 | color: cyan 53 | m: 54 | card: 55 | type: custom:button-card 56 | template: inkwell 57 | icon: mdi:water 58 | entity: sensor.hp_colorlaserjet_m255_m256_magenta_cartridge_hp_w2213a 59 | variables: 60 | color: magenta 61 | y: 62 | card: 63 | type: custom:button-card 64 | template: inkwell 65 | icon: mdi:water 66 | entity: sensor.hp_colorlaserjet_m255_m256_yellow_cartridge_hp_w2212a 67 | variables: 68 | color: yellow 69 | -------------------------------------------------------------------------------- /lovelace/cards/climate/compact_thermostats_3x2.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - type: custom:decluttering-card 6 | template: compact_thermostat 7 | variables: 8 | - entity: climate.stue 9 | - icon: mdi:sofa 10 | 11 | - type: custom:decluttering-card 12 | template: compact_thermostat 13 | variables: 14 | - entity: climate.kontor 15 | - icon: mdi:desktop-tower-monitor 16 | 17 | - type: custom:decluttering-card 18 | template: compact_thermostat 19 | variables: 20 | - entity: climate.sovevaerelse 21 | - icon: mdi:bed 22 | 23 | - type: horizontal-stack 24 | cards: 25 | - type: custom:decluttering-card 26 | template: compact_thermostat 27 | variables: 28 | - entity: climate.vaerksted 29 | - icon: mdi:hand-saw 30 | 31 | - type: custom:decluttering-card 32 | template: compact_thermostat 33 | variables: 34 | - entity: climate.badevaerelse 35 | - icon: mdi:shower 36 | 37 | - type: custom:button-card 38 | name: Detaljer 39 | icon: mdi:vector-polyline 40 | layout: icon_state_name2nd 41 | show_state: false 42 | show_label: true 43 | label: " " 44 | styles: 45 | name: 46 | - font-size: 120% 47 | - margin-top: -17px 48 | - margin-bottom: -9px 49 | - padding-top: 9px 50 | card: 51 | - padding-top: 1px 52 | - padding-bottom: 1px 53 | tap_action: 54 | action: fire-dom-event 55 | browser_mod: 56 | service: browser_mod.popup 57 | data: 58 | title: Detaljer 59 | content: 60 | type: vertical-stack 61 | cards: 62 | - !include temp_graph.yaml 63 | -------------------------------------------------------------------------------- /esphome/krydderurter.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: krydderurter 3 | upper_devicename: Krydderurter 4 | 5 | esphome: 6 | # arduino_version: dev 7 | name: krydderurter 8 | 9 | esp32: 10 | board: esp-wrover-kit 11 | 12 | wifi: 13 | ssid: !secret wifi_ssid 14 | password: !secret wifi_pass 15 | 16 | # Enable logging 17 | logger: 18 | 19 | # Enable Home Assistant API 20 | api: 21 | encryption: 22 | key: !secret encryption_key 23 | 24 | ota: 25 | platform: esphome 26 | password: !secret ota_pass 27 | 28 | status_led: 29 | pin: 30 | number: GPIO2 31 | inverted: true 32 | 33 | text_sensor: 34 | - platform: version 35 | name: "ESPHome Version" 36 | 37 | switch: 38 | - platform: gpio 39 | id: relay_1 40 | name: "Relay 1" 41 | pin: 27 42 | inverted: yes 43 | 44 | - platform: gpio 45 | id: relay_2 46 | name: "Relay 2" 47 | pin: 26 48 | inverted: yes 49 | 50 | - platform: gpio 51 | id: relay_3 52 | name: "Relay 3" 53 | pin: 25 54 | inverted: yes 55 | 56 | - platform: gpio 57 | id: relay_4 58 | name: "Vandpumpe 1" 59 | pin: 33 60 | inverted: yes 61 | on_turn_on: 62 | - delay: 30s 63 | - switch.turn_off: relay_4 64 | 65 | esp32_ble_tracker: 66 | 67 | sensor: 68 | - platform: xiaomi_hhccjcy01 69 | mac_address: "80:EA:CA:89:63:D4" 70 | temperature: 71 | name: "Krydderurter 1 Temperature" 72 | moisture: 73 | name: "Krydderurter 1 Moisture" 74 | illuminance: 75 | name: "Krydderurter 1 Illuminance" 76 | conductivity: 77 | name: "Krydderurter 1 Soil Conductivity" 78 | - platform: xiaomi_hhccjcy01 79 | mac_address: "80:EA:CA:89:64:9C" 80 | temperature: 81 | name: "Krydderurter 2 Temperature" 82 | moisture: 83 | name: "Krydderurter 2 Moisture" 84 | illuminance: 85 | name: "Krydderurter 2 Illuminance" 86 | conductivity: 87 | name: "Krydderurter 2 Soil Conductivity" 88 | -------------------------------------------------------------------------------- /lovelace/cards/media_players/synx_box_controls.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - show_name: true 6 | show_icon: true 7 | type: button 8 | tap_action: 9 | action: toggle 10 | entity: switch.sync_box_power 11 | name: Sync Box 12 | - show_name: true 13 | show_icon: true 14 | type: button 15 | tap_action: 16 | action: toggle 17 | entity: switch.sync_box_light_sync 18 | name: Light Sync 19 | - show_name: true 20 | show_icon: true 21 | type: button 22 | tap_action: 23 | action: call-service 24 | service: select.select_option 25 | target: 26 | entity_id: select.sync_box_entertainment_area 27 | data: 28 | option: Stue TV Ambilight 29 | entity: select.sync_box_entertainment_area 30 | show_state: false 31 | name: "Gruppe: TV" 32 | icon: mdi:television 33 | - show_name: true 34 | show_icon: true 35 | type: button 36 | tap_action: 37 | action: call-service 38 | service: select.select_option 39 | target: 40 | entity_id: select.sync_box_entertainment_area 41 | data: 42 | option: Stue Gruppe 43 | entity: select.sync_box_entertainment_area 44 | show_state: false 45 | name: "Gruppe: Stue" 46 | icon: "" 47 | 48 | - type: conditional 49 | conditions: 50 | - entity: switch.sync_box_power 51 | state: "on" 52 | card: 53 | type: entities 54 | entities: 55 | - type: custom:slider-entity-row 56 | entity: number.sync_box_brightness 57 | name: Brightness 58 | show_icon: true 59 | full_row: true 60 | - entity: select.sync_box_hdmi_input 61 | - entity: select.sync_box_sync_mode 62 | - entity: select.sync_box_intensity 63 | -------------------------------------------------------------------------------- /python_scripts/input_select_set_options.py: -------------------------------------------------------------------------------- 1 | # Set online input_select option_list from entity state, attribute or string 2 | 3 | # Must be entity of the input_select like 'input_select.sonos_favs' 4 | entity_inputselect = data.get('entity_id')[0] 5 | 6 | # A entity or string to make a list from 7 | # entity attribute: media_player.buro.source_list 8 | # entity state: media_player.buro 9 | # String with a comma list: 'On,Off' 10 | # String only: 'Pause' 11 | entity_optionsstring = data.get('data_source') 12 | 13 | prepend_items = data.get('prepend_items') 14 | append_items = data.get('append_items') 15 | 16 | if entity_inputselect is None and entity_optionsstring is None: 17 | logger.warning('No data!') 18 | exit() 19 | 20 | current_selection = hass.states.get(entity_inputselect).state 21 | option_list = [] 22 | 23 | if '.' not in entity_optionsstring: 24 | option_list = entity_optionsstring.split(',') 25 | else: 26 | entityparts = entity_optionsstring.split('.') 27 | if len(entityparts) > 2: 28 | string_elements = hass.states.get(entityparts[0] + '.' + entityparts[1]).attributes[entityparts[2]] 29 | else: 30 | string_elements = hass.states.get(entityparts[0] + '.' + entityparts[1]).state 31 | 32 | if ',' in str(string_elements): 33 | for xe in string_elements: 34 | if xe: 35 | option_list.append(xe) 36 | else: 37 | option_list.extend(string_elements) 38 | 39 | if prepend_items: 40 | for item in prepend_items: 41 | option_list.insert(0, item) 42 | 43 | if append_items: 44 | for item in append_items: 45 | option_list.append(item) 46 | 47 | service_data = {'entity_id': entity_inputselect, 'options': option_list} 48 | hass.services.call('input_select', 'set_options', service_data) 49 | 50 | if current_selection in option_list: 51 | service_data = {'entity_id': entity_inputselect, 'option': current_selection} 52 | hass.services.call('input_select', 'select_option', service_data) 53 | 54 | -------------------------------------------------------------------------------- /lovelace/cards/compact_thermostats.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - type: custom:decluttering-card 6 | template: compact_thermostat 7 | variables: 8 | - entity: climate.stue 9 | - icon: mdi:sofa 10 | 11 | - type: custom:decluttering-card 12 | template: compact_thermostat 13 | variables: 14 | - entity: climate.kontor 15 | - icon: mdi:desktop-tower-monitor 16 | 17 | - type: horizontal-stack 18 | cards: 19 | - type: custom:decluttering-card 20 | template: compact_thermostat 21 | variables: 22 | - entity: climate.sovevaerelse 23 | - icon: mdi:bed 24 | 25 | - type: custom:decluttering-card 26 | template: compact_thermostat 27 | variables: 28 | - entity: climate.vaerksted 29 | - icon: mdi:hand-saw 30 | 31 | - type: horizontal-stack 32 | cards: 33 | - type: custom:decluttering-card 34 | template: compact_thermostat 35 | variables: 36 | - entity: climate.badevaerelse 37 | - icon: mdi:shower 38 | 39 | - type: custom:button-card 40 | name: Detaljer 41 | icon: mdi:vector-polyline 42 | layout: icon_state_name2nd 43 | show_state: false 44 | show_label: true 45 | label: " " 46 | styles: 47 | name: 48 | - font-size: 120% 49 | - margin-top: -17px 50 | - margin-bottom: -9px 51 | - padding-top: 9px 52 | card: 53 | - padding-top: 1px 54 | - padding-bottom: 1px 55 | tap_action: 56 | action: fire-dom-event 57 | browser_mod: 58 | service: browser_mod.popup 59 | data: 60 | title: Detaljer 61 | content: 62 | type: vertical-stack 63 | cards: 64 | - !include climate/temp_graph.yaml 65 | -------------------------------------------------------------------------------- /lovelace-living-room-remote.yaml: -------------------------------------------------------------------------------- 1 | decluttering_templates: !include_dir_named lovelace/decluttering_templates 2 | button_card_templates: !include lovelace/button_card_templates.yaml 3 | 4 | kiosk_mode: 5 | non_admin_settings: 6 | hide_notifications: true 7 | hide_account: true 8 | hide_overflow: true 9 | 10 | header_cards: 11 | justify_content: space-between 12 | replace_tabs: true 13 | cards: 14 | - type: markdown 15 | content: | 16 | {{ states('sensor.time') }} 17 | card_mod: 18 | style: | 19 | ha-card { 20 | background: rgba(0,0,0,0) !important; 21 | box-shadow: none !important; 22 | color: var(--app-header-text-color,#fff); 23 | font-size: 120%; 24 | font-weight: 500; 25 | } 26 | - type: custom:mushroom-entity-card 27 | entity: sensor.stue_fjernbetjening_battery_level 28 | primary_info: state 29 | secondary_info: none 30 | card_mod: 31 | style: 32 | .: | 33 | ha-card { 34 | background: rgba(0,0,0,0) !important; 35 | box-shadow: none !important; 36 | } 37 | mushroom-shape-icon { 38 | --icon-color:rgb(var( 39 | {%- set lvl = states('sensor.stue_fjernbetjening_battery_level') | int -%} 40 | {%- if lvl < 10 -%} 41 | --rgb-red 42 | {%- elif lvl < 20 -%} 43 | --rgb-orange 44 | {%- else -%} 45 | --rgb-green 46 | {%- endif -%} 47 | )) !important; 48 | --shape-color: var(--ha-card-background,var(--card-background-color,#fff)) !important; 49 | } 50 | "mushroom-state-info$": | 51 | .container .primary { 52 | color: var(--app-header-text-color,#fff); 53 | font-size: 120%; 54 | } 55 | 56 | views: 57 | - !include lovelace/views/living_room_remote.yaml 58 | -------------------------------------------------------------------------------- /lovelace/cards/3d_printer/print_time_graph.yaml: -------------------------------------------------------------------------------- 1 | type: custom:config-template-card 2 | entities: 3 | - sensor.3d_printer_graph_hours_to_show 4 | config_templates: default 5 | variables: 6 | graph_span: states['sensor.3d_printer_graph_hours_to_show'].state 7 | card: 8 | type: custom:apexcharts-card 9 | graph_span: "${graph_span}" 10 | header: 11 | show: false 12 | series: 13 | - entity: sensor.octoprint_print_time 14 | name: Elapsed 15 | type: line 16 | stroke_width: 2 17 | show: 18 | legend_value: true 19 | as_duration: second 20 | - entity: sensor.octoprint_print_time_left 21 | name: Remaining 22 | type: line 23 | stroke_width: 2 24 | show: 25 | legend_value: true 26 | as_duration: second 27 | - entity: sensor.octoprint_approximate_total_print_time 28 | name: Initial Est. 29 | type: line 30 | stroke_width: 2 31 | show: 32 | legend_value: true 33 | as_duration: second 34 | - entity: sensor.3d_printer_estimated_total_time 35 | name: OctoPrint Est. Total 36 | type: line 37 | stroke_width: 2 38 | show: 39 | legend_value: true 40 | as_duration: second 41 | apex_config: 42 | chart: 43 | height: 400 44 | yaxis: 45 | forceNiceScale: true 46 | min: 0 47 | tickAmount: 12 48 | labels: 49 | formatter: > 50 | EVAL:function (value) { 51 | const hours = Math.floor(value / 3600); 52 | const minutes = Math.floor((value % 3600) / 60); 53 | return hours + 'h ' + minutes + 'm'; 54 | } 55 | xaxis: 56 | type: datetime 57 | tickAmount: 12 58 | labels: 59 | datetimeFormatter: 60 | hour: "HH:mm" 61 | grid: 62 | show: true 63 | borderColor: "#e0e0e0" 64 | strokeDashArray: 4 65 | xaxis: 66 | lines: 67 | show: true 68 | yaxis: 69 | lines: 70 | show: true 71 | -------------------------------------------------------------------------------- /lovelace/cards/climate/indoor_sensors.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - type: custom:decluttering-card 6 | template: temp_graph_button 7 | variables: 8 | - temperature_entity: sensor.stue_temperatur 9 | - humidity_entity: sensor.stue_luftfugtighed 10 | - icon: mdi:sofa 11 | - color: "#EA4634" 12 | 13 | - type: custom:decluttering-card 14 | template: temp_graph_button 15 | variables: 16 | - temperature_entity: sensor.sovevaerelse_temperatur 17 | - humidity_entity: sensor.sovevaerelse_luftfugtighed 18 | - icon: mdi:bed 19 | - color: "#9C54B8" 20 | 21 | - type: horizontal-stack 22 | cards: 23 | - type: custom:decluttering-card 24 | template: temp_graph_button 25 | variables: 26 | - temperature_entity: sensor.kontor_temperatur 27 | - humidity_entity: sensor.kontor_luftfugtighed 28 | - icon: mdi:desktop-tower-monitor 29 | - color: "#FF7500" 30 | 31 | - type: custom:decluttering-card 32 | template: temp_graph_button 33 | variables: 34 | - temperature_entity: sensor.kokken_temperatur 35 | - humidity_entity: sensor.kokken_luftfugtighed 36 | - icon: mdi:food-fork-drink 37 | - color: "#F3C500" 38 | 39 | - type: horizontal-stack 40 | cards: 41 | - type: custom:decluttering-card 42 | template: temp_graph_button 43 | variables: 44 | - temperature_entity: sensor.badevaerelse_temperatur 45 | - humidity_entity: sensor.badevaerelse_luftfugtighed 46 | - icon: mdi:shower 47 | - color: "#2D7BDE" 48 | 49 | - type: custom:decluttering-card 50 | template: temp_graph_button 51 | variables: 52 | - temperature_entity: sensor.vaerksted_temperatur 53 | - humidity_entity: sensor.vaerksted_luftfugtighed 54 | - icon: mdi:hand-saw 55 | - color: "#FF00BD" 56 | -------------------------------------------------------------------------------- /lovelace/cards/climate/climate_sensors.yaml: -------------------------------------------------------------------------------- 1 | type: vertical-stack 2 | cards: 3 | - type: horizontal-stack 4 | cards: 5 | - type: custom:decluttering-card 6 | template: temp_graph_button 7 | variables: 8 | - temperature_entity: sensor.stue_temperatur 9 | - humidity_entity: sensor.stue_luftfugtighed 10 | - icon: mdi:sofa 11 | - color: "#EA4634" 12 | 13 | - type: custom:decluttering-card 14 | template: temp_graph_button 15 | variables: 16 | - temperature_entity: sensor.sovevaerelse_temperatur 17 | - humidity_entity: sensor.sovevaerelse_luftfugtighed 18 | - icon: mdi:bed 19 | - color: "#9C54B8" 20 | 21 | - type: horizontal-stack 22 | cards: 23 | - type: custom:decluttering-card 24 | template: temp_graph_button 25 | variables: 26 | - temperature_entity: sensor.kontor_temperatur 27 | - humidity_entity: sensor.kontor_luftfugtighed 28 | - icon: mdi:desktop-tower-monitor 29 | - color: "#FF7500" 30 | 31 | - type: custom:decluttering-card 32 | template: temp_graph_button 33 | variables: 34 | - temperature_entity: sensor.kokken_temperatur 35 | - humidity_entity: sensor.kokken_luftfugtighed 36 | - icon: mdi:food-fork-drink 37 | - color: "#F3C500" 38 | 39 | - type: horizontal-stack 40 | cards: 41 | - type: custom:decluttering-card 42 | template: temp_graph_button 43 | variables: 44 | - temperature_entity: sensor.badevaerelse_temperatur 45 | - humidity_entity: sensor.badevaerelse_luftfugtighed 46 | - icon: mdi:shower 47 | - color: "#2D7BDE" 48 | 49 | - type: custom:decluttering-card 50 | template: temp_graph_button 51 | variables: 52 | - temperature_entity: sensor.vaerksted_temperatur 53 | - humidity_entity: sensor.vaerksted_luftfugtighed 54 | - icon: mdi:hand-saw 55 | - color: "#32C9F6" 56 | -------------------------------------------------------------------------------- /packages/themes.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: Light Profile Frontend Theme Setter 3 | id: light_profile_frontend_theme_setter 4 | initial_state: True 5 | triggers: 6 | - trigger: homeassistant 7 | event: start 8 | - trigger: state 9 | entity_id: input_select.light_profile 10 | - trigger: template 11 | alias: Set current mode when a browser becomes available 12 | value_template: >- 13 | [ 14 | {%- for entity in states.binary_sensor | rejectattr('state', 'eq', 'unavailable') | selectattr('entity_id', 'match', '.+_browser_dark_mode') | list -%} 15 | "{{ entity.attributes.get('browserID') }}", 16 | {% endfor -%} 17 | ] 18 | variables: 19 | browser_id: >- 20 | {{ [trigger.to_state.attributes.browserID] if trigger.platform == 'template' and trigger.to_state.state != 'unavailable' else [] }} 21 | actions: 22 | - choose: 23 | - conditions: 24 | - condition: state 25 | entity_id: input_select.light_profile 26 | state: 27 | - "Bright" 28 | sequence: 29 | action: browser_mod.set_theme 30 | data: 31 | dark: light 32 | browser_id: "{{ browser_id }}" 33 | - conditions: 34 | - condition: state 35 | entity_id: input_select.light_profile 36 | state: 37 | - "Dimmed" 38 | - "Ambient" 39 | - "Night" 40 | - "Off" 41 | sequence: 42 | action: browser_mod.set_theme 43 | data: 44 | dark: dark 45 | browser_id: "{{ browser_id }}" 46 | default: 47 | action: browser_mod.set_theme 48 | data: 49 | dark: auto 50 | browser_id: "{{ browser_id }}" 51 | 52 | template: 53 | - binary_sensor: 54 | - name: Dark Mode 55 | state: "{{ states('input_select.light_profile') not in ['Bright', 'Default'] }}" 56 | -------------------------------------------------------------------------------- /custom_templates/gdq.jinja: -------------------------------------------------------------------------------- 1 | {% from 'utils.jinja' import regex_escape %} 2 | 3 | {% macro friendly_time(event, compact=False, fallback=False) %} 4 | {%- from 'datediff.jinja' import relative_start_end_time -%} 5 | {%- if not event %}{{ fallback or 'Ingen kommende' }} 6 | {%- else %} 7 | {%- if compact %} 8 | {{ relative_start_end_time(event.start, event.end, '', ' <> ', '', '', est='~') }} 9 | {%- else %} 10 | {{ relative_start_end_time(event.start, event.end, est='~') }} 11 | {%- endif %} 12 | {%- endif %} 13 | {% endmacro %} 14 | 15 | {% macro get_todo_list_items(entity, todo_items) %} 16 | {% set todo_items = todo_items.event.data.todo_items if 'event' in todo_items else todo_items %} 17 | {% set todo_items = todo_items.get(entity, {}).get('items', []) %} 18 | {{ todo_items | map(attribute='summary') | list | unique | list | to_json }} 19 | {% endmacro %} 20 | 21 | {% macro regex_from_list(terms=[]) %} 22 | {%- if not terms -%} 23 | xxxxxunknownxxxxx 24 | {%- else -%} 25 | {%- set ns = namespace(escaped=[]) -%} 26 | {%- for term in terms -%} 27 | {%- set ns.escaped = ns.escaped + [regex_escape(term)] -%} 28 | {%- endfor -%} 29 | {%- set uniq = ns.escaped | unique | list -%} 30 | {{ '.*(' ~ uniq | join('|') ~ ').*' }} 31 | {%- endif -%} 32 | {% endmacro %} 33 | 34 | {% macro games_from_list(field, terms=[], games_events=[]) %} 35 | {%- set regex = regex_from_list(terms) -%} 36 | {%- set matched_games = games_events 37 | | selectattr(field, 'match', regex) 38 | | map(attribute='summary') 39 | | list %} 40 | {%- if not matched_games -%} 41 | [] 42 | {%- else -%} 43 | {{ matched_games|to_json }} 44 | {%- endif -%} 45 | {% endmacro %} 46 | 47 | 48 | {% macro games_regex_from_list(field, terms=[], games_events=[]) %} 49 | {%- set games = games_from_list(field, terms, games_events)|from_json -%} 50 | {{ regex_from_list(games) if games else 'xxxxxunknownxxxxx' }} 51 | {% endmacro %} 52 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/room_state.yaml: -------------------------------------------------------------------------------- 1 | default: 2 | - orientation: horizontal 3 | card: 4 | type: vertical-stack 5 | cards: 6 | - type: "[[orientation]]-stack" 7 | cards: 8 | - type: "custom:button-card" 9 | size: 40px 10 | name: Aktivitet 11 | entity: sensor.[[room]]_activity_state 12 | show_name: false 13 | icon: mdi:circle 14 | tap_action: 15 | action: fire-dom-event 16 | browser_mod: 17 | service: browser_mod.popup 18 | data: 19 | title: Rum Aktivitet 20 | content: 21 | type: custom:decluttering-card 22 | template: room_activity 23 | variables: 24 | - room: "[[room]]" 25 | 26 | hold_action: 27 | action: more-info 28 | state: 29 | - value: "on" 30 | icon: mdi:circle 31 | color: var(--state-active-color) 32 | - value: "predicted" 33 | icon: mdi:circle-half 34 | color: var(--state-active-color) 35 | - value: "off" 36 | icon: mdi:circle-outline 37 | color: var(--state-inactive-color) 38 | 39 | - type: "custom:button-card" 40 | size: 40px 41 | name: Overstyring 42 | entity: light.[[room]]_activity_override 43 | show_name: false 44 | color: var(--state-active-color) 45 | tap_action: 46 | action: toggle 47 | 48 | - type: "custom:button-card" 49 | size: 40px 50 | name: Separat 51 | entity: light.[[room]]_separate_light_profile 52 | show_name: false 53 | color: var(--state-active-color) 54 | tap_action: 55 | action: toggle 56 | 57 | - type: "custom:button-card" 58 | size: 40px 59 | name: Auto 60 | color: var(--state-active-color) 61 | entity: input_boolean.auto_light_profile 62 | show_name: false 63 | 64 | - !include ../cards/lights/theme_button.yaml 65 | -------------------------------------------------------------------------------- /packages/automation/rooms/media/kitchen_media.yaml: -------------------------------------------------------------------------------- 1 | input_select: 2 | kokken_soundbar_volume_remote_state: 3 | initial: "off" 4 | options: 5 | - "off" 6 | - up 7 | - down 8 | 9 | automation: 10 | - alias: kokken_soundbar_volume_remote_up 11 | id: c6126fdc-bc40-4d2f-a904-24201aa18586 12 | initial_state: true 13 | triggers: 14 | - trigger: state 15 | entity_id: input_select.kokken_soundbar_volume_remote_state 16 | to: up 17 | for: 18 | milliseconds: 75 19 | mode: single 20 | actions: 21 | - repeat: 22 | sequence: 23 | - action: media_player.volume_up 24 | data: 25 | entity_id: media_player.kokken 26 | - delay: 27 | milliseconds: 75 28 | until: 29 | - condition: or 30 | conditions: 31 | - condition: state 32 | entity_id: input_select.kokken_soundbar_volume_remote_state 33 | state: "off" 34 | - condition: state 35 | entity_id: input_select.kokken_soundbar_volume_remote_state 36 | state: "down" 37 | 38 | - alias: kokken_soundbar_volume_remote_down 39 | id: b52dbb09-e7ef-45f2-a1eb-c6940a7c5f2c 40 | initial_state: true 41 | triggers: 42 | - trigger: state 43 | entity_id: input_select.kokken_soundbar_volume_remote_state 44 | to: down 45 | for: 46 | milliseconds: 75 47 | mode: single 48 | actions: 49 | - repeat: 50 | sequence: 51 | - action: media_player.volume_down 52 | data: 53 | entity_id: media_player.kokken 54 | - delay: 55 | milliseconds: 75 56 | until: 57 | - condition: or 58 | conditions: 59 | - condition: state 60 | entity_id: input_select.kokken_soundbar_volume_remote_state 61 | state: "off" 62 | - condition: state 63 | entity_id: input_select.kokken_soundbar_volume_remote_state 64 | state: "up" 65 | -------------------------------------------------------------------------------- /esphome/doorbell.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: doorbell 3 | upper_devicename: Dørklokke 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: d1_mini 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | 15 | # Enable logging 16 | logger: 17 | 18 | # Enable Home Assistant API 19 | api: 20 | encryption: 21 | key: !secret encryption_key 22 | 23 | ota: 24 | platform: esphome 25 | password: !secret ota_pass 26 | 27 | status_led: 28 | pin: 29 | number: GPIO2 30 | inverted: true 31 | 32 | globals: 33 | - id: do_not_disturb 34 | type: bool 35 | restore_value: true 36 | initial_value: 'false' 37 | 38 | binary_sensor: 39 | - platform: gpio 40 | pin: 41 | number: D2 42 | inverted: true 43 | mode: 44 | input: true 45 | pullup: true 46 | id: ${devicename}_button 47 | name: ${upper_devicename} Knap 48 | filters: 49 | - delayed_on: 50ms 50 | - delayed_off: 3000ms # prevents from re-ringing within 3 seconds 51 | on_press: 52 | then: 53 | if: 54 | condition: 55 | - switch.is_off: do_not_disturb_active 56 | then: 57 | - switch.turn_on: bell_relay 58 | - delay: 400ms 59 | - switch.turn_off: bell_relay 60 | - delay: 400ms 61 | - switch.turn_on: bell_relay 62 | - delay: 400ms 63 | - switch.turn_off: bell_relay 64 | - delay: 400ms 65 | - switch.turn_on: bell_relay 66 | - delay: 400ms 67 | - switch.turn_off: bell_relay 68 | 69 | switch: 70 | - platform: template 71 | id: do_not_disturb_active 72 | name: ${upper_devicename} Forstyr Ikke 73 | restore_mode: RESTORE_DEFAULT_OFF 74 | turn_on_action: 75 | - globals.set: 76 | id: do_not_disturb 77 | value: 'true' 78 | turn_off_action: 79 | - globals.set: 80 | id: do_not_disturb 81 | value: 'false' 82 | lambda: |- 83 | return id(do_not_disturb); 84 | 85 | - platform: gpio 86 | id: bell_relay 87 | name: ${upper_devicename} Klokke 88 | pin: D7 -------------------------------------------------------------------------------- /lovelace/decluttering_templates/light_groups.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: entities 3 | header: 4 | type: buttons 5 | entities: 6 | - entity: script.refresh_light_profile 7 | name: "Genindlæs " 8 | - entity: "light.[[rum]]_lys" 9 | show_name: true 10 | icon: mdi:lightbulb 11 | - entity: "input_boolean.fold_ud_[[rum]]_lys_panel" 12 | name: Fold ud 13 | icon: mdi:chevron-down 14 | entities: 15 | - type: conditional 16 | conditions: 17 | - entity: "input_boolean.fold_ud_[[rum]]_lys_panel" 18 | state: "on" 19 | - entity: "light.[[rum]]_lamper" 20 | state_not: "unavailable" 21 | row: 22 | type: custom:decluttering-card 23 | template: light_group 24 | variables: 25 | - group: "[[rum]]_lamper" 26 | - name: Lamper 27 | 28 | - type: conditional 29 | conditions: 30 | - entity: "input_boolean.fold_ud_[[rum]]_lys_panel" 31 | state: "on" 32 | - entity: "light.[[rum]]_hvidt_stemningslys" 33 | state_not: "unavailable" 34 | row: 35 | type: custom:decluttering-card 36 | template: light_group 37 | variables: 38 | - group: "[[rum]]_hvidt_stemningslys" 39 | - name: Hvidt 40 | 41 | - type: conditional 42 | conditions: 43 | - entity: "input_boolean.fold_ud_[[rum]]_lys_panel" 44 | state: "on" 45 | - entity: "light.[[rum]]_primaer_stemningslys" 46 | state_not: "unavailable" 47 | row: 48 | type: custom:decluttering-card 49 | template: light_group 50 | variables: 51 | - group: "[[rum]]_primaer_stemningslys" 52 | - name: Primær 53 | 54 | - type: conditional 55 | conditions: 56 | - entity: "input_boolean.fold_ud_[[rum]]_lys_panel" 57 | state: "on" 58 | - entity: "light.[[rum]]_sekundaer_stemningslys" 59 | state_not: "unavailable" 60 | row: 61 | type: custom:decluttering-card 62 | template: light_group 63 | variables: 64 | - group: "[[rum]]_sekundaer_stemningslys" 65 | - name: Sekundær 66 | -------------------------------------------------------------------------------- /lovelace/views/default/hallway.yaml: -------------------------------------------------------------------------------- 1 | title: Gang 2 | path: hallway 3 | icon: "mdi:door" 4 | type: custom:grid-layout 5 | layout: 6 | place-items: start stretch 7 | place-content: start stretch 8 | grid-template-columns: calc(33.3% - 40px) calc(33.3% - 40px) 33.3% 80px 9 | grid-template-rows: auto 10 | grid-template-areas: | 11 | "header header header header" 12 | "left middle right sidebar" 13 | mediaquery: 14 | "(max-width: 800px)": 15 | grid-template-columns: calc(100% - 60px) 60px 16 | grid-template-areas: | 17 | "header header" 18 | "left sidebar" 19 | "middle middle" 20 | "right right" 21 | "(max-width: 1200px)": 22 | grid-template-columns: calc(50% - 40px) calc(50% - 40px) 80px 23 | grid-template-areas: | 24 | "header header header" 25 | "left middle sidebar" 26 | "right right sidebar" 27 | cards: 28 | - type: vertical-stack 29 | view_layout: 30 | grid-area: left 31 | cards: 32 | - type: horizontal-stack 33 | cards: 34 | - type: custom:decluttering-card 35 | template: currently_playing 36 | variables: 37 | - room: stue 38 | - !include ../../cards/compact_clock.yaml 39 | 40 | - type: custom:decluttering-card 41 | template: speaker_control_v2 42 | variables: 43 | - room: roam 44 | 45 | - type: custom:decluttering-card 46 | template: light_groups 47 | variables: 48 | - rum: gang 49 | 50 | - type: vertical-stack 51 | view_layout: 52 | grid-area: sidebar 53 | cards: 54 | - type: custom:decluttering-card 55 | template: room_light_profile 56 | variables: 57 | - orientation: vertical 58 | - room: hallway 59 | 60 | - type: custom:decluttering-card 61 | template: vertical_thermostat 62 | variables: 63 | - rum: gang 64 | 65 | - type: custom:button-card 66 | entity: light.hallway_tablet 67 | show_name: false 68 | icon: mdi:tablet-dashboard 69 | size: 40px 70 | 71 | - !include ../../cards/dorklokke.yaml 72 | 73 | - !include ../../cards/hoveddor_laas.yaml 74 | -------------------------------------------------------------------------------- /packages/automation/guest_mode.yaml: -------------------------------------------------------------------------------- 1 | input_boolean: 2 | guests: 3 | name: Gæster 4 | icon: mdi:account-multiple 5 | 6 | automation: 7 | - alias: Guests Event 8 | id: d1738a9b-6825-4159-8dcc-dabb41464335 9 | initial_state: true 10 | triggers: 11 | - trigger: state 12 | entity_id: binary_sensor.guests_event 13 | to: 14 | - "on" 15 | - "off" 16 | actions: 17 | - action: "input_boolean.turn_{{ trigger.to_state.state }}" 18 | target: 19 | entity_id: input_boolean.guests 20 | 21 | - alias: Guests Mode On 22 | id: 934d6298-ba45-4126-bd6c-65f85c928192 23 | initial_state: true 24 | triggers: 25 | - trigger: state 26 | entity_id: input_boolean.guests 27 | to: "on" 28 | actions: 29 | - parallel: 30 | - action: homeassistant.turn_on 31 | target: 32 | entity_id: 33 | - input_boolean.bathroom_separate_light_profile 34 | - input_boolean.bathroom_activity_override 35 | - input_boolean.bedroom_separate_light_profile 36 | - input_boolean.office_separate_light_profile 37 | - input_boolean.workshop_separate_light_profile 38 | - action: homeassistant.turn_off 39 | target: 40 | entity_id: 41 | - switch.living_room_curtain_automations 42 | 43 | - alias: Guests Mode Off 44 | id: 31e7c655-2b98-440d-9f0e-22121ebf901f 45 | initial_state: true 46 | triggers: 47 | - trigger: state 48 | entity_id: input_boolean.guests 49 | to: "off" 50 | actions: 51 | - parallel: 52 | - action: homeassistant.turn_off 53 | target: 54 | entity_id: 55 | - input_boolean.bathroom_separate_light_profile 56 | - input_boolean.bathroom_activity_override 57 | - input_boolean.bedroom_separate_light_profile 58 | - input_boolean.office_separate_light_profile 59 | - input_boolean.workshop_separate_light_profile 60 | - action: homeassistant.turn_on 61 | target: 62 | entity_id: 63 | - switch.living_room_curtain_automations 64 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/room_climate_with_thermostat.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: horizontal-stack 3 | cards: 4 | - type: custom:mini-graph-card 5 | name: "Temperatur" 6 | icon: mdi:thermometer 7 | points_per_hour: 12 8 | hours_to_show: 6 9 | hour24: true 10 | line_width: 8 11 | font_size: 75 12 | upper_bound_secondary: 1 13 | lower_bound_secondary: 0.3 14 | height: 250 15 | show: 16 | name: false 17 | icon: false 18 | labels: true 19 | entities: 20 | - entity: sensor.[[rum]]_temperatur 21 | show_indicator: false 22 | show_legend: false 23 | color: DarkOrange 24 | - entity: sensor.[[rum]]_temperaturindstilling 25 | show_indicator: false 26 | show_legend: false 27 | show_fill: false 28 | color: LightGray 29 | - entity: input_number.target_temperature 30 | show_indicator: false 31 | show_legend: false 32 | show_fill: false 33 | color: "#666666bb" 34 | - entity: sensor.[[rum]]_termostat_varmer 35 | color: "#FF6565" 36 | name: Termostat Varmer 37 | show_line: false 38 | show_points: false 39 | show_legend: false 40 | smoothing: false 41 | y_axis: secondary 42 | 43 | - type: custom:mini-graph-card 44 | name: "Luftfugtighed" 45 | icon: mdi:water-percent 46 | points_per_hour: 12 47 | hours_to_show: 6 48 | hour24: true 49 | line_width: 8 50 | font_size: 75 51 | height: 250 52 | show: 53 | name: false 54 | icon: false 55 | labels: true 56 | entities: 57 | - entity: sensor.[[rum]]_luftfugtighed 58 | show_indicator: false 59 | show_legend: false 60 | color: DodgerBlue 61 | 62 | - type: custom:mini-graph-card 63 | name: "Lys" 64 | points_per_hour: 12 65 | hours_to_show: 6 66 | hour24: true 67 | line_color: "#e74c3c" 68 | line_width: 8 69 | font_size: 75 70 | height: 250 71 | show: 72 | name: false 73 | icon: false 74 | labels: true 75 | entities: 76 | - sensor.[[rum]]_lysstyrke 77 | -------------------------------------------------------------------------------- /custom_templates/light_profile.jinja: -------------------------------------------------------------------------------- 1 | {%- macro room_selected_light_profile(room) -%} 2 | {%- if is_state('input_boolean.'+room+'_separate_light_profile', 'off') -%} 3 | {{ states('input_select.light_profile') }} 4 | {%- else -%} 5 | {{ states('input_select.'+room+'_light_profile') }} 6 | {%- endif -%} 7 | {%- endmacro -%} 8 | 9 | {%- macro room_auto_light_profile(room, lux_sensor='', override_profile=none, low_lux=1000, mid_lux=2000, high_lux=5000) -%} 10 | {%- set outside_lux = states(lux_sensor)|int(0) -%} 11 | {%- set profile = states('sensor.'+room+'_selected_light_profile') -%} 12 | {%- set profiles = state_attr('input_select.light_profile', 'options') -%} 13 | {%- if profile == 'Bright' -%} 14 | Bright 15 | {%- elif override_profile != none -%} 16 | {{ profile if override_profile == '[[profile]]' else override_profile }} 17 | {%- elif outside_lux > high_lux -%} 18 | Off 19 | {%- elif outside_lux > mid_lux -%} 20 | {{ profiles[profiles.index(profile)+2] or 'Off' }} 21 | {%- elif outside_lux > low_lux -%} 22 | {{ profiles[profiles.index(profile)+1] or 'Off' }} 23 | {%- else -%} 24 | {{ profile }} 25 | {%- endif -%} 26 | {%- endmacro -%} 27 | 28 | {%- macro room_light_profile(room) -%} 29 | {%- if is_state('input_boolean.auto_light_profile', 'off') -%} 30 | {{ states('sensor.'+room+'_selected_light_profile') }} 31 | {%- else -%} 32 | {{ states('sensor.'+room+'_auto_light_profile') }} 33 | {%- endif -%} 34 | {%- endmacro -%} 35 | 36 | {%- macro room_inactive_light_profile(room) -%} 37 | {%- set profile = states('sensor.'+room+'_light_profile') -%} 38 | {%- set profiles = state_attr('input_select.light_profile', 'options') -%} 39 | {%- set index = profiles.index(profile)+1 -%} 40 | {{ profiles[index] if index < (profiles|length) else 'Off' }} 41 | {%- endmacro -%} 42 | 43 | {%- macro room_active_light_profile(room) -%} 44 | {%- if is_state('sensor.'+room+'_room_state', 'active') -%} 45 | {{ states('sensor.'+room+'_light_profile') }} 46 | {%- elif is_state('sensor.'+room+'_room_state', 'inactive') -%} 47 | {{ states('sensor.'+room+'_inactive_light_profile') }} 48 | {%- else %} 49 | Off 50 | {%- endif -%} 51 | {%- endmacro -%} 52 | -------------------------------------------------------------------------------- /esphome/party_button.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | devicename: party_button 3 | upper_devicename: Party Button 4 | 5 | esphome: 6 | name: $devicename 7 | 8 | esp8266: 9 | board: esp12e 10 | 11 | wifi: 12 | ssid: !secret wifi_ssid 13 | password: !secret wifi_pass 14 | fast_connect: true 15 | manual_ip: 16 | static_ip: 192.168.42.218 17 | gateway: 192.168.42.1 18 | subnet: 255.255.255.0 19 | dns1: 192.168.30.3 20 | 21 | # Enable logging 22 | logger: 23 | 24 | # Enable Home Assistant API 25 | api: 26 | encryption: 27 | key: !secret encryption_key 28 | 29 | ota: 30 | platform: esphome 31 | password: !secret ota_pass 32 | 33 | status_led: 34 | pin: 35 | number: GPIO14 36 | inverted: true 37 | 38 | sensor: 39 | - platform: adc 40 | pin: VCC 41 | name: "Party Button Battery" 42 | 43 | - platform: homeassistant 44 | id: party_mode 45 | entity_id: sensor.party_mode 46 | name: "Party Button Party Mode" 47 | internal: true 48 | on_value_range: 49 | - above: 0.9 50 | below: 1.1 51 | then: 52 | - light.turn_on: 53 | id: button_led 54 | effect: "Alert" 55 | - below: 0.1 56 | above: -0.9 57 | then: 58 | - light.turn_on: 59 | id: button_led 60 | brightness: 100% 61 | effect: "None" 62 | 63 | binary_sensor: 64 | - platform: gpio 65 | pin: GPIO5 66 | id: button_sw 67 | name: "Party Button Switch" 68 | device_class: power 69 | filters: 70 | - delayed_on: 10ms 71 | 72 | output: 73 | - platform: esp8266_pwm 74 | pin: GPIO12 75 | id: button_pwm 76 | 77 | light: 78 | - platform: monochromatic 79 | id: button_led 80 | name: "Party Button LED" 81 | output: button_pwm 82 | restore_mode: ALWAYS_OFF 83 | internal: true 84 | effects: 85 | - automation: 86 | name: Alert 87 | sequence: 88 | - light.turn_on: 89 | id: button_led 90 | brightness: 100% 91 | transition_length: 1500ms 92 | - delay: 1500ms 93 | - light.turn_on: 94 | id: button_led 95 | brightness: 16% 96 | transition_length: 1500ms 97 | - delay: 1500ms 98 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/simple_thermostat.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: custom:stack-in-card 3 | mode: horizontal 4 | cards: 5 | - type: "custom:button-card" 6 | entity: "[[entity]]" 7 | icon: "[[icon]]" 8 | triggers_update: 9 | - "[[entity]]" 10 | name: "[[[return states['[[entity]]'].attributes['temperature'] + '°']]]" 11 | label: "[[[return states['[[entity]]'].attributes['current_temperature'] + '°']]]" 12 | show_state: false 13 | show_label: true 14 | color: var(--climate-state) 15 | tap_action: 16 | action: toggle 17 | hold_action: 18 | action: more-info 19 | styles: 20 | card: 21 | - height: 100px 22 | - background-color: transparent 23 | - border-radius: 10px 0 0 10px 24 | name: 25 | - font-size: 120% 26 | label: 27 | - font-size: 80% 28 | card_mod: 29 | style: | 30 | ha-icon { 31 | --climate-state: {% if state_attr('[[entity]]', 'hvac_action') == 'heating' %} var(--state-active-color) {% endif %}; 32 | } 33 | 34 | - type: vertical-stack 35 | cards: 36 | - type: "custom:button-card" 37 | icon: mdi:arrow-up 38 | styles: 39 | card: 40 | - height: 50px 41 | - background-color: transparent 42 | - border-radius: 0 10px 0 0 43 | show_name: false 44 | show_state: false 45 | tap_action: 46 | action: call-service 47 | service: script.turn_on 48 | service_data: 49 | entity_id: script.increase_temperature 50 | variables: 51 | entity: "[[entity]]" 52 | 53 | - type: "custom:button-card" 54 | icon: mdi:arrow-down 55 | styles: 56 | card: 57 | - height: 50px 58 | - background-color: transparent 59 | - border-radius: 0 0 10px 0 60 | show_name: false 61 | show_state: false 62 | tap_action: 63 | action: call-service 64 | service: script.turn_on 65 | service_data: 66 | entity_id: script.decrease_temperature 67 | variables: 68 | entity: "[[entity]]" 69 | -------------------------------------------------------------------------------- /packages/automation/phone_call.yaml: -------------------------------------------------------------------------------- 1 | input_text: 2 | active_media_player: 3 | active_media_type: 4 | 5 | automation: 6 | - alias: Pause Media On Phone Call 7 | id: pause_media_on_phone_call 8 | initial_state: true 9 | triggers: 10 | - trigger: state 11 | entity_id: 12 | - sensor.arbejdstelefon_phone_state 13 | - sensor.darkphone_phone_state 14 | to: 15 | - ringing 16 | - offhook 17 | from: idle 18 | conditions: 19 | - condition: state 20 | entity_id: binary_sensor.rook_presence 21 | state: "on" 22 | - condition: template 23 | value_template: >- 24 | {{ 25 | trigger.to_state.entity_id == 'sensor.darkphone_phone_state' 26 | or is_state('binary_sensor.working', 'on') 27 | }} 28 | actions: 29 | - action: script.turn_on 30 | entity_id: script.pause_all_media 31 | 32 | - alias: Unpause On Phone Call Finished 33 | id: unpause_media_on_phone_call_finished 34 | initial_state: true 35 | triggers: 36 | - trigger: state 37 | entity_id: 38 | - sensor.arbejdstelefon_phone_state 39 | - sensor.darkphone_phone_state 40 | to: idle 41 | conditions: 42 | - condition: state 43 | entity_id: binary_sensor.rook_presence 44 | state: "on" 45 | actions: 46 | - action: script.turn_on 47 | entity_id: script.resume_all_media 48 | 49 | script: 50 | resume_all_media: 51 | alias: "Genoptag afspilning" 52 | sequence: 53 | - choose: 54 | - conditions: 55 | - condition: state 56 | entity_id: input_text.active_media_type 57 | state: "file" 58 | sequence: 59 | - action: "media_player.media_play" 60 | data: 61 | entity_id: "{{ states('input_text.active_media_player') }}" 62 | - conditions: 63 | - condition: state 64 | entity_id: input_text.active_media_type 65 | state: "stream" 66 | sequence: 67 | - action: "media_player.volume_mute" 68 | data: 69 | entity_id: "{{ states('input_text.active_media_player') }}" 70 | is_volume_muted: false 71 | -------------------------------------------------------------------------------- /lovelace/decluttering_templates/vertical_thermostat.yaml: -------------------------------------------------------------------------------- 1 | card: 2 | type: custom:stack-in-card 3 | mode: vertical 4 | cards: 5 | - type: custom:button-card 6 | icon: mdi:arrow-up 7 | tap_action: 8 | action: perform-action 9 | perform_action: input_number.increment 10 | target: 11 | entity_id: input_number.target_temperature 12 | 13 | - type: custom:button-card 14 | entity: climate.[[rum]] 15 | state_display: > 16 | [[[ 17 | if (!Object.keys(states).includes('sensor.[[rum]]_temperatur') && !Object.keys(states).includes('climate.[[rum]]')) 18 | return Math.round(states['input_number.target_temperature'].state) + '°'; 19 | let output = ''; 20 | if (Object.keys(states).includes('sensor.[[rum]]_temperatur')) 21 | output += Math.round(states['sensor.[[rum]]_temperatur'].state) + '/'; 22 | if (Object.keys(states).includes('climate.[[rum]]')) 23 | output += Math.round(states['climate.[[rum]]'].attributes['temperature']); 24 | else 25 | output += Math.round(states['input_number.target_temperature'].state); 26 | return output + '°'; 27 | ]]] 28 | label: > 29 | [[[ 30 | if (!Object.keys(states).includes('sensor.[[rum]]_temperatur') && !Object.keys(states).includes('climate.[[rum]]')) 31 | return ''; 32 | return '(' + Math.round(states['input_number.target_temperature'].state) + '°)'; 33 | ]]] 34 | show_state: true 35 | show_name: false 36 | show_icon: false 37 | show_label: true 38 | hold_action: 39 | action: more-info 40 | tap_action: 41 | action: fire-dom-event 42 | browser_mod: 43 | service: browser_mod.popup 44 | data: 45 | title: Detaljer 46 | content: 47 | type: vertical-stack 48 | cards: 49 | - !include ../cards/climate/temp_graph.yaml 50 | 51 | styles: 52 | label: 53 | - color: var(--secondary-text-color) 54 | 55 | - type: custom:button-card 56 | icon: mdi:arrow-down 57 | tap_action: 58 | action: perform-action 59 | perform_action: input_number.decrement 60 | target: 61 | entity_id: input_number.target_temperature 62 | -------------------------------------------------------------------------------- /packages/integrations/bluetooth.yaml: -------------------------------------------------------------------------------- 1 | homeassistant: 2 | customize: 3 | defaults.bt_battery: &sensor_battery 4 | device_class: battery 5 | state_class: measurement 6 | unit_of_measurement: "%" 7 | state: "{{ trigger.event['data']['android.bluetooth.device.extra.BATTERY_LEVEL'] }}" 8 | 9 | template: 10 | - triggers: 11 | - trigger: "event" 12 | event_type: "android.intent_received" 13 | event_data: 14 | android.bluetooth.device.extra.DEVICE: "XX:XX:XX:XX:54:F6" 15 | intent: "android.bluetooth.device.action.BATTERY_LEVEL_CHANGED" 16 | conditions: &cond_battery_lvl 17 | - condition: "template" 18 | value_template: >- 19 | {{ trigger.event['data']['android.bluetooth.device.extra.BATTERY_LEVEL'] != '-1' }} 20 | sensor: 21 | - name: "Darkphones Battery Level" 22 | unique_id: ca26e13e-8c56-4f7b-bdf3-c794ca6045bd 23 | <<: *sensor_battery 24 | 25 | - triggers: 26 | - trigger: "event" 27 | event_type: "android.intent_received" 28 | event_data: 29 | android.bluetooth.device.extra.DEVICE: "XX:XX:XX:XX:CE:EB" 30 | intent: "android.bluetooth.device.action.BATTERY_LEVEL_CHANGED" 31 | conditions: *cond_battery_lvl 32 | sensor: 33 | - name: "MusiCozy Battery Level" 34 | unique_id: 4de18750-a4a9-447a-90ef-b34af246516a 35 | <<: *sensor_battery 36 | 37 | - triggers: 38 | - trigger: "event" 39 | event_type: "android.intent_received" 40 | event_data: 41 | android.bluetooth.device.extra.DEVICE: "XX:XX:XX:XX:26:2E" 42 | intent: "android.bluetooth.device.action.BATTERY_LEVEL_CHANGED" 43 | conditions: *cond_battery_lvl 44 | sensor: 45 | - name: "DarkBuds Battery Level" 46 | unique_id: 2a6d1d46-430d-43de-a930-56118fb7e856 47 | <<: *sensor_battery 48 | 49 | - triggers: 50 | - trigger: "event" 51 | event_type: "android.intent_received" 52 | event_data: 53 | android.bluetooth.device.extra.DEVICE: "XX:XX:XX:XX:0E:83" 54 | intent: "android.bluetooth.device.action.BATTERY_LEVEL_CHANGED" 55 | conditions: *cond_battery_lvl 56 | sensor: 57 | - name: "DarkSound Battery Level" 58 | unique_id: 7799cae4-0e55-4086-94ac-6e88c3f48e03 59 | <<: *sensor_battery 60 | -------------------------------------------------------------------------------- /packages/automation/microwave.yaml: -------------------------------------------------------------------------------- 1 | template: 2 | - binary_sensor: 3 | - default_entity_id: binary_sensor.microwave_running 4 | name: Mikroovn 5 | unique_id: 019b040f-9da2-7156-8315-e563ee0a9626 6 | state: "{{ states('sensor.mikroovn_forbrug')|float(0.0) > 0.03 }}" 7 | 8 | automation: 9 | - alias: Mikroovn startet 10 | id: 6ff8d64d-b0ff-450b-8b51-5c2da4c546e1 11 | initial_state: true 12 | triggers: 13 | - trigger: state 14 | entity_id: binary_sensor.microwave_running 15 | to: "on" 16 | actions: 17 | - action: automation.turn_off 18 | data: 19 | entity_id: automation.sluk_mikroovn_hvis_ikke_startet_efter_dor_lukket 20 | stop_actions: false 21 | 22 | - alias: Mikroovn Færdig 23 | id: de4b6b42-b9aa-4f47-aa7a-8a51180ed774 24 | initial_state: true 25 | triggers: 26 | trigger: state 27 | entity_id: binary_sensor.microwave_running 28 | from: "on" 29 | to: "off" 30 | actions: 31 | - action: script.notify_everywhere 32 | data: 33 | message: Mikroovnen er færdig. 34 | 35 | - alias: Tænd mikroovn når dør åbnes 36 | id: 0cd271e7-3331-40b8-a772-d70e3f984bfb 37 | initial_state: true 38 | triggers: 39 | - trigger: state 40 | entity_id: binary_sensor.mikroovn_dor_abner 41 | to: "on" 42 | actions: 43 | - action: switch.turn_on 44 | data: 45 | entity_id: switch.mikroovn 46 | - action: automation.turn_on 47 | data: 48 | entity_id: automation.sluk_mikroovn_hvis_ikke_startet_efter_dor_lukket 49 | 50 | - alias: Sluk mikroovn hvis ikke startet efter dør lukket 51 | id: f10c2677-b5cc-425e-9556-6fd4a2fd632d 52 | initial_state: false 53 | triggers: 54 | - trigger: state 55 | entity_id: binary_sensor.mikroovn_dor_abner 56 | to: "off" 57 | for: 58 | minutes: 1 59 | conditions: 60 | - condition: state 61 | entity_id: binary_sensor.microwave_running 62 | state: "off" 63 | actions: 64 | - action: switch.turn_off 65 | data: 66 | entity_id: switch.mikroovn 67 | - action: automation.turn_off 68 | data: 69 | entity_id: automation.sluk_mikroovn_hvis_ikke_startet_efter_dor_lukket 70 | stop_actions: false 71 | --------------------------------------------------------------------------------