Sending instructions to Domoticz from windows batchfile on remote machine Topic is solved

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
jemhayward
Posts: 8
Joined: Monday 16 September 2019 23:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Sending instructions to Domoticz from windows batchfile on remote machine

Post 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?
User avatar
boum
Posts: 130
Joined: Friday 18 January 2019 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: France
Contact:

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

Post 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.
jemhayward
Posts: 8
Joined: Monday 16 September 2019 23:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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!
jemhayward
Posts: 8
Joined: Monday 16 September 2019 23:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by jemhayward »

I've found that I do have PowerShell on my windows machine, so now I need to learn how to use it...
jemhayward
Posts: 8
Joined: Monday 16 September 2019 23:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by jemhayward »

cURL.exe and a bit of JSON seems to work a treat.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest