Page 1 of 1
Execute .bat script as administrator
Posted: Thursday 24 November 2016 22:38
by lyngtoft
Hi,
I have a Yamaha reciever which has a webinterface where I can turn it on/off via a couple of .bat files in Windows.
Now I have created a dummy switch with
On command = script://E:\DomoticzScripts\Yamaha\Start.bat
Off command = script://E:\DomoticzScripts\Yamaha\Stop.bat
I have set the service account running Domoticz to my admin user.
I have tried pointing to a shortcut pointing to the .bat file (so I could set the always run as admin flag).
But can't seem to get it to work.
Any ideas would be greatly appreciated.
Re: Execute .bat script as administrator
Posted: Thursday 24 November 2016 23:05
by lyngtoft
Brilliant thanks, it was the UAC. Disabled it and set the service back to Local system.
Do you know if I can combine this on/off button with a "System Alive Checker (Ping)" to get the status updated if I switch it on outside of Domoticz?
Re: Execute .bat script as administrator
Posted: Thursday 24 November 2016 23:07
by lyngtoft
Actually nevermind, I can see the reciever is basically always online, so will need to do something else.
Re: Execute .bat script as administrator
Posted: Friday 25 November 2016 7:01
by Egregius
Doesn't it provide a web interface?
Where you could pull a json reply and look for the data there?
For a Denon receiver it works with XML status like this:
Code: Select all
<item>
<FriendlyName>
<value>Denon</value>
</FriendlyName>
<Power>
<value>ON</value>
</Power>
<ZonePower>
<value>ON</value>
</ZonePower>
<RenameZone>
<value>LIVING</value>
</RenameZone>
<TopMenuLink>
<value>ON</value>
</TopMenuLink>
<VideoSelectDisp>
<value>ON</value>
</VideoSelectDisp>
<VideoSelect>
<value>DVD</value>
</VideoSelect>
<VideoSelectOnOff>
<value>ON</value>
</VideoSelectOnOff>
<VideoSelectLists>
<value index="ON" table="On" param=""/>
<value index="OFF" table="Off" param=""/>
<value index="SAT/CBL" table="CBL/SAT" param=""/>
<value index="DVD" table="DVD" param=""/>
<value index="CD" table="CD" param=""/>
</VideoSelectLists>
<ModelId>
<value>4</value>
</ModelId>
<BrandId>
<value>DENON_MODEL</value>
</BrandId>
<SalesArea>
<value>1</value>
</SalesArea>
<InputFuncSelect>
<value>TUNER</value>
</InputFuncSelect>
<NetFuncSelect>
<value>FLICKR</value>
</NetFuncSelect>
<selectSurround>
<value>DTS NEO:6 music</value>
</selectSurround>
<VolumeDisplay>
<value>Absolute</value>
</VolumeDisplay>
<MasterVolume>
<value>-50.0</value>
</MasterVolume>
<Mute>
<value>off</value>
</Mute>
<RemoteMaintenance>
<value>OFF</value>
</RemoteMaintenance>
<SubwooferDisplay>
<value>FALSE</value>
</SubwooferDisplay>
<Zone2VolDisp>
<value>TRUE</value>
</Zone2VolDisp>
</item>