Coder Social home page Coder Social logo

dominiczedler / snips-wecker Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 2.0 908 KB

An app for Snips.ai with a fully controllable alarm clock :alarm_clock:

Home Page: https://console.snips.ai/store/de/skill_61Vz8lVkXQbM

Python 98.50% Shell 1.50%
alarm-clock multi-room snips snips-app snips-skill

snips-wecker's People

Contributors

dominiczedler avatar

Forkers

sbeeck kleintody

snips-wecker's Issues

add text to reminder

This would be super useful, especially when multiple alarms are running. The text / topic / description or whatever it's called could then somehow be mentioned along with the alarm.

Hey Snips, remind me in 10 minutes to take the pizza out
Hey Snips, remind me about washing tomorrow
Hey Snips, in 5 minutes my tea will be ready
Hey Snips, remind me to pick up a package at 15:00

mqtt topic external/alarmclock/out/ringing missing

Hey, i´m trying to detect if snips has started ringing, and according to this page, this can be done by subscribing on external/alarmclock/out/ringing via mqtt. The Problem is that my mqtt server, which is connected and subscribed on all topics, isn´t picking up that topic. Have you not added this yet or is it an error on my side. (Packet size is at 2048 btw)

wecker im app-store: probleme beim testen

zwei probleme fielen gleich zu anfang auf, nachdem ich die app in meinem assistenten installiert habe (wobei ich mir nicht sicher bin, ob das erste eventuell gar kein problem ist): die permissions für

/var/lib/snips/skills/Snips-Wecker/.saved_alarms.json
/var/lib/snips/skills/Snips-Wecker/.temporary_ringtone

scheinen nicht zu funktionieren.

(venv) pi@ivanka:/var/lib/snips/skills/Snips-Wecker $ ./action-domi-Wecker.py 
Traceback (most recent call last):
  File "./action-domi-Wecker.py", line 114, in <module>
    alarmclock = AlarmClock(config)
  File "/var/lib/snips/skills/Snips-Wecker/alarmclock/alarmclock.py", line 20, in __init__
    self.ringtone_wav = utils.edit_volume("alarm-sound.wav", self.config['ringing_volume'])
  File "/var/lib/snips/skills/Snips-Wecker/alarmclock/utils.py", line 113, in edit_volume
    wav_file = open(".temporary_ringtone", "r+w")
IOError: [Errno 13] Permission denied: '.temporary_ringtone'

nachdem ich die auf 777 gesetzt habe, antwortete mir der wecker. der fehler kann aber auch daran liegen, dass ich die action als user pi aufgerufen habe und das ownership (eigentlich korrekt) auf _snips-skills gesetzt war.

das andere problem: egal ob ich die config.ini in

/usr/share/snips/assistant/snippets/domi.Alarme_&_Wecker/config.ini

oder

/var/lib/snips/skills/Snips-Wecker/config.ini

oder

/var/lib/snips/skills/Snips-Wecker/config.ini.default

ändere, alle werte werden nach einem

sam update-assistant wieder auf die default-werte zurückgesetzt.

der einzige weg wie ich den wecker zum laufen bringen konnte war die

/var/lib/snips/skills/Snips-Wecker/config.ini

an meinen multiroom-setup anzupassen und dann den snips skill-server neuzustarten. dann bekam ich antworten auf meine eingaben.

[global]
ringing_volume=50
ringing_timeout=30s
dict_site-id=Küche:ivanka, Kinderzimmer:ivan
default_room=Küche
restore_alarms=yes
ringtone_status=on
snooze_config=state:off
[secret]

aber der multiroom setup funktioniert nicht, wenn ich einen raum nenne, schafft die action nicht den raum aufzulösen:

(venv) pi@ivanka:/var/lib/snips/skills/Snips-Wecker $ ./action-domi-Wecker.py 
Traceback (most recent call last):
  File "./action-domi-Wecker.py", line 121, in <module>
    mqtt_client.loop_forever()
  File "/var/lib/snips/skills/Snips-Wecker/venv/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1578, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/var/lib/snips/skills/Snips-Wecker/venv/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1072, in loop
    rc = self.loop_read(max_packets)
  File "/var/lib/snips/skills/Snips-Wecker/venv/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1374, in loop_read
    rc = self._packet_read()
  File "/var/lib/snips/skills/Snips-Wecker/venv/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2071, in _packet_read
    rc = self._packet_handle()
  File "/var/lib/snips/skills/Snips-Wecker/venv/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2560, in _packet_handle
    return self._handle_publish()
  File "/var/lib/snips/skills/Snips-Wecker/venv/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2759, in _handle_publish
    self._handle_on_message(message)
  File "/var/lib/snips/skills/Snips-Wecker/venv/local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2902, in _handle_on_message
    callback(self, self._userdata, message)
  File "./action-domi-Wecker.py", line 52, in on_message_intent
    say(session_id, alarmclock.new_alarm(slots, data['siteId']))
  File "/var/lib/snips/skills/Snips-Wecker/alarmclock/alarmclock.py", line 79, in new_alarm
    room_slot = slots['room']['value'].encode('utf8')
TypeError: string indices must be integers

was allerdings geht: „stelle einen wecker auf 9:30 uhr“ legt einen wecker im default-raum (siteId ivanka) an.

das löschen von alarmen geht wiederrum nicht, weil sich snips in die antwort auf „sicher?“ reinquatscht. das protokolliert sam watch:

[09:28:56] [Asr] was asked to listen on site ivanka
[09:28:59] [Asr] captured text "lösche alle alarme" in 2.0s
[09:28:59] [Asr] was asked to stop listening on site ivanka
[09:28:59] [Nlu] was asked to parse input "lösche alle alarme"
[09:28:59] [Nlu] detected intent domi:deleteAlarms with probability 0.958 for input "lösche alle alarme"
[09:28:59] [Dialogue] New intent detected domi:deleteAlarms with probability 0.958
[09:28:59] [Dialogue] was ask to continue session with id dddd936c-2895-4d4e-89db-89da236ecd0c by saying 'Es gibt 3 Alarme. Bist du dir sicher?'
[09:28:59] [Asr] was asked to stop listening on site ivanka
[09:28:59] [Hotword] was asked to toggle itself 'off' on site ivanka
[09:28:59] [Tts] was asked to say "Es gibt 3 Alarme. Bist du dir sicher?"
[09:28:59] [AudioServer] was asked to play a wav of 114.8 kB with id 'U7L70KP4FHJ2NOHT' on site ivanka
[09:28:59] [Tts] finished speaking with id 'ccc75060-f14c-43c6-a381-597458503e4f'
[09:28:59] [Asr] was asked to listen on site ivanka
[09:29:02] [Asr] captured text "es gegen drei alarme" in 2.0s
[09:29:02] [Asr] was asked to stop listening on site ivanka
[09:29:02] [Nlu] was asked to parse input "es gegen drei alarme"
[09:29:02] [Nlu] intent not recognized for "es gegen drei alarme"
[09:29:02] [Dialogue] session with id 'dddd936c-2895-4d4e-89db-89da236ecd0c' was ended on site ivanka. The session was ended because the platform didn't understand the user

was natürlich auch schön wäre, wenn man den skill forken könnte. vorbereitet hast du das ja schon, mit deiner USERNAME_INTENTS konstante.

letzte anmerkung: wenn der alarm klingelt wird der ringtone sehr schnell hintereinander abgespielt. pausen zwischen den einzelnen ringtones würden es einfacher machen das hotword zu erkennen. währen der alarm spielt erkennt snips das hotword schwer (ausser man schreit).

Errors upon installation

Clean installation of raspbian stretch lite (kernel 4.14.) and sam install assistant will show:

Running setup.sh & generating virtual environment for Snips-Wecker
✖ Error setting up virtualenv, one or more actions might not be able to run. Reason :
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified

And it seems like the app is not correctly working. I see that the NLU understands it correctly, but the intent is not detected:

Aug 13 19:45:54 snipsbase snips-asr[12735]: INFO:snips_asr_lib::asr        : decoded: [Recognition { decoded_string: "kannst du mir sagen wann der nächste alarm klingelt", likelihood: 0.9965258, tokens: Some([Token { value: "kannst", confidence: 1.0, time: (0.0, 0.81), range: 0..6 }, Token { value: "du", confidence: 1.0, time: (0.81, 0.96), range: 7..9 }, Token { value: "mir", confidence: 1.0, time: (0.96, 1.11), range: 10..13 }, Token { value: "sagen", confidence: 1.0, time: (1.11, 1.65), range: 14..19 }, Token { value: "wann", confidence: 1.0, time: (1.65, 1.74), range: 20..24 }, Token { value: "der", confidence: 0.9691636, time: (1.7446254, 1.92), range: 25..28 }, Token { value: "nächste", confidence: 1.0, time: (1.92, 2.28), range: 29..36 }, Token { value: "alarm", confidence: 1.0, time: (2.28, 3.03), range: 37..42 }, Token { value: "klingelt", confidence: 1.0, time: (3.03, 3.99), range: 43..51 }]) }]
Aug 13 19:45:54 snipsbase snips-asr[12735]: INFO:snips_asr_hermes::handler : Publishing the recognition
Aug 13 19:45:54 snipsbase snips-asr[12735]: INFO:snips_asr_hermes::handler : Preparing decoder
Aug 13 19:45:54 snipsbase snips-audio-server[12739]: INFO:snips_audio_portaudio      : Playing "6e1fd968-4de7-47d1-b104-5fcb91168ef2" using output "default", wav spec: WavSpec { channels: 1, sample_rate: 44100, bits_per_sample: 16, sample_format: Int }
Aug 13 19:45:55 snipsbase snips-audio-server[12739]: INFO:snips_audio_portaudio      : Playing of "6e1fd968-4de7-47d1-b104-5fcb91168ef2" finished
Aug 13 19:45:55 snipsbase snips-tts[12740]: INFO:snips_tts_hermes: Received a play finished message from audio server with an unknown id '6e1fd968-4de7-47d1-b104-5fcb91168ef2'. Ignoring it.
Aug 13 19:46:00 snipsbase snips-dialogue[12731]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [1c22d4d2-289a-4d6a-823d-3d10687aa5c7]: closing session which was active: Timeout
Aug 13 19:46:00 snipsbase snips-dialogue[12731]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn on Hotword
Aug 13 19:46:00 snipsbase snips-hotword[12726]: INFO:snips_hotword_lib::audio    : Audio thread for site default started.

Snips misunderstands time

Problem

Input: "wecke mich in fünf tagen"
Output: "Der Wecker wird in 5 Stunden und 37 Minuten um 0 Uhr hier klingeln."

sending alarms with mqtt

Hi JohnZoidberg,
I'm using snips with node-red and want to use my calendar entries to be waked up by snips. I'd like to send alarms directly via mqtt.

So my question:
can I send new alarms via mqtt to your app?
I tried:
topic: external/alarmclock/out/newAlarm
payload: {new:{"datetime": "2019-12-17 18:18", "siteid": "Schlafzimmer"}}

may you help me
sincerly
Kay Koch

Pause between ringtones too short

Problem:

The pause between the single ringtones is too short to be able to say the hotword correctly.

Solution:

Increase pause between ringtones.

MQTT nur auf localhost?

Bei Multi-Room-Installationen mit einem zentralen MQTT-Broker kommt die MQTT-Verbindung nicht zustande, weil diese in alarmclock/alarmclock.py, Zeile 26 hart auf localhost gesetzt ist.

Könnte man stattdessen nicht die Verbindungsdaten aus /etc/snips.toml benutzen?
Code-Beispiel siehe: SnipsConfig in koenvervloesem/snipskit.

how long until ...?

I would like to query the alarms in relative time like this:

Hey Snips, how long to the next alarm
-> "the next alarm will be in 11 minutes" (or similar)

I often know when an alarm will go off (at 15:00 for example), but I don't care for the wall clock time, just for the duration left until I need to take some action. So the reply "11 minutes" sometimes makes more sense than "at 15:00" - "what time is it?" - "14:49" - aha 11 minutes, I still have time to do a short task in the meantime.

action domi-Wecker failed 3 times in the last 10 seconds, disabling it

Hallo, vielen Dank für deine coole App!

Ich habe die App über sam install skills zu meinem Assistenten hinzugefügt. Nun habe ich meine App modifiziert habe und wieder sam install skills ausgeführt. Seitdem bekomme ich diese Felhlermeldung:

Mar 11 11:26:15 snips snips-skill-server[15607]: INFO:snips_skill_server_lib::runner : [domi-Wecker][err] Traceback (most recent call last): Mar 11 11:26:15 snips snips-skill-server[15607]: INFO:snips_skill_server_lib::runner : [domi-Wecker][err] File "./action-domi-Wecker.py", line 118, in <module> Mar 11 11:26:15 snips snips-skill-server[15607]: INFO:snips_skill_server_lib::runner : [domi-Wecker][err] alarmclock = AlarmClock(config) Mar 11 11:26:15 snips snips-skill-server[15607]: INFO:snips_skill_server_lib::runner : [domi-Wecker][err] File "/var/lib/snips/skills/Snips-Wecker/alarmclock/alarmclock.py", line 22, in __init__ Mar 11 11:26:15 snips snips-skill-server[15607]: INFO:snips_skill_server_lib::runner : [domi-Wecker][err] self.dict_siteids = self.config['dict_site-id'] Mar 11 11:26:15 snips snips-skill-server[15607]: INFO:snips_skill_server_lib::runner : [domi-Wecker][err] KeyError: 'dict_site-id' Mar 11 11:26:15 snips snips-skill-server[15607]: WARN:snips_skill_server_lib::handler::nosandbox: child domi-Wecker has stopped with status exit code: 1 Mar 11 11:26:15 snips snips-skill-server[15607]: ERROR:snips_skill_server_lib::runner : action domi-Wecker failed 3 times in the last 10 seconds, disabling it

Meine App kann ich als Fehlerquelle weitgehend ausschließen, da ich alle Änderungen wieder rückgängig gemacht habe, der Fehler aber trotzdem bleibt.

Missing dependencys

OS: Raspbian stretch lite

The command is recognised. domi:newAlarm or domi:geAlarms is recognised but then i get the error:"The session was ended because one of the component didn't respond in a timely manner"

I figured out the following dependencys are missing:

  • paho-mqtt -> installer said it installed it, but after executing the action-domi-wecker.py the errors said import paho.mqtt.client as mqtt ImportError No module named paho.mqtt.client. pip install paho-mqtt solved the problem.
  • pydub -> pip install pydub
  • alarmclock.py wanted ffmpeg or avconv -> apt-get install ffmpeg

sadly i still get the "...didn't respond in a timely manner" error.

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.