Page 1 of 1

Sending instructions to Domoticz from windows batchfile on remote machine

Posted: Sunday 22 September 2019 15:47
by jemhayward
Apologies if this is a RTFM, or fAQ I've not yet found, but I'm new to Domoticz!
I've bought a RFXCOM 433 and have attached it to a RPi running Domoticz and I can now switch various things on and off via the ARC protocol and my old BBSB switches. It's all working nicely. This is replacing a BBSB online controller that had become unreliable. I was sending instructions to the BBSB controller using a utility called broadcast.exe that sent UDP packets around out network, and I use windows batchfiles triggered by Intelliremote software running in my windows server.
What I'd like to be able to do is send instructions via the network to my Domoticz from my windows server, using batchfiles - is there a how to out there that will show me how to do this?

Re: Sending instructions to Domoticz from windows batchfile on remote machine

Posted: Sunday 22 September 2019 17:44
by boum
You can use Domoticz Json API: https://www.domoticz.com/wiki/Domoticz_ ... 27s#Format
I bet you could find and use curl on windows.

But instead of batch (or inside it), you can use PowerShell, using Invoke-WebRequest
See https://www.domoticz.com/forum/viewtopic.php?t=15935
If you want to get back some information, look for Invoke-RestMethod which parses the returned json.

Re: Sending instructions to Domoticz from windows batchfile on remote machine

Posted: Sunday 22 September 2019 23:22
by jemhayward
Many thanks - looks like it is at least possible!

Although I do know what JSON is and also PowerShell (though I'm not sure my version on windows has that) - I've no real experience with either, building things from the ground up. I was hoping someone else had been here before and could give me an 'off the shelf' solution, as I'm lazy and have no free time (yet) to work on this. I did some basic JSON stuff a few years back, so maybe I can get my ageing brain cells around that!

Re: Sending instructions to Domoticz from windows batchfile on remote machine

Posted: Monday 23 September 2019 11:47
by jemhayward
I've found that I do have PowerShell on my windows machine, so now I need to learn how to use it...

[SOLVED] Re: Sending instructions to Domoticz from windows batchfile on remote machine

Posted: Monday 23 September 2019 15:08
by jemhayward
cURL.exe and a bit of JSON seems to work a treat.