Showing posts with label Home Automation. Show all posts
Showing posts with label Home Automation. Show all posts

Sunday, 12 January 2025

Integrating BBC RSS Feed into Home Assistant Dashboard Using Feedreader

Integrating BBC RSS Feed into Home Assistant Dashboard Using Feedreader

To display the latest news item from the BBC RSS feed on your Home Assistant dashboard using the feedreader integration, follow these steps:

1. Add the Feedreader Integration via the Home Assistant UI:

  1. Navigate to Settings > Devices & Services.
  2. Click on Add Integration.
  3. Search for and select Feedreader.
  4. When prompted, enter the RSS feed URL:
    • https://feeds.bbci.co.uk/news/rss.xml?edition=uk
  5. Complete the setup by following the on-screen instructions.

2. Create Helper Entities:

You'll need to create helper entities to store the title, description, link, and publication date of the latest news item.

  1. Navigate to Settings > Devices & Services > Helpers.
  2. Click on Create Helper and select Text.
    • Name it Newsitem Title.
    • Repeat this process to create two more text helpers named Newsitem Description and Newsitem Link.
  3. Create a Datetime helper:
    • Name it Newsitem Date Time.

3. Set Up Automation to Process New Feed Entries:

Create an automation that updates the helper entities when a new feed entry is detected.

  1. Navigate to Settings > Automations & Scenes.
  2. Click on Create Automation and choose Start with an empty automation.
  3. Configure the automation as follows:

    Trigger:

    • Trigger Type: Event
    • Event Type: feedreader
    • Event Data:
      • feed_url: https://feeds.bbci.co.uk/news/rss.xml?edition=uk

    Actions:

    • Action Type: Call Service
      • Service: input_text.set_value
      • Target: input_text.newsitem_title
      • Value: {{ trigger.event.data.title }}
    • Add similar actions for input_text.newsitem_descriptioninput_text.newsitem_link, and input_datetime.newsitem_date_time, setting their values to {{ trigger.event.data.description }}{{ trigger.event.data.link }} and {{ trigger.event.data.published }}, respectively.

4. Add a Markdown Card to Your Dashboard:

To display the latest news item on your dashboard, add a Markdown card with the following content:

  1. Navigate to your dashboard and click on Edit Dashboard.
  2. Click on Add Card and select Markdown.
  3. In the Content field, enter:
    **[{{ states('input_text.newsitem_title') }}]({{ states('input_text.newsitem_link') }})**
    
    {{ states('input_text.newsitem_description') }}
    
    _Published on: {{ as_datetime(states('input_datetime.newsitem_date_time')).strftime('%B %d, %Y %H:%M') }}_
  4. Click Save to add the card to your dashboard.

5. Test the Setup:

To test without waiting for a new RSS feed entry, you can simulate a feedreader event using the Developer Tools:

  1. Navigate to Developer Tools > Events.
  2. In the Event field, enter feedreader.
  3. In the Event Data field, input a JSON object that mimics the data structure of a real feed entry, for example:
    {
      "feed_url": "https://feeds.bbci.co.uk/news/rss.xml?edition=uk",
      "title": "Sample News Title",
      "description": "Sample news description.",
      "link": "https://www.bbc.co.uk/news/sample-news",
      "published": "2025-01-12T13:32:46+00:00"
    }
  4. Click Fire Event to simulate the event.
  5. Check if the helpers are updated accordingly.

After setting up, check the Logs under Settings > System > Logs to ensure there are no errors related to the feedreader integration or the automation.

By following these steps, your Home Assistant dashboard will display the latest news item from the BBC RSS feed using the feedreader integration.

Tuesday, 6 February 2024

Alexa Occupancy sense

Alexa's Occupancy Sense is a feature that enhances the functionality of Echo devices by detecting the presence of individuals in a room without any direct command or action from the user, using built-in sensors and microphones to discern activity and occupancy. 

Occupancy Sense leverages environmental cues such as sound and movement to enable Echo devices to initiate predefined routines or actions based on the detected presence of people. This feature automates various tasks, like adjusting lighting or playing media, without requiring specific verbal commands, making interaction with smart home devices more intuitive.

Device Compatibility

This advanced feature is supported by newer models of Echo devices equipped with the necessary hardware to detect occupancy through sound and motion. Users should refer to the most current information from Amazon to determine if their Echo devices are compatible with Occupancy Sense.

Routines and Cooldown Mechanism

When Alexa routines are automatically executed when occupancy is detected they appears to be a cooldown of about 30 minutes, to avoid excessive triggering of the routines.  This cooldown ensures that automated actions, such as activating lights or music, are not only responsive but also practical and not overly frequent.

Wake Word Triggering and Presence Detection

When you use the wake word for an Alexa device, it assumes someone is there. If you have several Echo devices close to each other, talking to one can accidentally activate another because it "hears" the wake word and thinks someone is in the room. To prevent this, you can set a different wake word for each Alexa device in your house. This way, devices won't mistakenly respond when you're talking to another one, keeping things running smoothly.