commit cd860031fbd379b462e1ac001bf0d9ec05ac3997 Author: Florian Brinker Date: Wed Jan 16 13:47:15 2019 +0100 Add config diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb23999 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +# Disallow all +/* + +# Allow +!*.yaml +!*.jpg +!*.png +!.gitignore +!*.md +!/automations/ +!/lovelace-views/ +!/sensors/ +!/www/ + +# "Force" Disallow +.storage/ +android/ + +ip_bans.yaml +secrets.yaml +known_devices.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..acf6cf1 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# Home Assistant Config +My configuration for Home Assistant + +## Hardware +* [Raspberry Pi 3 B+](https://amzn.to/2Hgynln) + +For my used hardware devices see the section [Devices](#devices). + +## Software +I use the following software, running in docker containers, on my Raspberry Pi: + +* [Home Assistant](https://www.home-assistant.io/) +* [Caddy](https://caddyserver.com/) - as SSL proxy +* [Mosquitto](https://mosquitto.org/) - as MQTT broker +* The ["TICK-Stack"](https://www.influxdata.com/) + * Telegraf - to grab different data @home + * Influxdb - to persist the data + * Chronograf - for detailed fancy dashboards and logs + * Kapacitor - for hardware alarms and some sensor alarms + +## Used External Services +* Alexa (via Alexa Home Skill and AWS Lambda function) +* Google/Youtube API +* Instagram API +* Openweathermap +* Spotify +* Telegram + +## Devices +* [Amazon Echo Dot](https://amzn.to/2RvLxzE), 5x +* ESP32 + DHT22 - selfmade Hygrometers, 2x +* [Harmony Hub Elite](https://amzn.to/2RM29SY) +* Milight light bulbs, 7x +* Milight wifi bridge +* Xiaomi Mija Hygrometer +* [Xiaomi Smart Scale](https://amzn.to/2QPsv1H) +* [Yi Home Camera 1080p](https://amzn.to/2SYhoW6) - with [custom firmware and mqtt add-on](https://github.com/fbrinker/yi-hack-mqtt) +* ... + +Work in progress. Not all of them are integrated yet. \ No newline at end of file diff --git a/alexa.yaml b/alexa.yaml new file mode 100644 index 0000000..56bcd84 --- /dev/null +++ b/alexa.yaml @@ -0,0 +1,38 @@ +# Display Categories: https://developer.amazon.com/de/docs/device-apis/alexa-discovery.html#display-categories + smart_home: + endpoint: https://api.amazonalexa.com/v3/events + client_id: !secret alexa_client_id + client_secret: !secret alexa_client_secret + filter: + include_entities: + - light.ambilight + - switch.livingroom_music + - switch.livingroom_netflix + - switch.harmony_firetv + - switch.harmony_steamlink + - switch.harmony_playstation +# include_domains: +# - switch +# exclude_entities: +# - switch.outside + entity_config: +# switch.stairs: +# display_categories: LIGHT + light.ambilight: + name: Ambilight + description: Wohnzimmer - TV Ambilight + switch.livingroom_music: + name: Musik + description: Wohnzimmer - Musik + switch.livingroom_netflix: + name: Netflix + description: Wohnzimmer - Netflix + switch.harmony_firetv: + name: Fernseher + description: Harmony - FireTV + switch.harmony_steamlink: + name: Konsole + description: Harmony - SteamLink + switch.harmony_playstation: + name: Playstation + description: Harmony - Playstation \ No newline at end of file diff --git a/automations/alarm.yaml b/automations/alarm.yaml new file mode 100644 index 0000000..356124f --- /dev/null +++ b/automations/alarm.yaml @@ -0,0 +1,19 @@ +- id: bedroom_alarm_clock + alias: bedroom alarm clock + trigger: + platform: template + value_template: "{{ states('sensor.time') == (states.input_datetime.bedroom_alarm_clock_time.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}" + condition: + condition: and + conditions: + - condition: state + entity_id: binary_sensor.workday_sensor + state: 'on' + - condition: sun + before: sunrise + action: + - service: notify.telegram_group + data: + title: 'Guten Morgen!' + message: 'Langsam dürft ihr wach werden. Es wird bald Zeit aufzustehen... :)' + diff --git a/automations/hassio.yaml b/automations/hassio.yaml new file mode 100644 index 0000000..96c726e --- /dev/null +++ b/automations/hassio.yaml @@ -0,0 +1,9 @@ +- alias: Update notifications + trigger: + - platform: state + entity_id: updater.updater + action: + service: notify.telegram_group + data_template: + title: 'Neuer Home Assistant Release' + message: "Home Assistant {{ states.updater.updater.state }} ist nun verfügbar." diff --git a/automations/humidity.yaml b/automations/humidity.yaml new file mode 100644 index 0000000..8bebffb --- /dev/null +++ b/automations/humidity.yaml @@ -0,0 +1,13 @@ +- alias: Dachboden Luftfeuchtigkeit + trigger: + platform: numeric_state + entity_id: sensor.attic_humidity + below: 35 + above: 65 + for: + minutes: 3 + action: + service: notify.telegram_group + data: + title: 'Bitte den Dachboden lüften!' + message: 'Die Luftfeuchtigkeit liegt mit {{ states.sensor.livingroom_humidity.state }}% außerhalb des Grenzbereichs.' diff --git a/automations/livingroom.yaml b/automations/livingroom.yaml new file mode 100644 index 0000000..c41dc48 --- /dev/null +++ b/automations/livingroom.yaml @@ -0,0 +1,30 @@ +- alias: Ambilight an (HDMI) + trigger: + platform: state + entity_id: switch.harmony_firetv, switch.harmony_steamlink, switch.harmony_playstation + to: 'on' + action: + service: light.turn_on + data: + entity_id: light.ambilight + effect: HDMI + +- alias: Ambilight an + trigger: + platform: state + entity_id: switch.harmony_music_bt + to: 'on' + action: + service: light.turn_on + data: + entity_id: light.ambilight + +- alias: Ambilight aus + trigger: + platform: state + entity_id: switch.harmony_music_bt, switch.harmony_firetv, switch.harmony_steamlink, switch.harmony_playstation + to: 'off' + action: + service: light.turn_off + data: + entity_id: light.ambilight \ No newline at end of file diff --git a/configuration.yaml b/configuration.yaml new file mode 100644 index 0000000..189a14d --- /dev/null +++ b/configuration.yaml @@ -0,0 +1,178 @@ +homeassistant: + name: Home + latitude: !secret home_lat + longitude: !secret home_long + elevation: !secret home_elevation + unit_system: metric + time_zone: Europe/Berlin +# customize: !include_dir_merge_named customizations/ + +http: + ip_ban_enabled: true + login_attempts_threshold: 5 + use_x_forwarded_for: true + trusted_proxies: + - 127.0.0.1 + - ::1 + trusted_networks: + - 192.168.0.0/16 + - fd00::/8 + +lovelace: + mode: yaml + +zone: + - name: !secret work1_name + latitude: !secret work1_lat + longitude: !secret work1_long + radius: 250 + icon: mdi:briefcase + +config: + +updater: + +#discovery: + +history: + +logbook: + +recorder: + +influxdb: + host: !secret influxdb + database: home_assistant + max_retries: 3 + include: + entities: + - device_tracker.mobile_fb + - sensor.attic_heatIndex + - sensor.attic_humidity + - sensor.attic_temperature +# - sensor.bathroom_hygrometer_battery +# - sensor.bathroom_hygrometer_humidity +# - sensor.bathroom_hygrometer_temperature +# - sensor.livingroom_heatindex +# - sensor.livingroom_humidity +# - sensor.livingroom_temperature + # Youtube + - sensor.youtube_beauty + - sensor.youtube_beauty_videos + - sensor.youtube_beauty_views + - sensor.youtube_mtb + - sensor.youtube_mtb_videos + - sensor.youtube_mtb_views + # Instagram + - sensor.instagram_beauty + - sensor.instagram_beauty_follows + - sensor.instagram_beauty_media + - sensor.instagram_fb + - sensor.instagram_fb_follows + - sensor.instagram_fb_media + - sensor.instagram_franky + - sensor.instagram_franky_follows + - sensor.instagram_franky_media + - sensor.instagram_mtb + - sensor.instagram_mtb_follows + - sensor.instagram_mtb_media + +map: + +mqtt: + broker: !secret mqtt_broker_ip + username: !secret mqtt_username + password: !secret mqtt_password + +telegram_bot: + - platform: broadcast + api_key: !secret telegram_bot + allowed_chat_ids: + - !secret telegram_chat_fb + - !secret telegram_chat_group + +notify: + - name: telegram_group + platform: telegram + chat_id: !secret telegram_chat_group + +device_tracker: + +media_player: + - platform: spotify + client_id: !secret spotify_client_id + client_secret: !secret spotify_client_secret + - platform: firetv + name: Fire TV + host: !secret firetv_ip + adbkey: !secret adbkey + get_source: true + get_sources: true + +remote: + - platform: harmony + name: Livingroom Harmony + host: !secret harmonyhub_ip + +sun: + +light: + - platform: hyperion + name: Ambilight + host: !secret ambilight_ip + +binary_sensor: + - platform: workday + country: DE + province: NW + workdays: [ mon, tue, wed, thu, fri ] + - platform: mqtt + state_topic: /home/camera/yihome1/motion/state + name: YiHome1 Alarm + payload_on: 1 + payload_off: 0 + +weather: + - platform: openweathermap + friendly_name: Vorhersage + api_key: !secret openweathermap + +#octoprint: +# host: !secret octoprint_ip +# api_key: !secret octoprint_api_key +# bed: true +# number_of_tools: 1 + +ffmpeg: + ffmpeg_bin: /usr/bin/ffmpeg + +camera: + - platform: yi + name: YiHome1 + host: !secret yihome1 + password: !secret yihome1_password + ffmpeg_arguments: '-pred 1 -vf scale=800:450' + - platform: mqtt + name: YiHome1-Mqtt + topic: /home/camera/yihome1/motion/photo + # - platform: mjpeg + # name: octoprint_webcam + # mjpeg_url: !secret octoprint_cam_url + # - platform: local_file + #name: elisey_shocked + #friendly_name: Schlechtes Wetter + #file_path: /local/elisey_shocked.png + +input_datetime: + bedroom_alarm_clock_time: + name: Wecker + has_date: false + has_time: true + +#alert: !include alerts.yaml +alexa: !include alexa.yaml +automation: !include_dir_merge_list automations/ +#scene: !include scenes.yaml +script: !include scripts.yaml +sensor: !include_dir_merge_list sensors/ +switch: !include switches.yaml \ No newline at end of file diff --git a/lovelace-views/cctv.yaml b/lovelace-views/cctv.yaml new file mode 100644 index 0000000..fc80e3e --- /dev/null +++ b/lovelace-views/cctv.yaml @@ -0,0 +1,10 @@ +icon: mdi:cctv +path: cctv +cards: + - type: picture-entity + name: Haustür + entity: camera.yihome1 + - type: picture-entity + name: Haustür Alarm Image + entity: binary_sensor.yihome1_alarm + camera_image: camera.yihome1_alarm diff --git a/lovelace-views/devices.yaml b/lovelace-views/devices.yaml new file mode 100644 index 0000000..30ef19c --- /dev/null +++ b/lovelace-views/devices.yaml @@ -0,0 +1,28 @@ +icon: mdi:cellphone-link +path: devices +cards: + - type: horizontal-stack + cards: + - type: entities + title: Handy Florian + show_header_toggle: false + entities: + - entity: device_tracker.mobile_fb + name: Standort + - entity: sensor.mobile_fb_battery + name: Akku + icon: mdi:battery + - entity: sensor.mobile_fb_callstate + name: Anrufstatus + - type: entities + title: Handy Jenny + show_header_toggle: false + entities: + - entity: device_tracker.mobile_fb + name: Standort + - entity: sensor.mobile_fb_battery + name: Akku + icon: mdi:battery + - entity: sensor.mobile_fb_callstate + name: Anrufstatus + diff --git a/lovelace-views/humidity.yaml b/lovelace-views/humidity.yaml new file mode 100644 index 0000000..bbd0b3c --- /dev/null +++ b/lovelace-views/humidity.yaml @@ -0,0 +1,13 @@ +icon: mdi:water-percent +path: humidity +cards: + - type: history-graph + title: 'Dachboden' + refresh_interval: 30 + entities: + - entity: sensor.attic_temperature + name: Temperatur + - entity: sensor.attic_heatIndex + name: Gefühlt + - entity: sensor.attic_humidity + name: Luftfeuchtigkeit \ No newline at end of file diff --git a/lovelace-views/instagram.yaml b/lovelace-views/instagram.yaml new file mode 100644 index 0000000..51dddf7 --- /dev/null +++ b/lovelace-views/instagram.yaml @@ -0,0 +1,56 @@ +icon: mdi:instagram +path: instagram +cards: + - type: vertical-stack + cards: + - type: picture + image: /local/avatars/jenny-bty.jpg + - type: sensor + entity: sensor.instagram_beauty + icon: mdi:heart + graph: line + - type: glance + entities: + - entity: sensor.instagram_beauty_media + name: Beiträge + icon: mdi:image-multiple + - entity: sensor.instagram_beauty_follows + name: Abonniert + icon: mdi:account-multiple + - type: glance + title: frankyowski + show_name: false + entities: + - entity: sensor.instagram_franky + icon: mdi:heart + - entity: sensor.instagram_franky_media + icon: mdi:image-multiple + - entity: sensor.instagram_franky_follows + icon: mdi:account-multiple + + - type: vertical-stack + cards: + - type: picture + image: /local/avatars/flo-mtb.jpg + - type: sensor + entity: sensor.instagram_mtb + icon: mdi:heart + graph: line + - type: glance + entities: + - entity: sensor.instagram_mtb_media + name: Beiträge + icon: mdi:image-multiple + - entity: sensor.instagram_mtb_follows + name: Abonniert + icon: mdi:account-multiple + - type: glance + title: _fbrinker + show_name: false + entities: + - entity: sensor.instagram_fb + icon: mdi:heart + - entity: sensor.instagram_fb_media + icon: mdi:image-multiple + - entity: sensor.instagram_fb_follows + icon: mdi:account-multiple \ No newline at end of file diff --git a/lovelace-views/livingroom.yaml b/lovelace-views/livingroom.yaml new file mode 100644 index 0000000..804ab05 --- /dev/null +++ b/lovelace-views/livingroom.yaml @@ -0,0 +1,64 @@ +title: Wohnzimmer +path: livingroom +panel: true +cards: + - type: horizontal-stack + cards: + - type: vertical-stack + cards: + - type: picture-glance + title: Harmony + entities: + - entity: switch.harmony_firetv + icon: mdi:television + - entity: switch.harmony_music_bt + icon: mdi:bluetooth-audio + - entity: switch.harmony_steamlink + icon: mdi:steam + - entity: switch.harmony_playstation + icon: mdi:playstation + state_image: + "PowerOff": /local/images/power.jpg + "Fire TV sehen": /local/images/firetv.jpg + "Musik Bluetooth": /local/images/music.jpg + "SteamLink": /local/images/steamlink.jpg + "PlayStation": /local/images/playstation.jpg + entity: sensor.harmony_activity + + - type: conditional + conditions: + - entity: sensor.harmony_activity + state: "Musik Bluetooth" + card: + type: media-control + entity: media_player.spotify + + - type: vertical-stack + cards: + - type: picture-glance + title: Denon AVR + entities: + - entity: switch.harmony_mute + icon: mdi:volume-off + - entity: switch.harmony_power + icon: mdi:power + image: /local/images/denon.jpg + state_image: + "PowerOff": /local/images/denon-bw.jpg + entity: sensor.harmony_activity + + - type: conditional + conditions: + - entity: sensor.harmony_activity + state_not: "PowerOff" + card: + type: horizontal-stack + cards: + - type: entity-button + entity: switch.harmony_volume_down + name: Leiser + icon: mdi:volume-minus + - type: entity-button + entity: switch.harmony_volume_up + name: Lauter + icon: mdi:volume-plus \ No newline at end of file diff --git a/lovelace-views/overview.yaml b/lovelace-views/overview.yaml new file mode 100644 index 0000000..7e9e0f6 --- /dev/null +++ b/lovelace-views/overview.yaml @@ -0,0 +1,22 @@ +title: Übersicht +path: overview +cards: + - type: weather-forecast + entity: weather.openweathermap + - type: glance + title: Luftfeuchtigkeit + show_name: true + show_state: true + entities: + - sensor.attic_humidity + - type: vertical-stack + cards: + - type: map + aspect_ratio: 16:9 + default_zoom: 15 + entities: + - zone.home + - type: glance + title: Geräte + entities: + - device_tracker.mobile_fb \ No newline at end of file diff --git a/lovelace-views/spotify.yaml b/lovelace-views/spotify.yaml new file mode 100644 index 0000000..b334de8 --- /dev/null +++ b/lovelace-views/spotify.yaml @@ -0,0 +1,8 @@ +icon: mdi:spotify +path: spotify +cards: + - type: media-control + entity: media_player.spotify + - type: glance + entities: + - light.ambilight \ No newline at end of file diff --git a/scripts.yaml b/scripts.yaml new file mode 100644 index 0000000..4fdca46 --- /dev/null +++ b/scripts.yaml @@ -0,0 +1,55 @@ +livingroom_music_on: + alias: Wohnzimmer Musik - An + sequence: + - service: light.turn_on + data: + entity_id: light.ambilight +# brightness: 255 +# rgb_color: [255,125,0] + rgb_color: [0,255,62] # Spotify Green + brightness: 130 + - service: switch.turn_on + data: + entity_id: switch.harmony_music_bt + - service: media_player.select_source + data: + entity_id: media_player.spotify + source: Wohnzimmer + # We have to wait for the AVR establishing a BT connection to the Dot + - delay: + seconds: 15 + - service: media_player.media_play + data: + entity_id: media_player.spotify + +livingroom_music_off: + alias: Wohnzimmer Musik - Aus + sequence: + - service: media_player.media_pause + data: + entity_id: media_player.spotify + - service: switch.turn_off + data: + entity_id: switch.harmony_music_bt + +livingroom_netflix_on: + alias: Netflix + sequence: + - service: switch.turn_on + data: + entity_id: switch.harmony_firetv + - delay: + seconds: 6 + - service: media_player.select_source + data: + entity_id: media_player.fire_tv + source: com.netflix.ninja + - delay: + seconds: 3 + - service: remote.send_command + data: + entity_id: remote.livingroom_harmony + command: + - Ok + device: 42849848 #FireTv + delay_secs: 0.6 \ No newline at end of file diff --git a/sensors/hygrometer.yaml b/sensors/hygrometer.yaml new file mode 100644 index 0000000..f5af14b --- /dev/null +++ b/sensors/hygrometer.yaml @@ -0,0 +1,8 @@ +#- platform: mitemp_bt +# name: Bathroom Hygrometer +# mac: "4C:65:A8:DC:4D:B2" +# monitored_conditions: +# - temperature +# - humidity +# - battery + diff --git a/sensors/livingroom.yaml b/sensors/livingroom.yaml new file mode 100644 index 0000000..a40eebe --- /dev/null +++ b/sensors/livingroom.yaml @@ -0,0 +1,9 @@ +- platform: template + sensors: + harmony_activity: + value_template: > + {% if is_state("remote.livingroom_harmony", 'on') %} + {{ states.remote.livingroom_harmony.attributes.current_activity }} + {% else %} + PowerOff + {% endif %} \ No newline at end of file diff --git a/sensors/misc.yaml b/sensors/misc.yaml new file mode 100644 index 0000000..94d4528 --- /dev/null +++ b/sensors/misc.yaml @@ -0,0 +1,10 @@ + - platform: time_date + display_options: + - 'time' + - 'date' + - 'date_time' + - 'time_date' + - 'time_utc' + - 'beat' + + - platform: dnsip diff --git a/sensors/mqtt.yaml b/sensors/mqtt.yaml new file mode 100644 index 0000000..101714e --- /dev/null +++ b/sensors/mqtt.yaml @@ -0,0 +1,35 @@ +- platform: mqtt + name: "mobile_fb_battery" + state_topic: "homeassistant/sensor/android_mobile_fb_battery/state" + unit_of_measurement: '%' + value_template: "{{ value_json.level }}" + json_attributes: + - voltage + - temperature + - status + - power + - health + - technology + +- platform: mqtt + name: "mobile_fb_callstate" + state_topic: "homeassistant/sensor/android_mobile_fb_callstate/state" + value_template: "{{ value_json.state }}" + json_attributes: + - icon + +- platform: mqtt + name: "Attic Humidity" + state_topic: "home/attic/homenodeTiny1/humidity" + force_update: true + unit_of_measurement: "%" +- platform: mqtt + name: "Attic Temperature" + state_topic: "home/attic/homenodeTiny1/temperature" + force_update: true + unit_of_measurement: "°C" +- platform: mqtt + name: "Attic HeatIndex" + state_topic: "home/attic/homenodeTiny1/heatIndex" + force_update: true + unit_of_measurement: "°C" diff --git a/sensors/social.yaml b/sensors/social.yaml new file mode 100644 index 0000000..beb8f53 --- /dev/null +++ b/sensors/social.yaml @@ -0,0 +1,127 @@ +# Youtube + # beauty + - platform: rest + scan_interval: 300 + name: youtube_beauty + resource: !secret youtube_beauty + value_template: '{{ value_json["items"][0].statistics.subscriberCount }}' + unit_of_measurement: Subscribers + force_update: true + - platform: rest + scan_interval: 900 + name: youtube_beauty_videos + resource: !secret youtube_beauty + value_template: '{{ value_json["items"][0].statistics.videoCount }}' + force_update: true + - platform: rest + scan_interval: 600 + name: youtube_beauty_views + resource: !secret youtube_beauty + value_template: '{{ value_json["items"][0].statistics.viewCount }}' + force_update: true + + # mtb + - platform: rest + scan_interval: 300 + name: youtube_mtb + resource: !secret youtube_mtb + value_template: '{{ value_json["items"][0].statistics.subscriberCount }}' + unit_of_measurement: Subscribers + force_update: true + - platform: rest + scan_interval: 900 + name: youtube_mtb_videos + resource: !secret youtube_mtb + value_template: '{{ value_json["items"][0].statistics.videoCount }}' + force_update: true + - platform: rest + scan_interval: 600 + name: youtube_mtb_views + resource: !secret youtube_mtb + value_template: '{{ value_json["items"][0].statistics.viewCount }}' + force_update: true + +# Instagram + #beauty + - platform: rest + scan_interval: 300 + name: instagram_beauty + resource: !secret instagram_beauty + value_template: '{{ value_json.data.counts.followed_by }}' + unit_of_measurement: Followers + force_update: true + - platform: rest + scan_interval: 900 + name: instagram_beauty_follows + resource: !secret instagram_beauty + value_template: '{{ value_json.data.counts.follows }}' + force_update: true + - platform: rest + scan_interval: 600 + name: instagram_beauty_media + resource: !secret instagram_beauty + value_template: '{{ value_json.data.counts.media }}' + force_update: true + + # franky + - platform: rest + scan_interval: 300 + name: instagram_franky + resource: !secret instagram_franky + value_template: '{{ value_json.data.counts.followed_by }}' + unit_of_measurement: Followers + force_update: true + - platform: rest + scan_interval: 900 + name: instagram_franky_follows + resource: !secret instagram_franky + value_template: '{{ value_json.data.counts.follows }}' + force_update: true + - platform: rest + scan_interval: 600 + name: instagram_franky_media + resource: !secret instagram_franky + value_template: '{{ value_json.data.counts.media }}' + force_update: true + + # fb + - platform: rest + scan_interval: 300 + name: instagram_fb + resource: !secret instagram_fb + value_template: '{{ value_json.data.counts.followed_by }}' + unit_of_measurement: Followers + force_update: true + - platform: rest + scan_interval: 900 + name: instagram_fb_follows + resource: !secret instagram_fb + value_template: '{{ value_json.data.counts.follows }}' + force_update: true + - platform: rest + scan_interval: 600 + name: instagram_fb_media + resource: !secret instagram_fb + value_template: '{{ value_json.data.counts.media }}' + force_update: true + + # mtb + - platform: rest + scan_interval: 300 + name: instagram_mtb + resource: !secret instagram_mtb + value_template: '{{ value_json.data.counts.followed_by }}' + unit_of_measurement: Followers + force_update: true + - platform: rest + scan_interval: 900 + name: instagram_mtb_follows + resource: !secret instagram_mtb + value_template: '{{ value_json.data.counts.follows }}' + force_update: true + - platform: rest + scan_interval: 600 + name: instagram_mtb_media + resource: !secret instagram_mtb + value_template: '{{ value_json.data.counts.media }}' + force_update: true diff --git a/sensors/weather.yaml b/sensors/weather.yaml new file mode 100644 index 0000000..bb8df6e --- /dev/null +++ b/sensors/weather.yaml @@ -0,0 +1,10 @@ +- platform: buienradar + monitored_conditions: + - temperature + - humidity + - windspeed + - winddirection + - precipitation + - condition + - conditionexact + diff --git a/switches.yaml b/switches.yaml new file mode 100644 index 0000000..96375e7 --- /dev/null +++ b/switches.yaml @@ -0,0 +1,147 @@ +- platform: template + switches: + harmony_music_bt: + value_template: "{{ is_state_attr('remote.livingroom_harmony', 'current_activity', 'Musik Bluetooth') }}" + turn_on: + service: remote.turn_on + data: + entity_id: remote.livingroom_harmony + activity: 'Musik Bluetooth' + turn_off: + service: remote.turn_on + data: + entity_id: remote.livingroom_harmony + activity: 'PowerOff' + + harmony_firetv: + value_template: "{{ is_state_attr('remote.livingroom_harmony', 'current_activity', 'Fire TV sehen') }}" + turn_on: + service: remote.turn_on + data: + entity_id: remote.livingroom_harmony + activity: 'Fire TV sehen' + turn_off: + service: remote.turn_on + data: + entity_id: remote.livingroom_harmony + activity: 'PowerOff' + + harmony_steamlink: + value_template: "{{ is_state_attr('remote.livingroom_harmony', 'current_activity', 'SteamLink') }}" + turn_on: + service: remote.turn_on + data: + entity_id: remote.livingroom_harmony + activity: 'SteamLink' + turn_off: + service: remote.turn_on + data: + entity_id: remote.livingroom_harmony + activity: 'PowerOff' + + harmony_playstation: + value_template: "{{ is_state_attr('remote.livingroom_harmony', 'current_activity', 'PlayStation') }}" + turn_on: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + activity: 'PlayStation' + turn_off: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + activity: 'PowerOff' + + harmony_mute: + value_template: "{{ state_attr('remote.livingroom_harmony', 'current_activity') != 'PowerOff' }}" + turn_on: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + command: + - Mute + device: 42849850 #Denon + delay_secs: 0.6 + turn_off: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + command: + - Mute + device: 42849850 #Denon + delay_secs: 0.6 + + harmony_power: + value_template: "{{ state_attr('remote.livingroom_harmony', 'current_activity') != 'PowerOff' }}" + turn_on: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + command: + - PowerToggle + device: 42849850 #Denon + delay_secs: 0.6 + turn_off: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + command: + - PowerToggle + device: 42849850 #Denon + delay_secs: 0.6 + + harmony_volume_down: + friendly_name: Denon Leiser + value_template: "{{ state_attr('remote.livingroom_harmony', 'current_activity') != 'PowerOff' }}" + turn_on: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + command: + - VolumeDown + device: 42849850 #Denon + delay_secs: 0.6 + turn_off: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + command: + - VolumeDown + device: 42849850 #Denon + delay_secs: 0.6 + + harmony_volume_up: + value_template: "{{ state_attr('remote.livingroom_harmony', 'current_activity') != 'PowerOff' }}" + turn_on: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + command: + - VolumeUp + device: 42849850 #Denon + delay_secs: 0.6 + turn_off: + service: remote.send_command + data: + entity_id: remote.livingroom_harmony + command: + - VolumeUp + device: 42849850 #Denon + delay_secs: 0.6 + + livingroom_music: + value_template: "{{ is_state_attr('remote.livingroom_harmony', 'current_activity', 'Musik Bluetooth') }}" + turn_on: + service: script.livingroom_music_on + turn_off: + service: script.livingroom_music_off + + livingroom_netflix: + value_template: "{{ is_state_attr('remote.livingroom_harmony', 'current_activity', 'Fire TV sehen') }}" + turn_on: + service: script.livingroom_netflix_on + turn_off: + service: remote.turn_on + data: + entity_id: remote.livingroom_harmony + activity: 'PowerOff' \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml new file mode 100644 index 0000000..ca1f3f4 --- /dev/null +++ b/ui-lovelace.yaml @@ -0,0 +1,10 @@ +# Icons @ https://materialdesignicons.com/ +title: Połowa Bliźniaka +views: + - !include lovelace-views/overview.yaml + - !include lovelace-views/livingroom.yaml + - !include lovelace-views/humidity.yaml + - !include lovelace-views/spotify.yaml + - !include lovelace-views/instagram.yaml + - !include lovelace-views/devices.yaml + - !include lovelace-views/cctv.yaml \ No newline at end of file diff --git a/www/avatars/flo-mtb.jpg b/www/avatars/flo-mtb.jpg new file mode 100644 index 0000000..bea8cdd Binary files /dev/null and b/www/avatars/flo-mtb.jpg differ diff --git a/www/avatars/jenny-bty.jpg b/www/avatars/jenny-bty.jpg new file mode 100644 index 0000000..60bb96c Binary files /dev/null and b/www/avatars/jenny-bty.jpg differ diff --git a/www/images/denon-bw.jpg b/www/images/denon-bw.jpg new file mode 100644 index 0000000..aefdc58 Binary files /dev/null and b/www/images/denon-bw.jpg differ diff --git a/www/images/denon.jpg b/www/images/denon.jpg new file mode 100644 index 0000000..4854d3b Binary files /dev/null and b/www/images/denon.jpg differ diff --git a/www/images/firetv.jpg b/www/images/firetv.jpg new file mode 100644 index 0000000..956e888 Binary files /dev/null and b/www/images/firetv.jpg differ diff --git a/www/images/music.jpg b/www/images/music.jpg new file mode 100644 index 0000000..0175e71 Binary files /dev/null and b/www/images/music.jpg differ diff --git a/www/images/playstation.jpg b/www/images/playstation.jpg new file mode 100644 index 0000000..b7d0bde Binary files /dev/null and b/www/images/playstation.jpg differ diff --git a/www/images/power.jpg b/www/images/power.jpg new file mode 100644 index 0000000..1cba137 Binary files /dev/null and b/www/images/power.jpg differ diff --git a/www/images/steamlink.jpg b/www/images/steamlink.jpg new file mode 100644 index 0000000..71a8b2f Binary files /dev/null and b/www/images/steamlink.jpg differ