xlurkr Posted July 29 Share Posted July 29 Can anyone help me control a single device in HA through an NR? Short story: I have a Samsung TV that HA found and created a card for. Using the card, I can manually turn the TV on and off. I want to tell HA do that in an NR. I think it is possible through the HA RESTful interface, with PUT calls maybe, but I'm finding it hard to get the specifics by searching. Long story: This model, UN43TU700DFXZA , must be turned on through WOL. Once it's on, you can send it commands, but like a lot of modern stuff, you have to use credentials that you obtain once interactively. HA's integration handles all this, and it's now set up on my TV, so with its interface I can control the TV's power. I don't think NR's have the versatility to directly communicate with this TV, but all my logic is on my Polisy, and I just need to be able to turn the TV on and off to create an automation that I want. That's why I want to use a couple of NRs to control the TV power through HA. Like a lot of things HA-related, searching for '"REST" turned up a lot of information that was either irrelevant or so densely filled with jargon that I couldn't understand it. I have created several NRs for other things in my home, and I'm hoping one of the built-in NR protocols can be used to send the proper commands to HA. -Tom Quote Link to comment
xlurkr Posted July 31 Author Share Posted July 31 This may be the dealbreaker: in the HA developer documentation, it shows you how to use the RESTful interface, but contains this comment: The API accepts and returns only JSON encoded objects. Does this mean NRs won't work? I don't see JSON as an option in the "mode" dropdown, unless that's what "URL-Encoded" means. I got this information from this page: REST API | Home Assistant Developer Docs (home-assistant.io) -Tom Quote Link to comment
gregkinney Posted July 31 Share Posted July 31 (edited) Go to your HA dashboard --> settings --> automations and scenes Create new automation Add trigger --> Webhook Change the webhook ID to something meaningful like "tvon" Then add the action of turning the tv on in your HA Use my attached screenshot as a template for your network resource. The host will be the ip address of your HA box The path will be /api/webhook/tvon Let me know if you have questions Edited July 31 by gregkinney Quote Link to comment
firstone Posted August 1 Share Posted August 1 On 7/29/2024 at 1:10 AM, xlurkr said: Can anyone help me control a single device in HA through an NR? Short story: I have a Samsung TV that HA found and created a card for. Using the card, I can manually turn the TV on and off. I want to tell HA do that in an NR. I think it is possible through the HA RESTful interface, with PUT calls maybe, but I'm finding it hard to get the specifics by searching. Maybe it would be easier to create automation in HA and control ISY via integration? Quote Link to comment
xlurkr Posted August 1 Author Share Posted August 1 Thanks both. @gregkinney: I'll give it a try. @firstone: That's what I'll do if this doesn't work. I'm more comfortable automating things with ISY, but I do need a reason to learn more about HA, and maybe this is the project. -Tom Quote Link to comment
xlurkr Posted August 1 Author Share Posted August 1 That worked! Thanks @gregkinney! Time to read the HA docs on weblinks. -Tom 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.