landolfi Posted April 21, 2023 Posted April 21, 2023 I have a volume control network resource set up that sets a state variable to control the volume of my Denon receiver. It works well with Alexa, provided Alexa responds, which she doesn't always do. So I also sometimes use an app to set the volume outside of IoP control, and then my state variable is out of sync with the current volume setting. Has anyone come up with a way to ensure IoP knows or can find out the current volume level setting, or do I just have to make sure I set volume from IoP always? I can't find a way to query and set volume level using IoP, though Denon supports returning the level via an IP command. Here's my current program: DenonChangeVolume - [ID 0014][Parent 0001] If $State_Denon.Master.Volume > $Int_AV_Denon.Zone1.Vol.Min And $State_Denon.Master.Volume < $Int_AV_Denon.Zone1.Vol.Max Then $Int_AV_Denon.Zone1.Vol.Current = $State_Denon.Master.Volume $State_Denon.Zone2.Volume = $State_Denon.Master.Volume Resource 'DenonSetVolume' Wait 1 second Resource 'DenonSetZ2Volume' Else - No Actions - (To add one, press 'Action')
Javi Posted April 21, 2023 Posted April 21, 2023 There is no way to set variables using Network Resources response. You could try the AV Remote Node Server which shows Denon support in the description. Another option would be to use UD Mobile to trigger the the volume change in IoP instead of a direct connection to the equipment.
Solution MrBill Posted April 21, 2023 Solution Posted April 21, 2023 8 minutes ago, Javi said: There is no way to set variables using Network Resources. Actually there is, the REST API. I used to have a portal monitor that used the API. A network resource called from one program, set a variable via the portal, and a second standard heartbeat type program monitored the variable being set over the portal. IIRC I created for a forum post somewhere. What there is no way indeed to do however in OPs case is capture a value using a network resource.
Javi Posted April 21, 2023 Posted April 21, 2023 3 minutes ago, MrBill said: Actually there is, the REST API. I used to have a portal monitor that used the API. A network resource called from one program, set a variable via the portal, and a second standard heartbeat type program monitored the variable being set over the portal. IIRC I created for a forum post somewhere. What there is no way indeed to do however in OPs case is capture a value using a network resource. Added "response", as this was the context. 1
landolfi Posted April 21, 2023 Author Posted April 21, 2023 3 hours ago, MrBill said: Actually there is, the REST API. I used to have a portal monitor that used the API. A network resource called from one program, set a variable via the portal, and a second standard heartbeat type program monitored the variable being set over the portal. IIRC I created for a forum post somewhere. What there is no way indeed to do however in OPs case is capture a value using a network resource. The REST API! Sounds like a nice rabbit hole for me to fall into. Thanks, will check that topic in Search.
MrBill Posted April 22, 2023 Posted April 22, 2023 16 hours ago, landolfi said: The REST API! Sounds like a nice rabbit hole for me to fall into. Thanks, will check that topic in Search. if you haven't found it: https://wiki.universal-devices.com/index.php?title=ISY_Developers:API:REST_Interface
landolfi Posted April 23, 2023 Author Posted April 23, 2023 On 4/22/2023 at 8:25 AM, MrBill said: if you haven't found it: https://wiki.universal-devices.com/index.php?title=ISY_Developers:API:REST_Interface Looks like I may be able to do the whole thing using the AVR/Denon node server, which seems to be able to return the current volume setting. Thanks for the tip! I had installed the AVR node server before but never explored it until just now when I realized most of its properties get exposed only after an IoX restart.
MrBill Posted April 23, 2023 Posted April 23, 2023 15 minutes ago, landolfi said: Looks like I may be able to do the whole thing using the AVR/Denon node server, which seems to be able to return the current volume setting. Thanks for the tip! I had installed the AVR node server before but never explored it until just now when I realized most of its properties get exposed only after an IoX restart. if the value is available from the node server there is no need to use API to set the variable, the variable can be set directly. Actually, you actually don't even need the variable anymore.
landolfi Posted April 23, 2023 Author Posted April 23, 2023 1 hour ago, MrBill said: if the value is available from the node server there is no need to use API to set the variable, the variable can be set directly. Actually, you actually don't even need the variable anymore. Yes, exactly, now I can set it directly. As well as get rid of all the network resources I had set up to change inputs, etc.
landolfi Posted April 24, 2023 Author Posted April 24, 2023 On 4/23/2023 at 3:16 PM, landolfi said: Yes, exactly, now I can set it directly. As well as get rid of all the network resources I had set up to change inputs, etc. Weeell, my excitement was short-lived. Looks like I am back to the REST API, the AVR Remote not only doesn't reliably control my Denon X1200W, it also seems to make it unresponsive to other devices controlling it, so I need to send commands on ad hoc basis. My question is: What are my options for running the REST API commands to set my state variables? Is there any way to do this from within the ISY IDE, or do all of the REST calls need to run outside ISY? My current sketchy plan is to use the network resources I already have with a REST routine that periodically sets the volume state variable in case the value was altered by another means (such as a remote key press).
MrBill Posted April 25, 2023 Posted April 25, 2023 Your REST calls to set variables should ideally be someplace else, like a spare pi, you have laying around. With Polisy and eisy you can, in theory, create another user and do whatever you want, but I'd prefer not to, since installed software may someday conflict with UD's needs.
Recommended Posts