Closed bjhiltbrand closed 5 years ago
Hi @bjhiltbrand Thanks for your feedback. This is very helpful as I try to get this finished and ready to submit to openHAB to be included as a standard binding.
I have been looking into this today and will work on some changes that I think will make it work better. Give me a couple of days.
Three questions:
What is the actual valve you are controlling?
Thanks,
Bob
@BobRak, Awesome! Thanks. To answer your questions:
Side note: I am developing a new automation for work (Insurance company that will be using sensors and shutoff valves to help mitigate water losses). We are developing it using the new SmartThings developer workspace, which is a little different that the old IDE. Do you have any plans to migrate this app to the new workspace, or is it more of a "cross that bridge when the time comes" sort of thing?
Thank you for all your help.
Hi @bjhiltbrand I just uploaded a new jar file. I made some changes to the valve definition. It is now only defined as a string. The trick to being able to turn it on and off is making the item look like:
String WaterShutoffValve "Water Shutoff Valve [%s]" {channel="smartthings:valve:HiltbrandHome:waterShutoffValve:valve"}
And then make the .sitemap entry look like:
Switch item=WaterShutoffValve mappings=[open="Open", closed="Close"]
The mapping tells the UI to send a response of open or closed and buttons are displayed instead of the switch. Also, the [%s] in the item definition causes the UI to display the current status.
Let me know if this solves things or not. I'll do whatever is necessary to make it work for you.
There were no changes to the Smartthings files so no need to reinstall them.
I haven't tried to do anything with the new Smartthing developers tools although I have done some reading about them. I'll look at that in more depth when time permits. I started with the old IDE.
I've started thinking about getting this included as part of OpenHAB and have come to realize that I'll have to make the Smartthings files available some how. I suspect the best way to do this is to get Smartthings to publish them. So, I'll start looking at that soon.
Please let me know how it goes.
Bob
@BobRak, Worked like a charm! Thank you. I was unaware of the mappings option in OpenHAB sitemaps. That's pretty slick!
Correct me if I'm wrong, but I think the way the new SmartThings stuff works is that you have to run your own node js servlet to send json payloads back and forth to the Samsung Connect cloud. I don't know if OpenHAB could host the servlet to work with the new Samsung stuff, so that you don't have to play middle man for the rest of your life. That's the assumption I'm working under at work, and we've developed our app to run this way, where we just push around json payloads all day long, but I don't know if that's something you want to do for this binding.
Anyway, Thank you so much for your help on this. Let me know if you have any other scenarios you want me to test. I have a fairly robust SmartThings ecosystem.
@bjhiltbrand Glad the valve now works correctly.
I haven't looked at the new Smartthings environment close enough to know what is needed to work with it. I'll have to look at it down the road, when time permits.
Right now I think all of the things I've tested or have gotten feedback on work as they should. If you come across any devices that you don't think work the way they should please let me know.
Thanks,
Bob
Hello, I have a couple water shut-off valves that I have setup in OpenHAB, but when I go to open or close them in OpenHAB, I get a 400 error as a bad request. The error in the logs is:
The relevant line in my .things file is:
And the relevant line in my .items file is:
I realize that the items file has this valve listed as a switch, but I think that is my only option, as OpenHAB doesn't have a valve item type. I think the issue here is that OpenHAB requires that a switch only pass values of 'ON' or 'OFF'. I'm pretty sure that is where the error in the logs is coming from.
On the flip side, however, SmartThings will still require a value of 'open' or 'closed', as that is what the SmartThings capabilities spec state for a valve capability. I'm not very well-versed in git, so that's why I'm posting the issue here.