Looking for something to report recording status
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Looking for something to report recording status
I have been getting into home automation lately, and I've set up a Home Assistant server on a Raspberry Pi.
I have decided I would like for it to know when WMC is recording. I know there is that little icon in the tray that turns red when it's recording and green when it isn't, so clearly the state is tracked someplace, so if there is a way to get that state communicated out to Home Assistant I can then do things with that information.
So, is there some kind of 3rd party thing that will track that and report that information in a retrievable way?
Thanks much!
-- Chris
I have decided I would like for it to know when WMC is recording. I know there is that little icon in the tray that turns red when it's recording and green when it isn't, so clearly the state is tracked someplace, so if there is a way to get that state communicated out to Home Assistant I can then do things with that information.
So, is there some kind of 3rd party thing that will track that and report that information in a retrievable way?
Thanks much!
-- Chris
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Correction: the red icon is there when recording and gone when it isn't. So maybe there's a way to poll for presence of that icon? Is it a running process of some kind?
-
- Posts: 657
- Joined: Tue Dec 20, 2011 11:05 pm
- Location:
- HTPC Specs:
This is a little out there... but maybe using the Windows Media Center TCP/IP controller code, which provides a way for you to get status from the media center? https://vmccontroller.codeplex.com/
It says Vista, but I've had a recent version running on Windows 7 MC. Maybe you can do something with the status connection, connect a socket and watch for the recording indications... No idea if feasible or usable.
It says Vista, but I've had a recent version running on Windows 7 MC. Maybe you can do something with the status connection, connect a socket and watch for the recording indications... No idea if feasible or usable.
-Alan
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Someone else mentioned that to me, and I agree that it's a possibility. I assure you're referring to the "schedule" command...the problem is, the documentation is pretty must nonexistent. I'm not sure how that command is issued or otherwise works.
....aaaaand it doesn't matter anyhow, because when I try to install the beta 2 (for HTTP), it throws an error and fails the install.
....aaaaand it doesn't matter anyhow, because when I try to install the beta 2 (for HTTP), it throws an error and fails the install.
-
- Posts: 657
- Joined: Tue Dec 20, 2011 11:05 pm
- Location:
- HTPC Specs:
Was actually thinking more the socket (not HTTP) connection mode to the primary server/port, and seeing if you get the stream of events it supposedly sends. Like the "recording" event documented in https://msdn.microsoft.com/en-us/librar ... 2147217396
https://vmccontroller.codeplex.com/wiki ... umentation
Maybe if you can find /a/ version you can install (maybe https://vmccontroller.codeplex.com/releases/view/45909) you could use a telnet or netcat client to examine the stream and decode something useful.
https://vmccontroller.codeplex.com/wiki ... umentation
Maybe if you can find /a/ version you can install (maybe https://vmccontroller.codeplex.com/releases/view/45909) you could use a telnet or netcat client to examine the stream and decode something useful.
Last edited by webminster on Wed Oct 05, 2016 1:38 am, edited 1 time in total.
-Alan
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Well, unless I can somehow find Beta 1 (it seems the only download link is for Beta 2), it's not gonna matter anyhow, because Beta 2 won't install.
EDIT: Wait, I found it. Let's see if it will even install.
MOAR EDIT: Nope, that one craps out with the same error. Something about a problem during the "commit" phase.
EDIT: Wait, I found it. Let's see if it will even install.
MOAR EDIT: Nope, that one craps out with the same error. Something about a problem during the "commit" phase.
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Aha! 45909 worked. (I was just about to try it when I saw your post.) Now we see if I can figure out anything to do with it.
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Hmm, this works and I can use URLs to make things happen. That's interesting. Unfortunately the "schedule" command seems to not be in this version. I'm not sure how to use what I have to get a status.
-
- Posts: 657
- Joined: Tue Dec 20, 2011 11:05 pm
- Location:
- HTPC Specs:
I thought from what you were asking you might use the status stream, as I mentioned above... that would tell you when recording started and stopped (and more). It wouldn't tell your the upcoming schedule, I don't know if it can. Another idea for that might be installing and reverse-engineering Ceton's MyMediaCenter server API, or even the Remote Potato server. Both sound like a hassle.
-Alan
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Yeah, I gotta figure out how that stream works. It's too bad there doesn't appear to be an HTTP status command for that, because it seems like it would be pretty easy to poll it every few seconds and then trigger a switch-flip in Home Assistant when it's recording.
I have an SSH client, but I am not sure how to attach to that feed with it.
I have an SSH client, but I am not sure how to attach to that feed with it.
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Okay, I managed to get connected. SO close. It sends a "Recording=True" when it starts recording. This is great! But does it send a "Recording=False" when it's done? Oh hells no, because that would make sense! Just sends "Stop=True" (which it sends basically any time any playback whatsoever is stopped, so that isn't useful) and an EndSession=## notice. So basically it's a combination of making a note of the session number that is generated when recording is started (which pops up in a StartSession=## notice the line BEFORE Recording=True) and then watch for "Stop=True" followed by the "EndSession=##" notice that correlates. WAY too much hassle. "Recording=False" would have been perfect. Dammit.
-
- Posts: 248
- Joined: Thu Jun 16, 2011 5:23 am
- Location:
- HTPC Specs:
If you are still looking for a quick way to do this let me know and I'm sure I can do a quick thing for you.
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Thanks! Yeah, I never did find a solution. I don't even really care about "which tuner is recording" (though maybe that's useful?)...I just want to be able to access whether WMC is currently recording SOMETHING or not so Home Assistant can use that information.mikinho wrote:If you are still looking for a quick way to do this let me know and I'm sure I can do a quick thing for you.
-
- Posts: 248
- Joined: Thu Jun 16, 2011 5:23 am
- Location:
- HTPC Specs:
Its really easy to get that. Do you want a lock file (if file exists recording is in process) or a simple HTTP get that response with 200 for record or 404 for not recording?
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
The GET request I think would be easier for me to parse into something I could use with HASS. I think I just poll at intervals and can have it take action based on the result.mikinho wrote:Its really easy to get that. Do you want a lock file (if file exists recording is in process) or a simple HTTP get that response with 200 for record or 404 for not recording?
Curious, how are you getting it?
-
- Posts: 248
- Joined: Thu Jun 16, 2011 5:23 am
- Location:
- HTPC Specs:
Directly from Media Center's guide data.
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
Ah, ok, so basically you're checking the guide data to see if I've marked anything to be recorded at that time, the same way I would be doing the GET to see if it's reporting recording?mikinho wrote:Directly from Media Center's guide data.
-
- Posts: 248
- Joined: Thu Jun 16, 2011 5:23 am
- Location:
- HTPC Specs:
No, the guide data also includes tuner information. So you can query to see if any tuner is recording anything.
-
- Posts: 63
- Joined: Wed Nov 13, 2013 6:59 am
- Location:
- HTPC Specs:
So if you know how to parse it, it's pretty much just as easy to tell which ones are recording as it is to tell whether any of them are? Nice.mikinho wrote:No, the guide data also includes tuner information. So you can query to see if any tuner is recording anything.
-
- Posts: 248
- Joined: Thu Jun 16, 2011 5:23 am
- Location:
- HTPC Specs:
Yep. Just let me know and I can either include which is recording or just a simple yes it is recording type thing. I probably won't have time to do it today but I can knock it out tomorrow. Its not much at all.