DeviceRemoved & deviceAttached twice in a row, hoses Macro

If you have a question or need help, this is the place to be.
Post Reply
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

DeviceRemoved & deviceAttached twice in a row, hoses Macro

Post by Livin » Fri Dec 16, 2016 3:43 am

I have a new Denon X4300H and just installed the plugin. It does not seem to log any events as "Denon" but I do get this...

20:28:30 System.DeviceRemoved [u'\\\\?\\DISPLAY#DON004E#4&534573d&1&UID50737920#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']
20:28:30 System.DeviceAttached [u'\\\\?\\DISPLAY#DON004E#4&534573d&1&UID50737920#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']
20:28:34 System.DeviceRemoved [u'\\\\?\\DISPLAY#DON004E#4&534573d&1&UID50737920#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']
20:28:34 System.DeviceAttached [u'\\\\?\\DISPLAY#DON004E#4&534573d&1&UID50737920#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}']

... notice everything is repeated. I turned the AVR off, then on - I suspect the HDMI passthrough is doing this, not sure.

This makes running a Macro impossible if I want to trigger different things based on Attached & Detatched.

Is there a function that will allow me to ignore a the next N nuber of logged events?
Also ignore a duplicate log within N seconds of the last?

... maybe these are a feature requests?


thx for the help
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system

kkl
Experienced User
Posts: 306
Joined: Wed May 04, 2011 9:32 pm

Re: DeviceRemoved & deviceAttached twice in a row, hoses Mac

Post by kkl » Fri Dec 16, 2016 6:02 am

Pako previously described a method to ignore duplicate events in this thread.

kkl
Experienced User
Posts: 306
Joined: Wed May 04, 2011 9:32 pm

Re: DeviceRemoved & deviceAttached twice in a row, hoses Mac

Post by kkl » Fri Dec 16, 2016 6:13 am

I think you could also do it without a python script. Notionally, something like this:

<My Macro>
Event/Trigger
Disable <My Macro>
Perform desired actions
Wait some amount of time for duplicate events to finish (if necessary)
Enable <My Macro>

User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: DeviceRemoved & deviceAttached twice in a row, hoses Mac

Post by Livin » Fri Dec 16, 2016 6:16 am

kkl wrote:I think you could also do it without a python script. Notionally, something like this:

<My Macro>
Event/Trigger
Disable <My Macro>
Perform desired actions
Wait some amount of time for duplicate events to finish (if necessary)
Enable <My Macro>
good call!

thanks for the help... I had one of those "don't know why I didnt think to do that!" moments ;-)
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system

User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: DeviceRemoved & deviceAttached twice in a row, hoses Mac

Post by Livin » Sun Jun 18, 2017 3:57 pm

Did you get this 'tuned' to work properly for you? I'll be going down this path next week.need to turn on/off zwave devices based on the receiver being on vs standby.

Thx for any tips
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system

User avatar
kgschlosser
Site Admin
Posts: 4766
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: DeviceRemoved & deviceAttached twice in a row, hoses Mac

Post by kgschlosser » Sun Jun 18, 2017 4:36 pm

Below is a link to a new version of the System plugin. This is a complete rewrite of the device notifications. It no longer spits out double events. And it is not a single event any more. It gives the actual name of the device and the type of device in the event. Along with all kinds of nice metrics about the device as a payload. For instance if you put a thumb drive into your USB it will tell you the drive letter. The file system. The capacity the free space. The manufacturer of the drive. The volume name. And more.

The current device notifications only take place with drives and things plugged in via USB. The new plugin covers every piece of hardware in your computer. Including BT devices which are serial ports. And with technology these days and everything becoming hot pluggable this will cover that as well. But also if you enable or disable a device this will work for that as well. You can get right down to the nitty gritty and get the RPMs of a single fan or the reading on a temp sensor (if that information is passed by the driver to Windows)

viewtopic.php?f=5&t=9588
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4766
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: DeviceRemoved & deviceAttached twice in a row, hoses Mac

Post by kgschlosser » Sun Jun 18, 2017 4:37 pm

And a cool thing with your AVR it will spit out a whole bunch of stuff for audio as well as the video.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4766
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: DeviceRemoved & deviceAttached twice in a row, hoses Mac

Post by kgschlosser » Thu Jun 22, 2017 7:21 pm

I added the modified system plugin

viewtopic.php?f=5&t=9588

this should fix the double entries for the device attached and removed.
If you like the work I have been doing then feel free to Image

Post Reply