codersaur / SmartThings

Samsung SmartThings SmartApps and Device Handlers
Apache License 2.0
300 stars 541 forks source link

Generic sensor attributes #7

Open dlaporte opened 7 years ago

dlaporte commented 7 years ago

Thanks for writing this! I have an issue with a custom device handler I've written that doesn't have any capabilities beyond "sensor" - it's an oil tank monitor that just reports the number of gallons in the tank. I have defined a custom attribute, "gallons" that I would like to monitor.

Currently, I've just hacked the pressureSensor type (which you've mapped to sensor) to include my custom attribute, but I was wondering if it were possible to allow the discovery and/or selection of non-standard attributes in devices with "sensor" capability?

Here's a link to the code if I haven't been clear about what I'm asking:

https://github.com/dlaporte/SmartThings/blob/master/DeviceHandlers/rollie-gauge/rollie-gauge.groovy

thanks!

codersaur commented 7 years ago

I'm assuming this relates to the InfluxDB Logger. It's a good suggestion, but not something I will get round to coding any time soon tbh. If you want to monitor a custom attribute, I recommend editing the code yourself; there are a few places you need to edit the code but it's fairly easy to see where.

Also, for tank capacity, keep an eye on this thread: https://community.smartthings.com/t/capability-volumemeter/40970

dlaporte commented 7 years ago

Thanks for the heads-up on the thread. I edited the code to meet my need – I also needed to use httpget vs hubaction for my use case. Would you be willing to accept updates for a toggle behavior on that as well as custom attribute discovery? I might be able to find some time to work on it in the next few weeks.

Thanks, Dave

From: codersaur notifications@github.com Reply-To: codersaur/SmartThings reply@reply.github.com Date: Monday, February 13, 2017 at 4:08 PM To: codersaur/SmartThings SmartThings@noreply.github.com Cc: David LaPorte david@davidlaporte.org, Author author@noreply.github.com Subject: Re: [codersaur/SmartThings] Generic sensor attributes (#7)

I'm assuming this relates to the InfluxDB Logger. It's a good suggestion, but not something I will get round to coding any time soon tbh. If you want to monitor a custom attribute, I recommend editing the code yourself; there are a few places you need to edit the code but it's fairly easy to see where.

Also, for tank capacity, keep an eye on this thread: https://community.smartthings.com/t/capability-volumemeter/40970

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/codersaur/SmartThings/issues/7#issuecomment-279522843, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABeb8VhtH43tf9SjlHGOQ6xwj9krzbgQks5rcMZYgaJpZM4L-v5C.