bazingabot

joined 1 year ago
[–] [email protected] 1 points 1 week ago (1 children)

Awesome. I went dyndns, port forward to wireguard on my router. Works wonderfully on my phone since years ... allows btw also for using your pihole on the phone when on the go.

[–] [email protected] 2 points 1 week ago (3 children)

Or...if you know how it works...setup a vpn, install homeassistant on your Raspberry Pi at home, connect your hue bulbs to a Zigbee stick and you circumvent all this Philips account spying nonsense

[–] [email protected] 3 points 2 weeks ago

If you have a Google Pixel phone then install grapheneos and all becomes a "can" from a "must"

[–] [email protected] 0 points 2 weeks ago

This process took for me a year or so...but now I am finally there. 3 protonmail accts and nothing else.

One for personal/family/bank/official/insurance One for everything which I need longer...e.g. Logins to webpages One for online shopping/tickets...this one I delete every 12 months and create new, because here annoying spam from vendors is piling up

[–] [email protected] 19 points 2 weeks ago

Aaaah, I love grapheneos!!

[–] [email protected] 9 points 2 weeks ago (1 children)
[–] [email protected] 9 points 2 weeks ago

I rather would have a device that is not as locked down and bloated as Samsung's to run grapheneos

[–] [email protected] 3 points 1 month ago* (last edited 1 month ago) (1 children)

Oooooor you could just use 'ping' in HA and check whether the IP address of your phone is up in your local network. If so, have an automation in HA with lights and stuff...I am using this method since 5 years..works well. The only thing that you need to do is to fix an IP address in your router to the mac address of your phone.

[–] [email protected] 32 points 2 months ago (1 children)

Definitely not my representatives in the EU..and all in front our wonderful Ursula von der Leyen, a personified political failure. And why this constant fake argument of child abuse?.. the real argument is that politicians and governments want to spy on EU inhabitants..time to vote differently..if this still helps anything in the EU ..

 

Hi, want to share my script how you make a good tts announcement on sonos.

How it works:

  • triggered by an automation like this
          - service: script.turn_on
            entity_id: script.jarvis_speak
            data:
              variables:
                mymessage: |
                  {{ state_attr('sensor.notification_message', 'msg') }}
                myplayer: media_player.sonos_bedroom

  • the script is using an input_boolean to flip so that one announcement is done at a time, that's why I have the "jarvis_announcement_wait" boolean
  • it uses "input_number.jarvis_<>_volume to be able to adjust the volume per room for the announcements
  • it uses a little "ding" sound prior to the announcement
  • it uses piper and with trial end error I figured out how many word per minute "ryan" is speaking so that the script ends exactly at the time when the tts announcement has finished in case there are multiple announcements to be made per room
alias: jarvis_speak
sequence:
	  - repeat:
		  while:
			- condition: state
			  entity_id: input_boolean.jarvis_announcement_wait
			  state: "on"
		  sequence:
			- delay:
				hours: 0
				minutes: 0
				seconds: 1
				milliseconds: 0
	  - service: input_boolean.turn_on
		target:
		  entity_id:
			- input_boolean.jarvis_announcement_wait
		data: {}
      - service: media_player.play_media
        data:
          media_content_id: /local/jarvis-chime.wav
          media_content_type: music
          announce: true
          extra:
            volume: >-
              {{ states('input_number.jarvis_' + myplayer |
              replace('media_player.','') + '_volume')  }}
        target:
          entity_id: "{{ myplayer }}"
      - delay:
          seconds: 1
      - service: media_player.play_media
        data:
          media_content_type: music
          announce: true
          media_content_id: >-
            media-source://tts/tts.piper?message={{ mymessage  | replace('&',
            'and') }}
          extra:
            volume: >-
              {{ states('input_number.jarvis_' + myplayer |
              replace('media_player.','') + '_volume')  }}
        target:
          entity_id: "{{ myplayer }}"
      - delay:
          seconds: >
            {% set text = mymessage | replace('&', 'and') %} {{ (text.split(' ')
            | length * 60 / 150) | round(0, 'ceil') }}
	  - service: input_boolean.turn_off
		target:
		  entity_id:
			- input_boolean.jarvis_announcement_wait
		data: {}
mode: queued
max: 10

 

Hi,

wanted to share my recent automation. What it does: Whenever you want to watch a movie and use chromecast, it looks up the title on IMDB and gets the rating. Then announces the rating via tts.

Sorry for bad formatting - I don't get this to work here

  • Install pyscript from hacs
  • Create a pyscript folder in your config
  • In your pyscript folder create a file "requirements.txt"
  • Write "cinemagoer" and save
  • Create a file "movieinfo.py"
  • Add the following python code
from imdb import Cinemagoer

import sys

import requests

@service
def multimedia_getmovieinfos(mytitle=None):
    """yaml
    name: get imdb movie infos
    description: obtain infos from imdb for a movie, stored in multiple input_text sensors
    fields:
        mytitle:
            description: provide the movie title
            example: Rollo Aller
            required: true
"""

    ia = Cinemagoer()
    search = task.executor(ia.search_movie, mytitle)

    for i in range(len(search)):
      if i == 0:
        id = search[i].movieID
        info = task.executor(ia.get_movie, id)
        genre_list = info.data['genres']
        service.call("input_text", "set_value", blocking=True, limit=10, entity_id="input_text.multimedia_current_movie_title", value=search[i]['title'] + ' ('+str(info.data['year'])+')')
        
        service.call("input_text", "set_value", blocking=True, limit=10, entity_id="input_text.multimedia_current_movie_genre", value=','.join(map(str, genre_list)).replace(',', ', '))

        service.call("input_text", "set_value", blocking=True, limit=10, entity_id="input_text.multimedia_current_movie_rating", value=( str(round(info.data['rating'], 2))))
        
        if 'plot outline' in info.data:
            service.call("input_text", "set_value", blocking=True, limit=10, entity_id="input_text.multimedia_current_movie_plot", value=info.data['plot outline'][:255])
        else:
            service.call("input_text", "set_value", blocking=True, limit=10, entity_id="input_text.multimedia_current_movie_plot", value="no plot available")

  • Create four input_text sensors in homeassistant
input_text:

  multimedia_current_movie_title:
    name: Multimedia Current Movie Title
    
  multimedia_current_movie_rating:
    name: Multimedia Current Movie Rating
    
  multimedia_current_movie_genre:
    name: Multimedia Current Movie Genre
    
  multimedia_current_movie_plot:
    name: Multimedia Current Movie Plot
    max: 255
  • Create an input_number sensor for the rating threshold
  multimedia_tv_minimum_rating:
    name: Movie Minimum Rating
    icon: mdi:brightness-percent
    mode: slider
    step: 0.1
    max: 10
    min: 0
    initial: 5.0
  • Add an automation to trigger getting the movie infos
alias: multimedia_tv_aerocast_get_movie_infos
description: ""
trigger:
  - platform: state
    entity_id:
      - media_player.aerocast
    to: playing
    id: "1"
  - platform: state
    entity_id:
      - media_player.aerocast
    from: playing
    id: "2"
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: "1"
        sequence:
          - service: pyscript.multimedia_getmovieinfos
            data:
              mytitle: |
                {{ state_attr('media_player.aerocast', 'media_title') }}
  - choose:
      - conditions:
          - condition: trigger
            id: "2"
        sequence:
          - service: input_text.set_value
            data:
              value: " "
            target:
              entity_id: input_text.multimedia_current_movie_genre
          - service: input_text.set_value
            data:
              value: " "
            target:
              entity_id: input_text.multimedia_current_movie_title
          - service: input_text.set_value
            data:
              value: " "
            target:
              entity_id: input_text.multimedia_current_movie_rating
          - service: input_text.set_value
            data:
              value: " "
            target:
              entity_id: input_text.multimedia_current_movie_plot
mode: single




  • Add an automation to announce whenever you play your movie - I do that through mqtt. Adjust to your liking :)

alias: jarvis_notify_movie_rating
description: ""
trigger:
  - platform: state
    entity_id:
      - input_text.multimedia_current_movie_rating
condition:
  - condition: template
    value_template: "{{ states('input_text.multimedia_current_movie_rating') != ' ' }}"
action:
  - choose:
      - conditions:
          - condition: template
            value_template: >-
              {{ states('input_text.multimedia_current_movie_rating') |
              float(default=0) <
              states('input_number.multimedia_tv_minimum_rating') |
              float(default=0) }}
        sequence:
          - service: mqtt.publish
            data:
              topic: notifications
              payload_template: |
                { 
                  "heading": "Movie underrated",
                  "details":
                    { 
                      "msg": "Do you really want to watch {{ state_attr('media_player.aerocast', 'media_title') }}? It only has a rating of {{ states('input_text.multimedia_current_movie_rating') }} on I M D B.",
                      "player": "livingroom",
                      "importance": "high",
                      "received": "{{ now().strftime("%H:%M:%S") }}" 
                    }
                }
      - conditions:
          - condition: template
            value_template: >-
              {{ states('input_text.multimedia_current_movie_rating') |
              float(default=0) >=
              states('input_number.multimedia_tv_minimum_rating') |
              float(default=0) }}
        sequence:
          - service: mqtt.publish
            data:
              topic: notifications
              payload_template: |
                { 
                  "heading": "Movie well rated",
                  "details":
                    { 
                      "msg": "Nice choice for a{% if states('input_text.multimedia_current_movie_genre').split(',')[0] | lower | regex_search("[aeiou]")%}n{% endif %} {{ states('input_text.multimedia_current_movie_genre').split(',')[0] | lower }} movie. {{ state_attr('media_player.aerocast', 'media_title') }} has a rating of {{ states('input_text.multimedia_current_movie_rating') }} on I M D B.",
                      "player": "livingroom",
                      "importance": "high",
                      "received": "{{ now().strftime("%H:%M:%S") }}" 
                    }
                }
mode: single
view more: next ›