Jump to content
C4 Forums | Control4

Chowmain - Generic TCP Command Driver


alanchow

Recommended Posts

On 29/11/2017 at 2:13 AM, zaphod said:

I have a Feature request - is it possible to please add Headers for the HTTP POST command? I don't think this is available in the current driver.  There is a field for Data but I don't think there is one for Headers.  A Header field is a string that comes after the -H or --header.  See the curl man page for more info.

Ideally the driver would allow for 2-3 header parameters for HTTP POST commands?  Here are examples of curl command that I would like to be able to do from the driver:


curl -XPOST https://tesla.flawedmodel.com/api/1/vehicles/1234567890/command/sun_roof_controller -H "Authorization: Bearer e01b7d7862eeb7d1cf20a1220c1f328bb1f27de7" -d "state=close&percent=55"

curl -XPOST https://tesla.flawedmodel.com/api/1/vehicles/1234567890/command/set_charge_limit -H "Authorization: Bearer e01b7d7862eeb7d1cf20a1220c1f328bb1f27de7" -H "Content-Type: application/json" -d "{\"percent\":62}"

curl -XPOST https://tesla.flawedmodel.com/api/1/vehicles/1234567890/command/auto_conditioning_start -H "Authorization: Bearer e01b7d7862eeb7d1cf20a1220c1f328bb1f27de7" 

curl -XPOST https://tesla.flawedmodel.com/api/1/vehicles/1234567890/command/charge_start -H "Authorization: Bearer e01b7d7862eeb7d1cf20a1220c1f328bb1f27de7" 

This would allow the user of the driver to send OAUTH tokens, and also to send headers for fields like content type - as in the above examples.

Thanks for the feedback.  I'll put it on the feature request list.

Link to comment
Share on other sites

  • 5 months later...

Hello,

can the driver send hex values ?
Leading $ and spaces between the values like in the C4 serial driver wizzard ?

$02 $41 $44 $5A $5A $3B $56 $50 $4D $3A $44 $49 $43 $03

In quotes ?

(i need hex, because i have to send STX and ETX)

 

Link to comment
Share on other sites

9 hours ago, KAL said:

Hello,

can the driver send hex values ?
Leading $ and spaces between the values like in the C4 serial driver wizzard ?

$02 $41 $44 $5A $5A $3B $56 $50 $4D $3A $44 $49 $43 $03

In quotes ?

(i need hex, because i have to send STX and ETX)

 

Sorry our driver does not support hex 

Link to comment
Share on other sites

I have the driver now in a project and it works.

It is registered and all but i am getting driver alerts because the project has no internet.

Will the driver fail in a month or a year because it can´t phone home ?

Link to comment
Share on other sites

20 hours ago, KAL said:

I have the driver now in a project and it works.

It is registered and all but i am getting driver alerts because the project has no internet.

Will the driver fail in a month or a year because it can´t phone home ?

All of our drivers keep the last state.  So if you are running a trial it will disable after it runs out of time.  If you have purchased a licence it will keep the last state (valid) indefinately.

Link to comment
Share on other sites

  • 10 months later...
6 hours ago, perioms said:

I want to send an ASCI command via packet sender from my HTPC to my control4 system. Is it possible that this driver can evaluate this command to control another device (for example my screen masking)?

Sorry our driver is outbound only.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 1 year later...

UPDATE

Version #20200714 – 14-JUL-2020

  • Added support for HEX based TCP and UDP commands (can be in the format of "00 11 22" or "0x00 0x11 0x22" or "001122"
  • Added inbound HTTP GET control.
  • Fixed issue where driver didn't disconnect TCP connection once it sent the command.
Link to comment
Share on other sites

2 hours ago, zaphod said:

How does the inbound Get command work?

The driver allows you to create an infinite amount of events which you can program against.

the events are the endpoint on the url.

eg you create an event called lightsOn.  You add programming to lightsOn and finally you do a get request to the endpoint http://ipaddress:port/lightsOn

Link to comment
Share on other sites

So this is effectively the same functionality as RyanE's WebEvents driver?  That would be great.  

In the example that you gave the ipaddress would be the ipaddress of the Control4 controller and a port that is predetermined or that you choose on the controller?

Link to comment
Share on other sites

1 hour ago, zaphod said:

So this is effectively the same functionality as RyanE's WebEvents driver?  That would be great.  

In the example that you gave the ipaddress would be the ipaddress of the Control4 controller and a port that is predetermined or that you choose on the controller?

Similar to Ryan’s but a bit easier to program as you don’t need to use variables.  Just program the events

the web server address is in the drivers properties.

i suggest you try it out.  We give a 90 day trial so that should be plenty of time for you to figure out if it suits your requirements or not.

Link to comment
Share on other sites

I bought the driver years ago and I use it on a daily basis.

This is a great addition as the driver previously allowed you to control the outside world from within C4.  The latest upgrade now allows you to control C4 from the outside world.

Link to comment
Share on other sites

Ok, first feature request on the incoming http get.  Would it be possible to pass parameters?  It would be great to be able to pass numeric , text or boolean values into C4, as in:

http://192.168.1.12:52690/OfficeOn?level=92
http://192.168.1.12:52690/SetVolume?level=32
http://192.168.1.12:52690/TeslaChargeStatus?status=charging

Obviously you would want to then be able to use these values in C4, presumably as a variable.

 

Link to comment
Share on other sites

16 minutes ago, zaphod said:

Ok, first feature request on the incoming http get.  Would it be possible to pass parameters?  It would be great to be able to pass numeric , text or boolean values into C4, as in:

http://192.168.1.12:52690/OfficeOn?level=92
http://192.168.1.12:52690/SetVolume?level=32
http://192.168.1.12:52690/TeslaChargeStatus?status=charging

Obviously you would want to then be able to use these values in C4, presumably as a variable.

 

What you don't want to create 100 events for each item like:

  • /OfficeOn01
  • /OfficeOn02
  • /OfficeOn03
  • ....

I agree that would be useful.

Seems like you could make it work with less verbose generation of events with the given functionality. You wouldn't need 100 levels of volume in practice or there are limited charging status values for Tesla.

Link to comment
Share on other sites

I am getting quite a few enquiries about how to integrate iOS shortcuts with our updated Generic TCP Command driver.

As such i have updated the documentation to walk programmers through how it works with Control4.  Note that this can be done fully in Composer HE edition for those who have HE.

http://www.chowmainsoft.com/s/Chowmain-Generic-TCP-Command-Driver-Installation-Guide-tb62.pdf

Link to comment
Share on other sites

  • 3 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.