--
You received this message because you are subscribed to the Google Groups "CommandFusion Hardware" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusion-har...@googlegroups.com.
To post to this group, send email to commandfusi...@googlegroups.com.
Visit this group at http://groups.google.com/group/commandfusion-hardware.
For more options, visit https://groups.google.com/d/optout.
Thanks for the info.
I didn't have much luck getting the port to trigger with the video sense, but I ran out of time to keep testing. It appears it may be the amp that could be the issue. I could get an analogue voltage input to work using a USB port on the amp that switched between 0.9v and 5v on power cycling.
I will try again with it tomorrow when I go back to site.
With the video sense option, what is the job of the voltage adjustment option? Could this be to do with it not working?
If I have to end up using the USB option instead, could i use the > operator in the regex to detect if the IO port is greater than say 3v for example?
Lastly, I will hunt through the wiki for this anyway, but if there is a quick and easy answer it would help me out! Whats the easiest way to perform some logic to create discrete on off commands based on the IO states.
For example to create an 'on' command - if IO port 1 = 1 then Amplifier is on = do not send power toggle - else, send power toggle.
I realise this may be better done with JS and I currently have some more hardware on order, so I may make this my first JS challenge when I have another CFmini in the office.
Thanks
Andy.
Thanks again for the info.
I'll update this with what I did in case it's useful for anyone else...
I couldn't get the video sense to work and suspect its because the ports are showing 1.7v even when not connected (let me know if you find anything out on this one!)
I did however have some luck using the USB outputs as both the AVR and a bluray player had USB ports that switch with the power toggles.
I set the IO ports to analogue voltage and noted the differences, 1.7v when off and 5v when on.
I created a feedback item for each to capture just the first digit and link to a digital join.
The Regex used was: RIOXCHA\xF4.*P01:A:(\d)(\d)
I used capture group one to capture either a 1 or 5 depending on power state.
This then allowed me to produce discrete power commands using the javascript from Jarrod's post above. It also gave me my first opportunity to debug javascript as it was missing a } from the end of the line! Thanks Jarrod ;-) (At least I assume it was as it didn't work until I added the second } )
This worked great, but it did present a problem, when the GUI loads, it doesn't know the state of the two devices as they only do something on a state change. In my case this was even worse as I was using GUI linking to use the XBMC module and each time the main GUI came back up, it didn't know the state of the devices so displayed them as off.
So to solve this, I read through and found the query state command. I added two more commands to query the state of the IO ports as follows: -
\xF2\x20\xF3QIOXSTA\xF4.*P01\xF5\xF5
\xF2\x20\xF3QIOXSTA\xF4.*P02\xF5\xF5
I then made a macro with these two commands in them and added to a page timer to run each time the page loads.
This seems to have worked quite nicely.
As always, Thanks for the help Jarrod, much appreciated.
Andy.