gg102 Senior Member
Joined: January 29 2013 Location: United States
Online Status: Offline Posts: 245
|
Posted: November 30 2022 at 10:24 | IP Logged
|
|
|
Ken,
I regularly communicated with external devices directly to/from PH.
I communicate with my Raspberry Pi's and all my Shelly Devices using this method.
This method is simple and reliable and doesn't require any controllers or hubs.
Straight HTTP.
(I have been replacing all my x10 devices with Shelly devices. They are fantastic!)
To "get into PH" from an external device you can use this command directly from a browser or device to test:
http://192.168.x.y:PH_PORT/ph-cgi/eval?formula=ph_macroparm( "Name_of_PH_macro", "into_local1", "into_local2","into_local3","into_local4","into_local5")', auth=(PH_USER, PH_PASSWORD )
You must have all 5 "into_locals" or the PH formula will error out.
If you use ph_macroparmret() rather than ph_macroparm() you can get back a response from PH to the device.
Whatever is put into PH local1 when the PH macro ends will be sent back to the device.
There's no reason you couldn't talk to/from another PH or any device that can send/receive HTTP requests.
Hope this helps.
If you want more detailed info I can help.
I can show you my Raspberry Pi code, or the PH code to "talk to" the Shelly devices.
|