I have the Jishi Node for Sonos running on Raspberry Pi. Works great if I type in the http to command sonos. I want to integrate this into a rule machine for SharpTools. But I can’t get it to call the http
Hi @Kara_Akgulian, do you have the Sonos connected to either SmartThings, Hubitat or Home Assistant? If so, you should be able to send the controlling command to the Sonos device without using HTTP action.
The HTTP Action’s URL needs to be a public accessible address, so the Rule Engine can reach and execute the HTTP request. (192.168.x.x
is a local ip address that cannot be accessed externally.) So if you have to use HTTP Action, you will have to configure your router/server or use tunneling service like Ngrok so the request can be delivered. (Always make sure the proper security policies and protocols are used when doing this.)
I want to use the http actions so I can use the Jishi node for grouping speakers.
Can I somehow use Sharptools to trigger a Hubitat rule which can call a local IP address?
Yes, Hubitat rules can have HTTP triggers added to them. Then you can use the HTTP action in SharpTools to call your Hubitat rule’s HTTP cloud endpoint.
How do I get the Hubitat rule’s HTTP cloud endpoint?
never mind, I found it under the triggere events. Got it working in SharpTools too. Thanks!
Just playing around with this. Got the trigger in Hubitat rules working. If I use the Hubitat cloud endpoint in SharpTools’ HTTP action everything works fine but I get a white window with the information “{‘result’:‘Triggered’}”. How can I get rid of this statement? Any ideas?
Thanks
Are you using a Hyperlink Tile? That will open a new window.
The approach above uses the HTTP Action in a SharpTools rule to call the HTTP trigger of a Hubitat cloud endpoint. You can run a SharpTools rule directly from your dashboard.
You could also probably use the Hyperlink Tile special syntax to call the Hubitat cloud endpoint directly (without a SharpTools rule) as well.
I tried to call the Hubitat cloud endpoit directly using $.get(“https://myurl”) but I always get an error message. Not sure what’s not working correctly. Any ideas what could cause this? Will try the other way around using SharpTools rules.
They probably have CORS restrictions applied by default. You can use the proxy
option noted in the previously mentioned hyperlink syntax thread to work around that.
So it would end up looking something like:
$.get("https://cloud.hubitat.com/api/your-rule-url-here", {"proxy": true})
New to the community and migrating many Webcore pistons over due to the Groovy deprecation…
I’m on Smartthings platform…what’s the easiest path, without opening up network security issues, to execute playlists, etc. like the below by calling the http api (which is working great on a rp3)
The Web Requestor Edge Driver seems to be a popular choice for this sort of functionality. It enables you to make HTTP requests in your LAN and can be used in SharpTools Rules.