Announcement

Collapse
No announcement yet.

Fire tv notifications

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Fire tv notifications

    Hi all,
    just thought I'd hopefully give anyone who uses fire tv stuff something to help with a notification overlay, as there really is not a lot out there for automation.

    You'll get a nice little popup box with text, a small image, and most importantly, it'll pop over anything you are currently running like netflix, etc - best I had before was notices in kodi.

    What's needed:
    Notifications for fire tv app - installed on the fire stick from the amazon app store
    Curl installed on your HS server
    The IP of your fire device
    A small png file (2kb roughly, not too big)

    So, anyone who is interested will need to install the app "notifications for fire tv" on their stick, and run the app, setting it up to allow notifications
    While in the settings of the fire device, get your IP for later reference.

    So, the app works as a basic web listener on the fire device - it's listening on port 7676. Now, it's very dumb, and it will do nothing unless you do a multipart post to it with all the parameters.
    I did try and failed miserably to get vb and powershell to do the multipart form data, hence why Curl is a requirement - but have at it if you want to write something proper, you can see what parameters are needed by just decoding the curl constructed command.

    So, once you have the app installed and curl running, just write some code to send the data needed, changing the last part to the IP of your fire device:
    Code:
    Sub Main(strmsg as string)
    dim poptime as integer = 30
    
    hs.launch("cmd", "/c C:\scripts\curl -v -F type=0 -F title=Notification -F msg=" & chr(34) & strmsg &chr(34)&" -F duration="&poptime&" -F fontsize=0 -F position=0 -F width=0 -F bkgcolor=" & chr(34) & "#607d8b" & chr(34) & " -F transparency=1 -F offset=0 -F offsety=0 -F app=" & chr(34) & "Notifications for fire tv" & chr(34)  & " -F force=true -F filename=@\" & chr(34) & "C:/Scripts/icon.png\"& chr(34)&";filename="&chr(34)&"icon.png"&chr(34)&" http://192.168.x.x:7676","","0")
    End Sub
    In summary of the above - it's got quotes up the wazoo (chr(34)) to ensure the curl command doesn't choke - especially take care of the filename upload part, running curl under cmd process was a pain to get right.
    It's basically doing a post with multipart form data, and you can play around with the values:
    Title = Title of the message
    msg = body of the message
    duration = duration of pop up in seconds
    transparency = 0 =transparent, 1 = solid
    filename = the png file being uploaded.

    Hopefully this will help someone, just now looking if I can get a triggered cam overlay fudged, as my current method is a pi switching the input to its own hdmi port for 30 seconds, then back

    #2
    So I'm looking to move to Fire TV from Kodi. The two main thing keeping me back is:

    1. Notifications - Forward notifcations from HomeSeer to Andorid TV/Fire TV
    * Workaround - Uses 3rd Party App on Fire TV/Android TV:
    https://play.google.com/store/apps/d...cations.google
    and
    https://play.google.com/store/apps/d...cations.google

    * Need method to forward notifications from HS3 to the android devices, like this (Using apps above to receive):
    https://community.openhab.org/t/send...droid-tv/39465
    or
    https://www.home-assistant.io/compon...y.nfandroidtv/

    THANK YOU @Furious. I was typing this up when I found your post

    2. Show Security Cam Popup - Currently not possible as with Kodi. But if I switch to FireTV, I can say "show front door" which will show my Ring doorbell.

    PS - Looks like we may get some enhanced notifications soon via another route:
    https://forums.homeseer.com/forum/ho...home-assistant

    Comment


      #3
      Furious , do you know how to forward all notifications to your VB script? spud's Kodi plugin forwards all TTS announcments to Kodi as text notifications...so basically looking for similar setup.

      Comment


        #4
        Just throwing out a different option.

        When I went to FireTv to install the "notifications for fire tv" app, I noticed an app called 'PushTV'. Reading over the description, it was related to PushOver. Hmm. I currently use the PushOver plugin within HomeSeer to push messages to Android phone and iPhone. Installed this app, did set-up, and kicked off an event in HS. Low and behold, pop-up on FireTv. Done.
        It looks like this app (PushTV) is currently in Beta. It also looks like there maybe an inapp charge for $3 to get unlimited messaging.

        Comment


          #5
          Originally posted by spike5884 View Post
          Just throwing out a different option.

          When I went to FireTv to install the "notifications for fire tv" app, I noticed an app called 'PushTV'. Reading over the description, it was related to PushOver. Hmm. I currently use the PushOver plugin within HomeSeer to push messages to Android phone and iPhone. Installed this app, did set-up, and kicked off an event in HS. Low and behold, pop-up on FireTv. Done.
          It looks like this app (PushTV) is currently in Beta. It also looks like there maybe an inapp charge for $3 to get unlimited messaging.
          Thank you for the suggestion. I tried that app on the Fire TV Cube and could not get it to receive an alert. It did make some noises, but the text box didn't show.

          I think the notifications I need are very timely (motion at front door), and I also noticed a little bit of a delay on phone testing that I might want to stay local (which the other Notifications for Fire TV does, with a local mini webserver it opens for use).

          Comment


            #6
            This looks really cool. Has anyone had any joy in getting additional images displayed?

            The app page on Google Play mentions: "Including application logo and images contained in the notification" and "Notifications with images will be displayed in the popup"

            Comment


              #7
              To answer my own question (well, partially at least) ...

              The latest version of the app allows sharing images from other Android apps, displaying them as notifications on the TV device. This is done through a new "filename2" form part.

              Comment


                #8
                This has been my to do list for a while. I'm away from home at the moment, so can't experiment, but this PushTV looks interesting: https://download.cnet.com/PushTV-Not...-77929750.html
                Looks like it's limited to 15 messages for the free version. But that should be enough to experiment.
                PushOver works very well on my mobile devices. So I'm hoping the same applies to PushTV. And not too laggy. Looks like there is no need to install any services other than a working PushOver account.
                iCore5 Win 10 Pro x64 SSD

                HS3 Pro Edition 3.0.0.435 Windows

                BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                Comment


                  #9
                  So...I have played with PushTV and it works pretty well. Very easy to setup in PushOver. Simply install PushTV on your android tv, sign in to your PushOver account in the TV app. Pushover detects to new client and adds it as a recipent. You can then use the HS PushOver plugin to send notifications to your TV. Very easy.

                  But:
                  1) the trial PushTV app is limited to receiving 15 messages.
                  2) the app functions as 'desktop client' which PushOver requires a license for (USD 4.99), but you get a week free.
                  3) there can be a considerable delay, up to 15 seconds, from sending the message to it appearing on the screen. And it is cloud based so you need an Internet connection.
                  4) at this stage there are no settings for duration, position or transperancy of the popup notification. But the app is in beta and these options may be added in the future.
                  5) the notification sound is intermittant. But I haven't really looked at this as we use an AV receiver. We only get sound from the TV if we use the audio return channel (ARC) on the receiver. So no sound sourced from the TV when using apple TV or PS4 etc.

                  In summary, PushTV is easy to setup but a little laggy. I would say satisfactory for anyone who lacks coding skills (compiling curl commands and writing scripts etc).

                  I'm going to have a play with 'Notifications for Android TV' this afternoon.

                  M

                  iCore5 Win 10 Pro x64 SSD

                  HS3 Pro Edition 3.0.0.435 Windows

                  BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                  Comment


                    #10
                    Furious Did you actually get your script (above) to work? I keep getting formatting errors:
                    Error Compiling script NotifyTest.vb: Comma, ')', or a valid expression continuation expected.
                    Error Compiling script NotifyTest.vb: Type character '&' does not match declared data type 'Integer'.
                    I have installed Notifications for Android TV and can get my mobile phone to send notifications to the Sony TV. But I can't this curl script to work.

                    Are all the field mandatory (fontsize, position, width etc)? What are the minimum fields required to send the notification? I can't seem to find anything on using curl with the notification app.

                    Marty.
                    iCore5 Win 10 Pro x64 SSD

                    HS3 Pro Edition 3.0.0.435 Windows

                    BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                    Comment


                      #11
                      Ok, with all the lovely escaped stuff and formatting, I split it up into something more manageable:
                      Code:
                      Sub Main(parm as string)
                      
                      dim strmsg as string
                      dim poptim as integer = 30
                      dim curlstr as string
                      hs.writelog("Info", "Notification:" & strmsg & " duration:" & poptim)
                      
                      curlstr = "/c C:\scripts\curl -v -F type=0 -F title=Notification -F "
                      curlstr = curlstr & "msg=" & chr(34) & strmsg & chr(34)
                      curlstr = curlstr &" -F duration=" & poptim &" -F "
                      curlstr = curlstr & "fontsize=0 -F position=0 -F width=0 -F "
                      curlstr = curlstr & "bkgcolor="&chr(34)&"#607d8b"&chr(34)&" -F transparency=1 -F "
                      curlstr = curlstr & "offset=0 -F offsety=0 -F app="&chr(34)&"Notifications for fire" 
                      curlstr = curlstr & " tv"&chr(34)&" -F force=true -F filename=@\"&chr(34)
                      curlstr = curlstr & "C:/Scripts/icon.png\"&chr(34)&";filename="&chr(34)
                      curlstr = curlstr & "icon.png"&chr(34)&" http://192.168.x.x:7676"
                      
                      hs.launch("cmd",curlstr,"","0")
                      End Sub
                      So, ensure there's a png file in the c:/scripts/icon.png location, as the app will just not do anything if something is missing.
                      poptim = popup timer in seconds - you can set it to lower.

                      Comment


                        #12
                        Originally posted by AgileHumor View Post
                        Furious , do you know how to forward all notifications to your VB script? spud's Kodi plugin forwards all TTS announcments to Kodi as text notifications...so basically looking for similar setup.
                        Ok, my setup is a bit lazy - the events I care about, I have easytrigger set a device string to what I want to alert.

                        Then, I have an event that is "If this devices string changes then kick off the notification script"
                        My full script polls the string value of this device and sets strmsg to that.

                        So - for my front door:
                        If doorbell device is set on, or motion is triggered, or front cam motion triggered
                        Then
                        <play notification sound>
                        Set virtual notification devices string to "Someone at the front door"

                        <Alerting event>
                        If virtual notification device string changes then
                        Run script

                        Comment


                          #13
                          Do you have to have the Premium version of "Notifications for Fire TV" to get this to work? I have the free app on my phone and I can send messages to the fireTV cube in my office. It wasn't working from the script so I had the script write the command line to the HS log. I then opened a command window and put that string into command prompt and ran it. I get a message that it has connected. Then it says "Expect 100-Continue" Then it gives the message "Done waiting for 100-Continue".
                          --
                          Jeff Farmer
                          HS 3, HSPhone
                          My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
                          Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

                          Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

                          Comment


                            #14
                            So, the server component is just basic - pops up a notification, small picture, text, and a few other things like transparency, sound, etc. The premium stuff just unlocks the client app so you can push as many notifications as you want - you do NOT need the premium part.

                            Problem is it's *really* finicky - spent most of the time reverse engineering the raw post data to work out everything needed and working out what was needed - apparently all parameters are expected or nothing happens.

                            See above more expanded script - you'll need to have a placeholder png file present to upload even if you don't want it.

                            I did look into creating my own app using the SDK, but it was not fun. I got as far as having a basic http parser, but the whole fighting the OS to get something to pop over the top of everything was just too painful and there's not enough examples out there to crib from.

                            Comment


                              #15
                              Ok, so you guys who have webcams which don't have amazon integration - I've a potential way for you to flick to a feed for a device based on a HS trigger.

                              This uses ADB, so install ADB using this link

                              You'll also need a webcam that has a rtsp published feed. Http will not work. Sorry about that, you could try using a webcam viewer instead, not tried that yet.

                              So, instructions:

                              Enable ADB in the developers option on the fire stick. Also, highly recommended that you give your firestick a static IP via reservation or by just manually setting the connection up on the fire TV.

                              Next up - install a movie player. If you don't use VLC, then install that as it's the fastest to render the webcam view. If you do use VLC (like myself), install the Archos video viewer.
                              The reason for this? Well, if you're watching a movie with your normal video player and it switches to the webcam view, you won't have anything to go back to.

                              Once you've installed your movie player, run it and grant it access to media.

                              Ok, so next part - create a batch file which has the following:
                              Code:
                              C:\scripts\adb\adb connect 192.168.1.xxx
                              C:\scripts\adb\adb -s 192.168.1.xxx:5555 shell am start -a android.intent.action.VIEW -d rtsp://admin: Password@192.168.1.yyy:554//h264Preview_01_main
                              timeout 45
                              C:\scripts\adb\adb -s 192.168.1.xxx:5555 shell am force-stop com.archos.mediacenter.videofree
                              exit
                              Change the c:\scripts\adb directory to the location where you've dumped ADB into
                              Change the xxx to the IP address of your fire device
                              Change the yyy to the IP address of your webcam
                              Change the timeout to whatever you want

                              NOTE: the above is assuming it's kicked off archos to play the stream and is killing the process after 45 seconds. If you're using vlc, change the force-stop line to the process org.videolan.vlc.debug

                              So two things of note here - firstly, why connect to a specific instance with ADB?
                              When you run ADB, it creates a process locally. First time you connect with ADB, it adds 3 seconds while it loads this. We want it to stay loaded to stop that delay.

                              Secondly, If you have more than one device, like myself, if you DON'T specify the device, you'll find that it will error with an unrecognised device. The device name when you're connecting via network will be the IP: port

                              Run the batch file.
                              What should happen is that it connects and you get a popup on the fire device - click it to allow the device to connect.
                              Then, it should popup "which player do you want to use to play this stream" - click on the one you want, then click on always. So, in future, the prompt doesn't get in the way and the stream kicks in.

                              Create an event which calls your batch file. Hey presto, once triggered, it'll switch to your webcam feed for x seconds, close it, and your viewing will be paused to where you left off

                              Comment

                              Working...
                              X