SmartThings Community

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

devicetype
smartapp
dth_pocketsocket
dth_sensors
dth_hvac

(Mark C) #207

have you had and feedback from anyone one hear @Zach_Varberg is quite active


( I hate Mondays) #208

I remember having some issues like that with a smartapp of mine - it was the TLS version. I believe we default on TLS1.0 which some providers have now disabled. You should be able to get it working by adding the tlsVersion parameter to the request Map and setting it to TLSv1.1 or TLSv1.2 as seen below:

return httpPost([
  	uri: [url goes here],
    tlsVersion: "TLSv1.1",
])  

Please let me know if that fixed your problem.


Display charts graphics in tiles
Problems with HTTPS calls going through Cloudflare
(Mark C) #209

yes, you are a genious
down side is, it done that much playing my code is a mess!

updated smartapp


(Mark C) #210

im trying to clean the code up what is def apiPOST used called for, i cant find antying in the smartapp or DH (etrv and adapter) calling it


(Alex Lee) #211

V2.0.1c - Updated and committed with fix. Thanks you @ady624. You’re a star.


(Alex Lee) #212

It’s been imported from some framework code that is the basis of all my device handlers. It maybe the case that no device handlers call apiPOST. Only apiGET and apiPOST need to be updated.


( I hate Mondays) #213

Glad I could help :wink:


(Nav) #214

Hi…hope you are well. I was wondering if you could point me in the right direction on this House Energy Monitor that I have. I have installed your smartapp (thanks!) - but I am not sure which Device Handler to install that corresponds with the House Energy monitor … so that I can see it. I tried the MiHome monitor … but that does not work for this. Do I need to install one of the adapter ones?

Many Thanks


(Andrew Taylor) #215

Smart app now works, but I can’t control either light switches in ST. Is it working for anyone else?


(Mark C) #216

Working fine for me. I modes my SA so it didn’t delete devices when errors occur.
You might need to re add your devices


(Andrew Taylor) #217

Deleted everything previously. Re-added the smart app, my devices were all found, they show in ST, but the TRVs and light switches have no status and I can’t send commands to them. I’ll try refreshing the device handlers and smart app again.


(Mark C) #218

Click refresh in the DH check preferences are filled in on the DH


(Andrew Taylor) #219

Refreshed DH, still can’t control the devices. Something is up!


(Mark C) #220

What is the ide logging showing when you try to switch something on


(Greg) #221

Hi, new user here. New to smartthings and mihome, but not automation. Thanks to everybody who works on making MiHome integrate. Finally got it integrate but a similar story getting responses of 400 and errors and constant reruns when trying to activate switches/adapters. Log shows debug as :

apiGET exception respones groovyx.net.http.HttpResponseDecorator@1a89069e


(Andrew Taylor) #222

Clicking “On” on the lightswitch gets me this:

error Unexpected result in poll(): [400] [status:invalid-controller-or-action]
debug apiGET exception respones groovyx.net.http.HttpResponseDecorator@11b0653b
error Status: 400
debug Executing ‘on’

This all worked fine perfectly before the big TLS issue where I deleted the DH and SA trying to troubleshoot the problem.


(Mark C) #223

What parma are you passing in the http get. What is the path its using


(Mark C) #224

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


(Greg) #225

Hi Mark please excuse my newbie ignorance, where would I look to find the path you posted so I can check mine. Thanks


(Mark C) #226

You would have to add a log.debug line in the apiget section ie log.debug "$ what is in brackets in the apiget