Flex Posted December 4, 2023 Posted December 4, 2023 This is my first trial for this Sonos node server. I still use rest commands to set Sonos to play and pause in response to Insteon keypad commands. This has worked well through the years. However, when Sonos is commanded through the app, of course, the Polisy has no knowledge of that command and thus the keypad buttons do not light. And then, of course, two keypad presses are needed to send a pause command. This node server has no problem sending commands to the speakers but it does not read the status from the Sonos speaker if it is commanded through the app. All I need this node server to do is read the status' from the speakers and report that to the Polisy. Is this something that is written into this node server or not? If not then I really don't have a need for it, since the "HTTP gets" work just fine otherwise. Now if the Polisy sends the command via this node server, then the play pause state is returned, after transitioning.
lilyoyo1 Posted December 5, 2023 Posted December 5, 2023 17 hours ago, Flex said: This is my first trial for this Sonos node server. I still use rest commands to set Sonos to play and pause in response to Insteon keypad commands. This has worked well through the years. However, when Sonos is commanded through the app, of course, the Polisy has no knowledge of that command and thus the keypad buttons do not light. And then, of course, two keypad presses are needed to send a pause command. This node server has no problem sending commands to the speakers but it does not read the status from the Sonos speaker if it is commanded through the app. All I need this node server to do is read the status' from the speakers and report that to the Polisy. Is this something that is written into this node server or not? If not then I really don't have a need for it, since the "HTTP gets" work just fine otherwise. Now if the Polisy sends the command via this node server, then the play pause state is returned, after transitioning. I know the st-sonos updates whether you control hings via the app or polisy. I used the free one years ago with my isy and it worked as well. There may be a bug or an issue with the install.
bigDvette Posted December 5, 2023 Posted December 5, 2023 @Flex I am digging in to this nodeserver. There is a typo for shortPoll in the plugin that is not causing it to get any updated states. I have it workiing. I also have it working to scan networks beyond the base network and the ability to manually add nodes. If you are interested I can send you the custom python file for you to test.
Flex Posted December 6, 2023 Author Posted December 6, 2023 I am very new to the whole idea of these node servers / “ plugins” as they are sometimes called. I know next to nothing about python. And so I would need to have very detailed instructions on how to install, test, and use your new file. All I know how to do, is how to install a node server from the store, and even that seems to be difficult for me, although this last time with help from this forum I did get it to be recognized by my newly implemented Polisy ISY. I currently just use rest commands via network resources to control the Sonos speakers, which is what I did with the 994 ISY. It works well enough, with the exception of having the appropriate keypad lights turn on or off when the Sonos app is used.
bigDvette Posted December 6, 2023 Posted December 6, 2023 I’ll see if I can get changes committed. Not sure who is maintaining the nodeserver.
bpwwer Posted December 6, 2023 Posted December 6, 2023 @bigDvette If you can send me a pull request via github, I can merge your changes and release a new version of the pug-in. As an alternative, you can PM the file.
bigDvette Posted December 6, 2023 Posted December 6, 2023 Thanks @bpwwer I worked on it a lot last night. I have added a manual method to assign IP addresses and sonos speakers and I have also figured out in the soco library that there is a method to call discovery and specify subnets to scan. I have added and left both methods in the file. I then went and extended the editor.xml, and nodesdefs.xml to add a status for mute to the config. based on what @Flex was wanting to do to map button status, I though a mute status was a good idea. I'm not sure how to submit a pull request, but have used git. If I can't figure out, I will send you sonos-poly.py, editors.xml, nodedefs.xml and an updated README.md with syntax to use the other methods. Thank you very much! I did learn a lot between figuring out how to add back the manual method to harmony nodeserver as well.
bigDvette Posted December 6, 2023 Posted December 6, 2023 @bpwwerI think I was able to push changes to Git. Let me know if that looks like it worked and I can test.
bpwwer Posted December 7, 2023 Posted December 7, 2023 (edited) @bigDvette It didn't work. I'm not sure what you did but the first commit in the changes looks like they were applied to the PG2 version of the code and you ended up checking in a lot of the conflicts. The second commit looks like it tried to clean some of that up. I pulled what you had in git and manually applied it along with a small fix to the README changes. I did notice a couple things I think you need to check/verify. Some of the issues seem to be related to my initial port to PG3. 1) I think the readme needs some additional changes to be correct. For example, without a controller node, the only discover button will be in the PG3 node details (which currently isn't enabled). So I don't think there's any way to call discover manually. If you want the ability to call discover manually we'll need to make other changes. 2) There might be a race condition in the new parameter handling. It's possible that the CUSTOMPARAM event will happen after the discover() function has run. At startup, it's probably unlikely, but it is possible. I typically have the CUSTOMPARAM handler call the discover() function so that I first verify that I have the parameters. Also, since the user can edit/add/delete custom parameters at any time, the node server needs to update when those changes are made. The master branch of UniversalDevicesInc-PG3/udi-sonos-poly has your changes so you can pull that again and make changes on top of that. Also, now that it has parameters, there should be a POLYGLOT_CONFIG.md file that provides info on what those parameters are and how they should be set (similar to what's the README file). Edited December 7, 2023 by bpwwer added POLYGLOT_CONFIG info
bigDvette Posted December 8, 2023 Posted December 8, 2023 (edited) @bpwwer I found it odd there was no discover button and no controller node but didn’t mess with that too much. I actually had it adding a controller node in 1 version but commented it out later because I didn’t understand why it didn’t exist. ill re-pull and tinker again. I had the hardest time even getting the custom params to read initially as the nodeserver didn’t use any and there was no load being called anywhere. Edited December 8, 2023 by bigDvette
Flex Posted December 8, 2023 Author Posted December 8, 2023 I appreciate your efforts to make this node server work to know the Sonos speakers status.
Solution bigDvette Posted December 9, 2023 Solution Posted December 9, 2023 @Flex the updated node server is in the store. If you go to purchases then click reinstall you will see there is an update. I also added a mute status (thought might be handy for what you were doing). I’m not 100% that status will get added to existing speakers. The speakers should get the same names if they get re-added so if you have any problems try deleting the Sonos speakers and then restart the nodeserver. I usually remove them using the nodes tab on the polyglot web page. if you change play, pause, volume or mute from say the Sonos app, it will take up to as many seconds as you have configured the shortpoll on the config tab of the nodeserver. 1
Recommended Posts