Code Monkey home page Code Monkey logo

netdaemon-epg's Introduction

netdaemon-epg

EPG TV program guide for Homeassistant using NetDaemon

Provides homeassistant sensors for current tv show based on https://www.hoerzu.de/text/tv-programm/sender.php or https://tv.orf.at/. You can even use your own data provider by implementing the IDataProviderService. Please have a look at the SampleDataProviderService.

Config

epg:
  class: Mutzl.Homeassistant.Epg
  refreshrate_in_seconds: 10
  data_providers:
    - fullname: "Mutzl.Homeassistant.OrfDataProviderService"
      stations:
        - "ORF 1"
        - "ORF 2"
        - "ORF 3"
      refresh_times:
        - "06:15"
        - "9:15"
        - "15:15"
        - "19:15"
        - "20:05"
        - "21:05"
        - "22:05"
        - "23:15"
        - "00:15"
    - fullname: "Mutzl.Homeassistant.HoerzuDataProviderService"
      stations:
        - "ORF 1"
        - "ORF 2"
        - "ORF 3"
    - fullname: "Mutzl.Homeassistant.SampleDataProviderService"
      stations:
        - "TV One"
   

For every station in every data provider you will find a sensor will be created with the following naming pattern: sensor.epg_[dataprovider]_[station].

The sensors provide also attributes like BeginTime and Duration, which can be the basis for building a clientside progressbar for the current TV show. Another attribute contains the title of the upcoming show.

It is recommended, to disable the recording for those sensors, as it doesn't make much sense to keep history of all the tv guides. Especially since the description could become quite large.

recorder:
  exclude:
    entity_globs:
      - sensor.epg_*

Using a markdown card, you can get a nice visual representation of the current show - maybe within a popup of the browser-mod

Internals

The integration reads the epg data for the current and the next day at startup and then once every day at 6:30am (to minimize the load on the 3rd party server). In case your data provider changes more often than once in a day, you can also configure more refresh times. It's also possible to refresh the epg data manually by calling the service netdaemon.epg_refreshepgdata.

Based on this data, it calculates what's currently on TV using the current (local) time of your homeassistant installation and updates the sensors sensor.epg_[dataprovider]_[station] whenever a new tv show starts according to this already downloaded data.

The description of the TV show is only read from the data source whenever a current show changes.

netdaemon-epg's People

Contributors

mutzl avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

netdaemon-epg's Issues

Can not start addon

Hi @mutzl ,

i never used netdaemon, but I would like to use an epg in home assistant and it looks like your epg is the only one out there.

I installed the net deamon 3 add on supervisor addon store, but it looks like I am doing anything wrong.

My file structure: /config/netdaemon3/netdaemon-epg-main

  • Common
  • Epg
  • READMY.md

[00:33:27] WARNING: No MQTT add-on installed, MQTT features will not work.
[00:33:27] INFO: Starting NetDaemon V3 Runtime ...
[00:33:41 ERR] NetDaemon.AppModel.Internal.Compiler.Compiler: Failed to compile applications
/config/netdaemon3/netdaemon-epg-main/Epg/AppLogger.cs(1,17): error CS0234: The type or namespace name 'Common' does not exist in the namespace 'NetDaemon' (are you missing an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(1,17): error CS0234: The type or namespace name 'Common' does not exist in the namespace 'NetDaemon' (are you missing an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(2,17): error CS0234: The type or namespace name 'Common' does not exist in the namespace 'NetDaemon' (are you missing an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/StationGuide.cs(1,17): error CS0234: The type or namespace name 'Common' does not exist in the namespace 'NetDaemon' (are you missing an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(10,24): error CS0246: The type or namespace name 'NetDaemonRxApp' could not be found (are you missing a using directive or an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/StationGuide.cs(15,26): error CS0246: The type or namespace name 'NetDaemonRxApp' could not be found (are you missing a using directive or an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/StationGuide.cs(24,29): error CS0246: The type or namespace name 'NetDaemonRxApp' could not be found (are you missing a using directive or an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/AppLogger.cs(11,17): error CS0246: The type or namespace name 'NetDaemonRxApp' could not be found (are you missing a using directive or an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/AppLogger.cs(13,26): error CS0246: The type or namespace name 'NetDaemonRxApp' could not be found (are you missing a using directive or an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(87,10): error CS0246: The type or namespace name 'HomeAssistantServiceCallAttribute' could not be found (are you missing a using directive or an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(87,10): error CS0246: The type or namespace name 'HomeAssistantServiceCall' could not be found (are you missing a using directive or an assembly reference?)
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(21,36): error CS0115: 'Epg.InitializeAsync()': no suitable method found to override
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(26,17): error CS0103: The name 'LogError' does not exist in the current context
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(34,21): error CS0103: The name 'LogError' does not exist in the current context
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(40,21): error CS0103: The name 'LogError' does not exist in the current context
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(48,21): error CS0103: The name 'LogError' does not exist in the current context
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(54,56): error CS1503: Argument 1: cannot convert from 'Mutzl.Homeassistant.Epg' to 'NetDaemonRxApp'
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(58,21): error CS0103: The name 'Log' does not exist in the current context
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(62,13): error CS0103: The name 'Log' does not exist in the current context
/config/netdaemon3/netdaemon-epg-main/Epg/Epg.cs(96,13): error CS0103: The name 'Log' does not exist in the current context

Failed to start host... System.InvalidOperationException: Operation is not valid due to the current state of the object.
at NetDaemon.AppModel.Internal.Compiler.Compiler.Compile() in /usr/src/AppModel/NetDaemon.AppModel/Internal/Compiler/Compiler.cs:line 60
at NetDaemon.AppModel.Internal.AppAssemblyProviders.DynamicallyCompiledAppAssemblyProvider.GetAppAssembly() in /usr/src/AppModel/NetDaemon.AppModel/Internal/AppAssemblyProviders/DynamicallyCompiledAppAssemblyProvider.cs:line 24
at NetDaemon.AppModel.ServiceCollectionExtensions.AddAppsFromSource(IServiceCollection services, Boolean useDebug) in /usr/src/AppModel/NetDaemon.AppModel/Common/Extensions/ServiceCollectionExtension.cs:line 89
at Program.<>c.<

$>b__0_0(HostBuilderContext _, IServiceCollection services) in /usr/src/Host/NetDaemon.Host.Default/Program.cs:line 26
at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at Program.$(String[] args) in /usr/src/Host/NetDaemon.Host.Default/Program.cs:line 19
Unhandled exception. System.InvalidOperationException: Operation is not valid due to the current state of the object.
at NetDaemon.AppModel.Internal.Compiler.Compiler.Compile() in /usr/src/AppModel/NetDaemon.AppModel/Internal/Compiler/Compiler.cs:line 60
at NetDaemon.AppModel.Internal.AppAssemblyProviders.DynamicallyCompiledAppAssemblyProvider.GetAppAssembly() in /usr/src/AppModel/NetDaemon.AppModel/Internal/AppAssemblyProviders/DynamicallyCompiledAppAssemblyProvider.cs:line 24
at NetDaemon.AppModel.ServiceCollectionExtensions.AddAppsFromSource(IServiceCollection services, Boolean useDebug) in /usr/src/AppModel/NetDaemon.AppModel/Common/Extensions/ServiceCollectionExtension.cs:line 89
at Program.<>c.<$>b__0_0(HostBuilderContext _, IServiceCollection services) in /usr/src/Host/NetDaemon.Host.Default/Program.cs:line 26
at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at Program.$(String[] args) in /usr/src/Host/NetDaemon.Host.Default/Program.cs:line 19
at Program.(String[] args)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.