SmartThings Community

[RELEASE] MiHome (Connect) V2.0.1 [Energenie] (not Xiaomi MiHome)

devicetype
smartapp
dth_pocketsocket
dth_sensors
dth_hvac

(Greg) #227

here’s my params

‘[uri:https://mihome4u.co.uk/api/v1//subdevices/power_on?params={“id”%3A135312}, headers:[User-Agent:SmartThings Integration, Authorization:Basic nametokenorpassword], tlsVersion:TLSv1.1, body:[:]]’


(Mark C) #228

Looks ok is it working


(Mark C) #229

Is the error with the ‘on’ ie does it turn on? Or is it will the poll() as per the other guys error


(Greg) #230

Thanks Mark, not working. when you you activate switch it get stuck on “turning on” and generates endless re run messages, and the device does not switch on.

here’s a log: after switch activate request:

RERUN ON - ‘Top Room Uplighter Adapter’, ‘2’ attempt
dd0db367-373a-42d8-8330-d02d7caa9672

17:16:59:warn ON - ‘Top Room Uplighter Adapter’ response -‘400’ - ‘[status:invalid-controller-or-action]’ Unexpected result
5c4478d7-4cfb-4067-9d3e-7ce18a395baf

17:16:59: debug apiGET exception respones groovyx.net.http.HttpResponseDecorator@6ae52c4f
5c4478d7-4cfb-4067-9d3e-7ce18a395baf

17:16:59: error Status: 400

thanks


(Mark C) #231

A 400 error means there is something wroung with the message you are sending. The only thing I can’t debug for you is if the device id correct or your username password combo


(Greg) #232

Thanks Mark, would I be right in assuming that ST wouldn’t be able to pull in all the device & adapter info if I’d used the wrong user/pw combo so would indicate more possibly id issue?

I’ll "Ctrl Alt Dlt " everything and reset / delete the DTH and App reboot everything, clear all caches etc and add everything again see if that helps as if it’s definitely working now there’s obviously a “ghost in the machine” somewhere in my setup?


(Mark C) #233

Mine came on straight away no prob. Are you using my tweeked code or the original from the top?

Go into the smartapp on your phone and re enter your details. Make sure to then add your devices in the app. Then make sure it saves with out any errors , save , not the back arrow. In the use at the same time you should see it finding all your devices from mihome and adding them


(Greg) #234

Hi Mark, thanks once again for taking the time and for your reply. I’m using your “tweaked code”.

I deleted everything and started again. Account connects, verifies and devices are found and added ok.

However, as soon as I go into “things” all adapters show as being “on” ??? I deleted the “tweaked code” and installed 2.01c by Alyc100 - it worked - I open “things” all adapters show in their “off” state, and work when activated???

Not being code literate, I’m not sure what the differences are in the code or if it’s “ghost in my machine”.

Hope that info is maybe some use in developing and maintaining the integration???

Thanks for your help, really do appreciate it, look forward to trying any future updates and revisions.

Thanks again

Greg


(Mark C) #235

Where you using my DH as well


(Mark C) #236

If you look close at your message there are two ‘/’. because of the issues id been moving the / around between the DH and SA, i hadnet push out my updated DH for the swithch as i was still cleaning all the log debugs up. its updated in my git hub now
/api/v1//subdevi


(Greg) #237

Hi Mark, thanks for the update.

That was it !

Swapped out orig and replaced with your DH and App and voila, works perfectly.

Big Thanks.


(Andrew Taylor) #238

Mark, thank you, thank you, thank you!

It’s working now.


(steve holt) #239

Hi All
Has anyone tried adding one of the new double light switches, I got mine today but it didn’t show up in the mihome smartapp in ST I can only see my 2 single switches any help appreciated.


(Mark C) #240

When u added it to mihome did you add them as 2 singles? What DH do u use for the single? Shouldn’t be a big job


(steve holt) #241

No when I added them in mihome app it was as a double light switch, so have deleted and added as single devices now showing in ST thanks for the pointer never thought about doing it that way. The DH I am using is alyc100 : Mihome Adapter.

Thanks for your help


(steve holt) #242

Hi Mark i thought all was going well until i added another double light switch then they started switching each other on and off, so i have deleted again and added back as double light switch and they seem to work ok as in not switching each other off and on but they dont show up in the Mihome smart app as before any help appreciated.


(Mark C) #243

Let me have a think what I can do as i dont have a double switch so can’t test. So is the problem the fact that the double switch isnt available to add in ST smartapp?


(steve holt) #244

Yes that’s correct it dosnt show up in the smart app


(Mark C) #245

updated you smart app with thsi
def devicesList() {
logErrors([]) {
def resp = apiGET("subdevices/list")
log.debug "device list all '$resp.data'"
if (resp.status == 200) {
return resp.data.data
}
else { log.error("Non-200 from device list call. ${resp.status} ${resp.data}") return [] } } }
then while you have live logging running, go into the app as if you were going to add a device.
you should get a list of all your devices in live logging, send me the response, maininly the bit which has your double light switchs names in


(steve holt) #246

Hi Mark

I am not a coder so wouldn’t know where to even insert that piece of code, but Alex has updated the code now to support the double light switches in his latest release. Many thanks to you both for helping me it’s a great community on here.

Many Thanks
Steve