OK, he will need some explanation! - Persistent variable

Cupertino, May 26, 2021

Hey, guys, so I had this idea to do a simple check to ride your bike through a number of radio stations on your HomePod at the push of a button. The functionality I wanted was the following ... I have a hue switch button that, when I press a button, turns on my HomePod with a radio. In fact, it does more in automation, but that's not important. I thought it would be great to extend this, so that if I press the button again, it will go to another station and practically go through 4 or 5 stations. I need to work inside the HomeKit, rather than shortcuts on an iOS device, only if others want to use it, so my first thought was to set up a shortcut in the home app using "convert to shortcut". Anyone who has tried such shortcuts knows that it is much more limited than regular shortcuts. I needed a way to remember which station it was actually playing, and because I couldn't find a way to persistently store the variables, I decided to make a basic node.js server running on my home Linux server. This worked great and I created some code to rotate an integer and return the next "station". So basically I would set a URL “http: // myserver: 8004? Variable = station & low = 1 & high = 5 ”This returns a JSON object that I can read as a dictionary and get the next value in rotation. This worked great when testing shortcuts, but it looks like you can't use non SSL in HomeKit shortcuts. I have no idea if it's even possible to set up SSL on a basic home server, because I don't want to expose it directly to the internet. Does anyone have any suggestions on how I could accomplish this? I could very well complicate automation too much. Do I just need a way to switch between homePod radio stations at the touch of a button and would I like to hear suggestions? Luck

Best selling & Top trending HomeKit product in our shop at this moment

HomeKit.Blog is in no way affiliated with or endorsed by Apple Inc. or Apple related subsidiaries.

All images, videos and logos are the copyright of the respective rights holders, and this website does not claim ownership or copyright of the aforementioned.

All information about products mentioned on this site has been collected in good faith. However, the information relating to them, may not be 100% accurate, as we only rely on the information we are able to gather from the companies themselves or the resellers who stock these products, and therefore cannot be held responsible for any inaccuracies arising from the aforementioned sources, or any subsequent changes that are made that we have not been made aware of.

HomeKit.Blog Is A Participant In The Amazon Services LLC Associates Program, An Affiliate Advertising Program Designed To Provide A Means For Sites To Earn Advertising Fees By Advertising And Linking To Amazon Store (Amazon.com, Or Endless.com, MYHABIT.com, SmallParts.com, Or AmazonWireless.com).

The opinions expressed on this website by our contributors do not necessarily represent the views of the website owners. 

Copyright © 2022 HomeKit Blog
. All rights reserved
United States