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

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

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.

2 Likes

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

updated smartapp

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

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

1 Like

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.

Glad I could help :wink:

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

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

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

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.

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

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

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

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

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.

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

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:[:]]’

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

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