Implementing SPL (Sound Pressure Level) in ST - Code change required

Today I tried to implement a Sound Meter in Smartthings. I implemented it using the ‘Parent_ST_Anything_Ethernet’ which worked, i could see the dBA Sound Level events, but no child device was created. After some googling & GitHub I found that there was a Child DH for Sound in HubDuino but not ST:

I created the about DH in Smartthings but the child device still did not create. After a bit of code rummaging I found the parent-st-anything-ethernet did not have a Switch/Case for Sound

I added this to the Parent_ST_Anything_Ethernet Device Handler

			case "soundPressureLevel": 
            		deviceHandlerName = "Child Sound Pressure Level" 

And it works:

Thought I’d share, in case anyone else wants to implement the sound pressure level.

@ogiewon - thought you might want to know, in case there is a GITHUB update required,



Thanks @Levanterman. I have updated the ST Parent DTHs as well as added a Child DTH for Sound Pressure. I have not tested these changes yet, but they are all in GutHub… :wink:

1 Like