Open felix-schreib opened 3 years ago
Hi! Thanks for creating an issue.
I spent some time on this before and couldn't get into work without without some big changes. Would it be a problem for you it was implemented outside of the Windows 10 notification center?
As a workaround I just came up with a customcommand
msg * "Hello World"
This basically accomplishes what I want, but the notification itself doesn`t "look" that nice so I thought the notification center would be nice.
But if that is a big effort its definitely not a big issue to have it in some other way or outside of the notification center.
I haven't gotten around to it, but I did wonder if this could be done with a combination of customcommand and AutoHotKey https://www.autohotkey.com/docs/commands/TrayTip.htm
As a workaround I just came up with a customcommand msg * "Hello World"
That's actually pretty cool!
@vidvisionify I'm not sure if AutoHotKey can be called from the outside but it would be a nice workaround.
As an addendum to this, it would be great if you could selectively set persistent notifications and/or always-on-top. My personal use case is that my wife and I share an office. I'd like to install this on both of our machines and have a small persistent notification when she's in a meeting and/or headphones are in use.
I could see others using something like this to create some kind of small monitoring dashboard.
As an addendum to this, it would be great if you could selectively set persistent notifications and/or always-on-top. My personal use case is that my wife and I share an office. I'd like to install this on both of our machines and have a small persistent notification when she's in a meeting and/or headphones are in use.
I could see others using something like this to create some kind of small monitoring dashboard.
My solution to this was to create an automation that captures the current status of a light in a scene and then change that light to red while my webcam is on and restore the scene when my camera turns off. In my case its just one of the ceiling lights in the corner of the room. It works great as an "ON AIR" for anyone else. And the scenes help put everything back when I am done.
I use the same method to set my lighting correct for meetings while my camera is on. Such as my nano lights being too bright behind me. It then restores once my webcam is turned off.
This would be an incredibly useful feature. My use case would be a little different. Sometimes my wife is trying to get a hold of me and I have my headphones on and don't look at my phone. A windows notifications would be awesome. Or even notifications in general - like someone at the door.
we have a home theater pc running windows and I see 2 use cases around our children watching stuff there. both would need some kind of overlay. "it is 9 o'clock, please turn off!" or "you used up your watchtime, please turn off"
it would need to be floating over the browser (youtube/netflix/...) obviously.
There is a module in powershell called Burnt-Toast that does windows notifications easily... Once powershell commands are supported, you could do something with that
I haven't gotten around to it, but I did wonder if this could be done with a combination of customcommand and AutoHotKey https://www.autohotkey.com/docs/commands/TrayTip.htm
This will show a balloon system tray tip notification for three seconds that disappears, but this will not retain the message in the Windows action center or allow for images in the balloon tray tip. This also won't queue messages properly, so tray tips fired in succession while one is open may be lost (haven't quite figured that one out yet). This also only shows messages you've prewritten in the autohotkey script, so isn't good for dynamic values. This is good to say something is off or on or was triggered.
TrayTip,Home Assistant,Front Door Open, 3, 17
Sleep 3000 ; Let it display for 3 seconds.
HideTrayTip()
; Copy this function into your script to use it.
HideTrayTip() {
TrayTip ; Attempt to hide it the normal way.
if SubStr(A_OSVersion,1,3) = "10." {
Menu Tray, NoIcon
Sleep 200 ; It may be necessary to adjust this sleep.
Menu Tray, Icon
}
}
17
to the sum of the decimal values outlined here (see Options).In HAS Workstation Service, I added a command with type CustomCommand
and gave it a name (ex: Front Door Traytip). I have autohotkey installed (not portable version). My Command
field is the path to the Autohotkey script in quotes, ex:
"C:\Users\hwslover\Documents\AHK Scripts\frontdoortraytip.ahk"
Ensure your Windows 10 Settings has Notifications for apps Enabled. If playing a game or watching a video, you may not get notifications unless you disabled some stuff in Windows 10 "Focus Assist" Settings - I had to disable all of the "Focus Assist" toggles.
In HAS, I create an automation with a service of switch: toggle
that calls my above switch on whatever condition trigger I want (ex: front door sensor activity.)
(Optional) Add a Hass Workstation Service sensor of SessionStateSensor
, and have an additional condition of the above Automation check to make sure that sensor is InUse
. This is so your Home Assistant MQTT Broker isn't sending MQTT messages to an offline Windows computer (not sure if undelivered messages would otherwise fill up your HAS log with errors).
(Optional) In my Lovelace UI, I have a dedicated page with toggle switches to turn these automations off/on if I decide to turn these off temporarily.
(Optional) If you put this in the beginning of the script you can change the autohotkey icon to something else, like a HAS.ico if you make one;
I_Icon = C:\Users\Public\Pictures\has.ico
IfExist, %I_Icon%
Menu, Tray, Icon, %I_Icon%
;return
(Optional) If you want to remove the Autohotkey Process Description from the tooltip, download reshacker and edit your autohotkey.exe with the instructions here and replace the description with a blank unicode character or whatever you want;
I definitely vote this up!
I vote yes!!
Can images be passed via HASS Workstation? Could those then be passed onto other powershell modules such as burnt toast which could then create the toast notifications? I'm thinking of HA passing doorbell camera images to be displayed when the doorbell is pressed. This is what burnt toast can do with images, apparently:
Here's a method I use for showing Frigate images from HAS on Windows using Hass Workstation Service and Autohotkey.
This would work for any image on your Home Assistant box (or other local web server or local disk on Windows) that is accessible using a static URL/path.
Install Autohotkey, go to C:\Users\Public\Documents\AHK Scripts\ and make a file "Frigate Person Image Popup.ahk" with the content;
UrlDownloadToFile, http://192.168.1.30:5000/api/nameofyourfrigatecamera/person/best.jpg?crop=1, %TEMP%/frigateperson.jpg ; saves an image from my frigate HAS camera to my current windows user temp directory
SplashImage, %TEMP%/frigateperson.jpg, b x0 y0 fs18, ; shows image in upper left corner of screen
Sleep, 1500 ; keeps the image there for 1.5 seconds
SplashImage, Off ; removes the image
Then I add a CustomCommand in Hass Workstation Service with the name "Desktop Frigate Person Image Popup" and the command being the path to the .AHK file I made above;
"C:\Users\Public\Documents\AHK Scripts\Frigate Person Image Popup.ahk"
Last, in HAS, I make an automation to trigger the above Hass Workstation Service switch when Frigate detects a person on a camera;
alias: Frigate Desktop Notifications (AHK)
description: ''
trigger:
- platform: mqtt
topic: frigate/events
condition:
- condition: template
value_template: '{{ trigger.payload_json[''after''][''label''] == ''person'' }}'
action:
- service: switch.toggle
target:
entity_id: switch.desktop_frigate_person_image_popup
mode: single
Can also make the switch visible in your HAS UI so you can turn it off and on when not desired (example, when playing a videogame or something);
Autohotkey has an incredibly small footprint and only runs on demand (no background service), so I've settled on this solution for now. Since this only shows the image, you may combine this code with the Autohotkey Tooltip method to have both image and tooltip text.
@ohhai-kthxbai to use an image in burnt toast, you can just use the URL to the image, like a camera snapshot image. I actually have set mine up to do that https://community.home-assistant.io/t/hass-workstation-service-turn-your-pc-or-laptop-into-a-bunch-of-sensors/263344/50?u=heedfulcrayon
FWIW I ended up just using IOT Link. It was quite easy as an HA service:
service: mqtt.publish
data:
topic: iotlink/workgroup/{{ host }}/commands/notify
payload: '{ title: "Home Assistant", message: ''{{ message }}'' }'
@amaisano I was also using IOTLink but the project has not been updated in a long time so I decided to switch to Hass Workstation. The problem with IOTLink (or I guess any service sending toast notifications) is that some of them run as svchost.exe, which is the case I believe for IOTLink. And it's a bit difficult to change settings for notifications coming from services, if you want for example to give them High Priority if you want these to show even when you are using an application in Full Screen (like a video game or a movie).
After trying a few methods I ended using a tool called Notifu and simply send a Toast notification via notifu64.exe /m "This is a Test" /p "Simple Notification"
and since it's a separate application, I can easily set it's priority to High in Windows.
Hi, it would be pretty cool if you could send notifications to Windows 10 (similar to IOT Link) Me idea is that you could make an automation which would notify the user if eg. the door is open for 5min. Rightnow I have them send via telegram but id rather have them in the Windows 10 Notifications. Thanks