├── israel_rain_radar ├── image.jpg └── README.md ├── where_is_everyone ├── image.jpg └── README.md ├── echo_tunein_radio_card ├── image.jpg └── README.md ├── israel_satellite_radar ├── image.jpg └── README.md ├── chromecast_radio_player_card ├── image.jpg └── README.md ├── README.md └── LICENSE /israel_rain_radar/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eyalcha/home-assistant-cookbook/HEAD/israel_rain_radar/image.jpg -------------------------------------------------------------------------------- /where_is_everyone/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eyalcha/home-assistant-cookbook/HEAD/where_is_everyone/image.jpg -------------------------------------------------------------------------------- /echo_tunein_radio_card/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eyalcha/home-assistant-cookbook/HEAD/echo_tunein_radio_card/image.jpg -------------------------------------------------------------------------------- /israel_satellite_radar/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eyalcha/home-assistant-cookbook/HEAD/israel_satellite_radar/image.jpg -------------------------------------------------------------------------------- /chromecast_radio_player_card/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eyalcha/home-assistant-cookbook/HEAD/chromecast_radio_player_card/image.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Home Assistant Cookbook 2 | 3 | - [Israel rain radar](israel_rain_radar/README.md) 4 | - [Israel satellite radar](israel_satellite_radar/README.md) 5 | - [Where is everyone](where_is_everyone/README.md) 6 | - [Echo tunein radio card](echo_tunein_radio_card/README.md) 7 | - [Chromecast radio player card](chromecast_radio_player_card/README.md) 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Santobert 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /israel_rain_radar/README.md: -------------------------------------------------------------------------------- 1 | # Israel rain radar 2 | 3 | *Please :star: this repo if you find it useful* 4 | 5 | For a view of Israel rain radar, we will use [generic camera](https://www.home-assistant.io/integrations/generic/) with still image URL. 6 | For changing the time offset of the image, we will use [input number](https://www.home-assistant.io/integrations/input_number/). The input number (time offset) can be set using UI or using input number [services](https://www.home-assistant.io/integrations/input_number/#services). 7 | 8 | Note that the refresh rate of the image is based on the refresh rate of the entity card, so there is a delay until the image is updated after changing the time offset. 9 | 10 | ![Rain Radar](image.jpg) 11 | 12 | ## Entities 13 | 14 | The camera uses template to define the image URL. The template creates the time stamp of the image based on the current time and the offset set by the input number. 15 | 16 | 17 | ```yaml 18 | camera: 19 | platform: generic 20 | name: Weather rain 21 | content_type: image/gif 22 | limit_refetch_to_url_change: true 23 | still_image_url: > 24 | {% set offset_seconds = 20 * 60 + 10 * 60 * states('input_number.weather_rain_offset') | int %} 25 | {% set timestamp = (as_timestamp(now()) - offset_seconds) | timestamp_custom('%Y%m%d%H%M', True) | regex_replace(find='(?<=\d{11})\d', replace='0') %} 26 | https://ims.gov.il/sites/default/files/ims_data/map_images/radar/radar_{{timestamp}}.gif 27 | ``` 28 | 29 | Input number for time offset: 30 | 31 | ```yaml 32 | input_number: 33 | weather_rain_offset: 34 | name: Offset 35 | min: 0 36 | max: 14 37 | step: 1 38 | ``` 39 | 40 | ## Lovelace 41 | 42 | ```yaml 43 | cards: 44 | - type: picture-entity 45 | entity: camera.weather_rain 46 | show_state: false 47 | - type: entities 48 | entities: 49 | - entity: input_number.weather_rain_offset 50 | ``` 51 | 52 | **Note**: For slider, you can also use the custom [slider entity row](https://github.com/thomasloven/lovelace-slider-entity-row) which gives more control on the card. 53 | 54 | --- 55 | 56 | I put a lot of work into making this repo and component available and updated to inspire and help others! I will be glad to receive thanks from you — it will give me new strength and add enthusiasm: 57 |


58 | PayPal 59 |

-------------------------------------------------------------------------------- /israel_satellite_radar/README.md: -------------------------------------------------------------------------------- 1 | # Israel satellite radar 2 | 3 | *Please :star: this repo if you find it useful* 4 | 5 | For a view of Israel satellite radar, we will use [generic camera](https://www.home-assistant.io/integrations/generic/) with still image URL. 6 | For changing the time offset of the image, we will use [input number](https://www.home-assistant.io/integrations/input_number/). The input number (time offset) can be set using UI or using input number [services](https://www.home-assistant.io/integrations/input_number/#services). 7 | 8 | Note that the refresh rate of the image is based on the refresh rate of the entity card, so there is a delay until the image is updated after changing the time offset. 9 | 10 | ![Satellite Radar](image.jpg) 11 | 12 | ## Entities 13 | 14 | The camera uses template to define the image URL. The template creates the time stamp of the image based on the current time and the offset set by the input number. 15 | 16 | 17 | ```yaml 18 | camera: 19 | platform: generic 20 | name: Weather satellite 21 | content_type: image/gif 22 | limit_refetch_to_url_change: true 23 | still_image_url: > 24 | {% set offset_seconds = 60 * 60 + 60 * 60 * states('input_number.weather_satellite_offset') | int %} 25 | {% set timestamp = (as_timestamp(now()) - offset_seconds) | timestamp_custom('%Y%m%d%H00', True) %} 26 | https://ims.gov.il/sites/default/files/ims_data/map_images/satellite/satellite_{{timestamp}}_MIDDLE-EAST.jpeg 27 | ``` 28 | 29 | Input number for time offset: 30 | 31 | ```yaml 32 | input_number: 33 | weather_satellite_offset: 34 | name: Offset 35 | min: 0 36 | max: 11 37 | step: 1 38 | ``` 39 | 40 | ## Lovelace 41 | 42 | ```yaml 43 | type: vertical-stack 44 | cards: 45 | - type: picture-glance 46 | camera_image: camera.weather_satellite 47 | show_info: true 48 | entities: [] 49 | - type: custom:slider-entity-row 50 | name: Time 51 | entity: input_number.weather_satellite_offset 52 | hide_state: true 53 | ``` 54 | 55 | **Note**: For slider, you can also use the custom [slider entity row](https://github.com/thomasloven/lovelace-slider-entity-row) which gives more control on the card. 56 | 57 | --- 58 | 59 | I put a lot of work into making this repo and component available and updated to inspire and help others! I will be glad to receive thanks from you — it will give me new strength and add enthusiasm: 60 |


61 | PayPal 62 |

-------------------------------------------------------------------------------- /echo_tunein_radio_card/README.md: -------------------------------------------------------------------------------- 1 | # Echo tunein radio card 2 | 3 | *Please :star: this repo if you find it useful* 4 | 5 | Lovelace card with pre-defined Israel radio station buttons to play on Amazon echo device from [Tunein](https://tunein.com/) streaming service. 6 | 7 | ## Prerequisites 8 | 9 | - [Mini media player](https://github.com/kalkih/mini-media-player) 10 | - [Decluttering card](https://github.com/custom-cards/decluttering-card) 11 | - [Alexa media player](https://github.com/custom-components/alexa_media_player) 12 | 13 | ## Scripts 14 | 15 | ```yaml 16 | script: 17 | media_player_play_tunein_radio: 18 | sequence: 19 | - service: media_player.play_media 20 | data_template: 21 | entity_id: "{{ entity_id }}" 22 | media_content_id: "{{ content_id }}" 23 | media_content_type: TUNEIN 24 | ``` 25 | 26 | ## Templates 27 | 28 | Media player card template with pre deffined Tunein israel radio stations. 29 | 30 | ```yaml 31 | decluttering_templates: 32 | template_media_player_echo: 33 | card: 34 | type: custom:mini-media-player 35 | entity: '[[entity_id]]' 36 | group: false 37 | tts: 38 | platform: alexa 39 | hide: 40 | power: true 41 | progress: true 42 | shortcuts: 43 | columns: 4 44 | buttons: 45 | - name: Gimmel 46 | type: script 47 | id: script.media_player_play_tunein_radio 48 | data: 49 | entity_id: '[[entity_id]]' 50 | content_id: Kan Gimmel 51 | - name: Bet 52 | type: script 53 | id: script.media_player_play_tunein_radio 54 | data: 55 | entity_id: m'[[entity_id]]' 56 | content_id: Kan Bet 57 | - name: Galatz 58 | type: script 59 | id: script.media_player_play_tunein_radio 60 | data: 61 | entity_id: '[[entity_id]]' 62 | content_id: Galei Zahal 63 | - name: 90 FM 64 | type: script 65 | id: script.media_player_play_tunein_radio 66 | data: 67 | entity_id: '[[entity_id]]' 68 | content_id: Radio 90 FM 69 | - name: 99 FM 70 | type: script 71 | id: script.media_player_play_tunein_radio 72 | data: 73 | entity_id: '[[entity_id]]' 74 | content_id: Echo 99 FM 75 | - name: Kan 88 76 | type: script 77 | id: script.media_player_play_tunein_radio 78 | data: 79 | entity_id: '[[entity_id]]' 80 | content_id: KAN 88 81 | - name: Galgalatz 82 | type: script 83 | id: script.media_player_play_tunein_radio 84 | data: 85 | entity_id: '[[entity_id]]' 86 | content_id: GLGLZ 87 | - id: script.media_player_play_tunein_radio 88 | type: source 89 | ``` 90 | 91 | ## Lovelace 92 | 93 | Set your media player entity id 94 | 95 | ```yaml 96 | . 97 | . 98 | . 99 | type: vertical-stack 100 | cards: 101 | - type: custom:decluttering-card 102 | template: template_media_player_echo 103 | variables: 104 | - entity_id: media_player.< media player id> 105 | ``` 106 | 107 | ![Radio Player](image.jpg) 108 | 109 | --- 110 | 111 | I put a lot of work into making this repo and component available and updated to inspire and help others! I will be glad to receive thanks from you — it will give me new strength and add enthusiasm: 112 |


113 | PayPal 114 |

-------------------------------------------------------------------------------- /chromecast_radio_player_card/README.md: -------------------------------------------------------------------------------- 1 | # Chromecast radio player card 2 | 3 | *Please :star: this repo if you find it useful* 4 | 5 | Lovelace card with pre-defined Israel radio station buttons to play on Chromecast device. 6 | 7 | ## Prerequisites 8 | 9 | - [Mini media player](https://github.com/kalkih/mini-media-player) 10 | - [Decluttering card](https://github.com/custom-cards/decluttering-card) 11 | 12 | ## Scripts 13 | 14 | ```yaml 15 | script: 16 | media_player_play_radio_stream: 17 | sequence: 18 | - service: media_player.play_media 19 | data_template: 20 | entity_id: "{{ entity_id }}" 21 | media_content_id: > 22 | {% if content_id == "Kan Gimmel" %} 23 | http://kanliveicy.media.kan.org.il/icy/kangimmel_mp3?providername=tunein 24 | {% elif content_id == "KAN 88" %} 25 | http://kanliveicy.media.kan.org.il/icy/kan88_mp3?providername=tunein 26 | {% elif content_id == "Kan Bet" %} 27 | http://kanliveicy.media.kan.org.il/icy/kanbet_mp3?providername=tunein 28 | {% elif content_id == "GLGLZ" %} 29 | https://glzwizzlv.bynetcdn.com/glglz_mp3?awCollectionId=misc&awEpisodeId=glglz 30 | {% elif content_id == "Galei Zahal" %} 31 | http://glzwizzlv.bynetcdn.com/glz_mp3?awCollectionId=misc&awEpisodeId=glz 32 | {% elif content_id == "Echo 99 FM" %} 33 | https://eco-live.mediacast.co.il/99fm_aac?.m4a&listenerid=066aae8a4c886b90398e894d0978f2f8&awparams=companionAds%3Atrue 34 | {% elif content_id == "Radio 90 FM" %} 35 | https://icy.streamgates.net/Radio_CDN/Emtza_Haderech/icecast.audio 36 | {% endif %} 37 | media_content_type: audio/mp3 38 | ``` 39 | 40 | **Note**: streaming urls might change in the future. 41 | 42 | ## Templates 43 | 44 | Media player card template with pre deffined radio stationnames. 45 | 46 | ```yaml 47 | decluttering_templates: 48 | template_media_player_chromecast: 49 | card: 50 | type: custom:mini-media-player 51 | entity: '[[entity_id]]' 52 | group: false 53 | tts: 54 | platform: google_translate 55 | hide: 56 | # power: true 57 | progress: true 58 | shortcuts: 59 | columns: 4 60 | buttons: 61 | - name: Gimmel 62 | type: script 63 | id: script.media_player_play_radio_stream 64 | data: 65 | entity_id: '[[entity_id]]' 66 | content_id: Kan Gimmel 67 | - name: Bet 68 | type: script 69 | id: script.media_player_play_radio_stream 70 | data: 71 | entity_id: m'[[entity_id]]' 72 | content_id: Kan Bet 73 | - name: Galatz 74 | type: script 75 | id: script.media_player_play_radio_stream 76 | data: 77 | entity_id: '[[entity_id]]' 78 | content_id: Galei Zahal 79 | - name: 90 FM 80 | type: script 81 | id: script.media_player_play_radio_stream 82 | data: 83 | entity_id: '[[entity_id]]' 84 | content_id: Radio 90 FM 85 | - name: 99 FM 86 | type: script 87 | id: script.media_player_play_radio_stream 88 | data: 89 | entity_id: '[[entity_id]]' 90 | content_id: Echo 99 FM 91 | - name: Kan 88 92 | type: script 93 | id: script.media_player_play_radio_stream 94 | data: 95 | entity_id: '[[entity_id]]' 96 | content_id: KAN 88 97 | - name: Galgalatz 98 | type: script 99 | id: script.media_player_play_radio_stream 100 | data: 101 | entity_id: '[[entity_id]]' 102 | content_id: GLGLZ 103 | - id: script.media_player_play_radio_stream 104 | type: source 105 | ``` 106 | 107 | ## Lovelace 108 | 109 | Set your media player entity id 110 | 111 | ```yaml 112 | . 113 | . 114 | . 115 | type: vertical-stack 116 | cards: 117 | - type: custom:decluttering-card 118 | template: template_media_player_chromecast 119 | variables: 120 | - entity_id: media_player.< media player id> 121 | ``` 122 | 123 | ![Radio Player](image.jpg) 124 | 125 | --- 126 | 127 | I put a lot of work into making this repo and component available and updated to inspire and help others! I will be glad to receive thanks from you — it will give me new strength and add enthusiasm: 128 |


129 | PayPal 130 |

-------------------------------------------------------------------------------- /where_is_everyone/README.md: -------------------------------------------------------------------------------- 1 | # Where is everyone 2 | 3 | *Please :star: this repo if you find it useful* 4 | 5 | ## Required services 6 | 7 | For person location, [Life360](https://www.life360.com/intl/) with the Home Assistant [Life360](https://www.home-assistant.io/integrations/life360/) integration. 8 | 9 | For voice assistant, Amazon echo device with Home Assistant [Alexa media player](https://github.com/custom-components/alexa_media_player) integration. 10 | 11 | You need also to expose the **where is everyone** script to Alexa smart home. Alexa Cloud integration via [Nabu Casa](https://www.nabucasa.com/) is an easy way for all (or selected) HA entities or scripts to be exposed to your Alexa app. 12 | 13 | ## Entities 14 | 15 | Add your family [persons](https://www.home-assistant.io/integrations/person/). Use the device tracker assosicated with each person. 16 | 17 | ```yaml 18 | person: 19 | - name: Person1 20 | id: person1 21 | device_trackers: 22 | - device_tracker.life360_... 23 | - name: Person2 24 | id: person2 25 | device_trackers: 26 | - device_tracker.life360_... 27 | ``` 28 | 29 | Add all family member to persons [group](https://www.home-assistant.io/integrations/group/): 30 | 31 | ```yaml 32 | group: 33 | all_persons: 34 | name: All persons 35 | entities: 36 | - person.person1 37 | - person.person2 38 | ``` 39 | 40 | Add your known [zones](https://www.home-assistant.io/integrations/zone): 41 | 42 | ```yaml 43 | zone: 44 | - name: Gym 45 | latitude: 35.569649 46 | longitude: 42.9333286 47 | radius: 50 48 | icon: mdi:map-marker 49 | ``` 50 | 51 | And a sensor which will get the last activated alexa device. 52 | 53 | ```yaml 54 | sensor: 55 | - platform: template 56 | sensors: 57 | alexa_last: 58 | value_template: > 59 | {{ states.media_player | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }} 60 | ``` 61 | 62 | ## Customization 63 | 64 | Use [customization](https://www.home-assistant.io/docs/configuration/customizing-devices/) to set persons ```friendly_name```. The friendly name is used when building the response message. 65 | 66 | ```yaml 67 | person.person1: 68 | friendly_name: John 69 | person.person2: 70 | friendly_name: Julia 71 | ``` 72 | 73 | ## Scripts 74 | 75 | The following script sends a notification message to the last activated Alexa device. 76 | 77 | ```yaml 78 | script: 79 | notify_voice_last: 80 | alias: Notify voice last 81 | sequence: 82 | - service: notify.alexa_media 83 | data_template: 84 | target: "{{ states('sensor.alexa_last') }}" 85 | data: 86 | type: announce 87 | message: "{{ message }}" 88 | ``` 89 | 90 | The notify script iterates all family persons, and build the text response that will be sent to the last activated device. Note that the person name is taken from the person ```friendly_name``` attribute. 91 | 92 | ```yaml 93 | script: 94 | person_notify_all_persons_location: 95 | sequence: 96 | - service: script.notify_voice_last 97 | data_template: 98 | message: > 99 | {% set ns = namespace(say="") %} 100 | {% for entity_id in states.group.all_persons.attributes.entity_id -%} 101 | {% set name = state_attr(entity_id, 'friendly_name') %} 102 | {% set location = states(entity_id) %} 103 | {% if location == 'home' %} 104 | {% set ns.say = ns.say + name + ' is at home. ' %} 105 | {% elif location == 'not_home' %} 106 | {% set ns.say = ns.say + name + ' is away. ' %} 107 | {% else %} 108 | {% set ns.say = ns.say + name + ' was last seen at ' + location + '. ' %} 109 | {% endif %} 110 | {%- endfor %} 111 | {{ns.say}} 112 | ``` 113 | 114 | ## Discover Devices 115 | 116 | Before you create the [rountine](https://www.amazon.com/gp/help/customer/display.html?nodeId=202200080), you need Alexa to discover the person notification script. After [adding](https://www.nabucasa.com/config/amazon_alexa/) the script to the scripts shown to alexa, just say "Alexa, discover devices", and wait until the new script is being discovered. 117 | 118 | ## Routines 119 | 120 | To be able to ask Alexa **where is everyone**, you will need to add a routine that will trigger the Home Assistant script. Use the Alexa App in your mobile device to define the rountine. 121 | 122 | ![Alexa Rotine](image.jpg) 123 | 124 | --- 125 | 126 | I put a lot of work into making this repo and component available and updated to inspire and help others! I will be glad to receive thanks from you — it will give me new strength and add enthusiasm: 127 |


128 | PayPal 129 |

--------------------------------------------------------------------------------