DouweM / pixbyt

Pixbyt is a self-hosted Tidbyt app server for advanced apps that aren't supported by the official community app server that you can access through Tidbyt's mobile app.
https://pixbyt.dev
MIT License
93 stars 10 forks source link

Document how to use with multiple Tidbyts #3

Closed DouweM closed 6 months ago

DouweM commented 1 year ago

Example .env:

LIVING_TIDBYT_DEVICE_ID="<device id>"
LIVING_TIDBYT_TOKEN="<token>"

OFFICE_TIDBYT_DEVICE_ID="<device id>"
OFFICE_TIDBYT_TOKEN="<token>"

Example apps.yml:

plugins:
  loaders:
  - name: target-tidbyt--living
    inherit_from: target-tidbyt
    config:
      device_id: $LIVING_TIDBYT_DEVICE_ID
      token: $LIVING_TIDBYT_TOKEN
  - name: target-tidbyt--office
    inherit_from: target-tidbyt
    config:
      device_id: $OFFICE_TIDBYT_DEVICE_ID
      token: $OFFICE_TIDBYT_TOKEN

jobs:
# Living
- name: living/revolution
  tasks: [tap-pixlet--revolution target-tidbyt--living]

# Office
- name: office/revolution
  tasks: [tap-pixlet--revolution target-tidbyt--office]

schedules:
# Every minute
- name: living/revolution
  interval: '* * * * *'
  job: living/revolution

- name: office/revolution
  interval: '* * * * *'
  job: office/revolution
EricWF commented 12 months ago

Is this actual documentation of how it currently works? Or is this a suggestion about how it should work?

EDIT: This is how it currently works! Thank you! This issue was very helpful!. EDIT 2: I have run into undiagnosable issues since changing to a config which looks like this. There may be bugs.

DouweM commented 6 months ago

@EricWF This is my actual apps.yml:

plugins:
  loaders:
  - name: target-tidbyt--living
    inherit_from: target-tidbyt
    config:
      device_id: $LIVING_TIDBYT_DEVICE_ID
      token: $LIVING_TIDBYT_TOKEN
  - name: target-tidbyt--office
    inherit_from: target-tidbyt
    config:
      device_id: $OFFICE_TIDBYT_DEVICE_ID
      token: $OFFICE_TIDBYT_TOKEN

jobs:
# Living
- name: living/apple-tv
  tasks: [tap-pixlet--apple-tv target-tidbyt--living]
- name: living/plex
  tasks: [tap-pixlet--plex target-tidbyt--living]
- name: living/revolution
  tasks: [tap-pixlet--revolution target-tidbyt--living]
- name: living/common-misconceptions
  tasks: [tap-pixlet--common-misconceptions target-tidbyt--living]
- name: living/crossword
  tasks: [tap-pixlet--crossword target-tidbyt--living]
- name: living/jeopardy
  tasks: [tap-pixlet--jeopardy target-tidbyt--living]
- name: living/guess-the-flag
  tasks: [tap-pixlet--guess-the-flag target-tidbyt--living]
- name: living/ffmpeg
  tasks: [tap-pixlet--ffmpeg target-tidbyt--living]
- name: living/homebridge-unifi
  tasks: [tap-pixlet--homebridge-unifi target-tidbyt--living]
- name: living/homebridge-unifi--avatars
  tasks: [tap-pixlet--homebridge-unifi--avatars target-tidbyt--living]
- name: living/parcelapp
  tasks: [tap-pixlet--parcelapp target-tidbyt--living]
- name: living/owen-wilson-facts
  tasks: [tap-pixlet--owen-wilson-facts target-tidbyt--living]
- name: living/wedding
  tasks: [tap-pixlet--wedding target-tidbyt--living]
- name: living/dadjoke
  tasks: [tap-pixlet--dadjoke target-tidbyt--living]

# Office
- name: office/revolution
  tasks: [tap-pixlet--revolution target-tidbyt--office]
- name: office/common-misconceptions
  tasks: [tap-pixlet--common-misconceptions target-tidbyt--office]
- name: office/crossword
  tasks: [tap-pixlet--crossword target-tidbyt--office]
- name: office/jeopardy
  tasks: [tap-pixlet--jeopardy target-tidbyt--office]
- name: office/guess-the-flag
  tasks: [tap-pixlet--guess-the-flag target-tidbyt--office]
- name: office/ffmpeg
  tasks: [tap-pixlet--ffmpeg target-tidbyt--office]
- name: office/homebridge-unifi
  tasks: [tap-pixlet--homebridge-unifi target-tidbyt--office]
- name: office/homebridge-unifi--avatars
  tasks: [tap-pixlet--homebridge-unifi--avatars target-tidbyt--office]
- name: office/parcelapp
  tasks: [tap-pixlet--parcelapp target-tidbyt--office]
- name: office/owen-wilson-facts
  tasks: [tap-pixlet--owen-wilson-facts target-tidbyt--office]
- name: office/speedtest
  tasks: [tap-pixlet--speedtest target-tidbyt--office]
- name: office/wedding
  tasks: [tap-pixlet--wedding target-tidbyt--office]
- name: office/dadjoke
  tasks: [tap-pixlet--dadjoke target-tidbyt--office]

schedules:
# Every minute
- name: living/revolution
  interval: '* * * * *'
  job: living/revolution

- name: office/revolution
  interval: '* * * * *'
  job: office/revolution

# Every 5 minutes
- name: living/apple-tv
  interval: '*/5 * * * *'
  job: living/apple-tv

- name: living/plex
  interval: '*/5 * * * *'
  job: living/plex

- name: living/common-misconceptions
  interval: '*/5 * * * *'
  job: living/common-misconceptions

- name: office/common-misconceptions
  interval: '*/5 * * * *'
  job: office/common-misconceptions

- name: living/crossword
  interval: '*/5 * * * *'
  job: living/crossword

- name: office/crossword
  interval: '*/5 * * * *'
  job: office/crossword

- name: living/jeopardy
  interval: '*/5 * * * *'
  job: living/jeopardy

- name: office/jeopardy
  interval: '*/5 * * * *'
  job: office/jeopardy

- name: living/guess-the-flag
  interval: '*/5 * * * *'
  job: living/guess-the-flag

- name: office/guess-the-flag
  interval: '*/5 * * * *'
  job: office/guess-the-flag

- name: living/dadjoke
  interval: '*/5 * * * *'
  job: living/dadjoke

- name: office/dadjoke
  interval: '*/5 * * * *'
  job: office/dadjoke

# - name: living/ffmpeg
#   interval: '*/5 * * * *'
#   job: living/ffmpeg

# - name: office/ffmpeg
#   interval: '*/5 * * * *'
#   job: office/ffmpeg

- name: living/homebridge-unifi
  interval: '*/5 * * * *'
  job: living/homebridge-unifi

- name: office/homebridge-unifi
  interval: '*/5 * * * *'
  job: office/homebridge-unifi

- name: living/homebridge-unifi--avatars
  interval: '*/5 * * * *'
  job: living/homebridge-unifi--avatars

- name: office/homebridge-unifi--avatars
  interval: '*/5 * * * *'
  job: office/homebridge-unifi--avatars

# Every 15 minutes
- name: living/parcelapp
  interval: '*/15 * * * *'
  job: living/parcelapp

- name: office/parcelapp
  interval: '*/15 * * * *'
  job: office/parcelapp

# Every hour
- name: living/owen-wilson-facts
  interval: '0 * * * *'
  job: living/owen-wilson-facts

- name: office/owen-wilson-facts
  interval: '0 * * * *'
  job: office/owen-wilson-facts

- name: office/speedtest
  interval: '0 * * * *'
  job: office/speedtest

- name: living/wedding
  interval: '0 * * * *'
  job: living/wedding

- name: office/wedding
  interval: '0 * * * *'
  job: office/wedding

It's been working, but I've also been facing https://github.com/DouweM/pixbyt/issues/12 which may or may not be related.

If you're having problems with that setup, please file issues!