[OBSOLETE] Xiaomi Sensors and Button (beta)

@a4refillpad Could you add decimal and temperature shifting support to the outlet DTH? It will be highly appreciated!

No, sorry it’s not available from the device.

Decimals or temperature at all not available? We have temperature data displayed on device page. Does this number mean nothing?

Neither decimals or auto updates are available. You need to poll/refresh to get updates. The device does not push changes nor can I find any way of updating the default behaviour of the outlet.

Edit
Actually misunderstood your shifting request. Yes it is possible to put an offset in like I did with the humidity sensor.

I would think that this type of device definitely needs temp offset feature, Even with the offset I don’t think you could get reliable data. Doesn’t any type of device that drops voltage (120V to 5V for the USB’s) generate heat? Wouldn’t the amount of heat vary with load?

Yes, I think it’s best to just use it as a gauge of how warm the outlet is getting. Not great as sole source of temperature for a room. Also locations of outlets aren’t generally best for measuring room temps.

@a4refillpad any plans on updating your dth to Smartthings new color theme?

http://docs.smartthings.com/en/latest/device-type-developers-guide/tiles-metadata.html

I know absolutely nothing about programming but I poked around in the device handler to make humidity the main focus. I have everything as I’d like it except I can’t figure how to have the humidity value to show in the the list of devices. (see pic 2) Any help would be appreciated

pic 2

.

Got it!

Thanks
Also changed line 77 from
state “default”, label:’${currentValue}°’, icon:"st.Weather.weather12
to
state “default”, label:’${currentValue}°’, icon:"st.Weather.weather2"
to change the icon

also changed the degree symbol to %. Don’t remember which line was change.

1 Like

Looks like you don’t need any help now but you need to charge your battery :nerd_face:

2 Likes

When I only changed line 115 from temperature2 to humidity the main tile did show humidity but so did the smaller tile below. I changed a few other lines and things are workings. Line 115 is now “temperture”

Trail and error + the infinite monkey theorem.

It’s good to tinker and make some changes :+1: but only if you learn something from it :smiling_face: i.e you know ‘why changing this - did that’ getting something to work but not knowing exactly what you’ve done is not an approach I’d recommend.

[quote]When I only changed line 115 from temperature2 to humidity the main tile did show humidity but so did the smaller tile below. I changed a few other lines and things are workings. Line 115 is now “temperture”
[/quote]

You’ve lost me :astonished:

My mistake . When I changed line 115 it did change the large tile to show humidity but in the list of devices it was still showing temperature. I have to pull the original code to see what I changes I made. Line 115 is now: main([“temperature”])

Here’s what I have. I didn’t change anything above line 57 or below line 119

// UI tile definitions
tiles(scale: 2) {
	multiAttributeTile(name:"temperature", type:"generic", width:6, height:4) {
		tileAttribute("device.humidity", key:"PRIMARY_CONTROL"){
		    attributeState("default", label:'${currentValue}%',
            backgroundColors:[
				[value: 0, color: "#153591"],
				[value: 5, color: "#1e9cbb"],
				[value: 10, color: "#90d2a7"],
				[value: 15, color: "#44b621"],
				[value: 20, color: "#f1d801"],
				[value: 25, color: "#d04e00"],
				[value: 30, color: "#10cec1"],
				[value: 44, color: "#10bc2d"],
				[value: 59, color: "#90d2a7"],
				[value: 74, color: "#44b621"],
				[value: 84, color: "#f1d801"],
				[value: 95, color: "#d04e00"],
				[value: 96, color: "#bc2323"]                                      
			]
		)
        }
        tileAttribute("device.lastCheckin", key: "SECONDARY_CONTROL") {
			attributeState("default", label:'Last Update: ${currentValue}', icon: "st.Health & Wellness.health9")
		}
	}
	standardTile("humidity", "device.temperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
		state "default", label:'${currentValue}°', icon:"st.Weather.weather2"
	}
    
    valueTile("battery", "device.battery", decoration: "flat", inactiveLabel: false, width: 2, height: 2) {
		state "default", label:'${currentValue}% battery', unit:""
	}
    
	valueTile("temperature", "device.humidity", decoration: "flat", inactiveLabel: false) {
		state "default", label:'${currentValue}%', icon: "st.Weather.weather2",
            backgroundColors:[
				[value: 0, color: "#153591"],
				[value: 5, color: "#1e9cbb"],
				[value: 10, color: "#90d2a7"],
				[value: 15, color: "#44b621"],
				[value: 20, color: "#f1d801"],
				[value: 25, color: "#d04e00"],
				[value: 30, color: "#10cec1"],
				[value: 44, color: "#10bc2d"],
				[value: 59, color: "#90d2a7"],
				[value: 74, color: "#44b621"],
				[value: 84, color: "#f1d801"],
				[value: 95, color: "#d04e00"],
				[value: 96, color: "#bc2323"]                                      
			]
    }

	standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
		state "default", action:"refresh.refresh", icon:"st.secondary.refresh"
    }
        
	main(["temperature"])
	details(["temperature", "battery", "humidity","refresh"])
}

}

I’m actually working on a bunch of updates which include the colour scheme changes. Will release once all stable.

2 Likes

I’m not completely buying that it’s a firmware limitation, because motion sensing is immediately reset before the battery populates in the DH right after pairing. Literally, as soon as motion is reset, I can re-trigger the motion – but only until battery reports for the first time, then it’s crippled.

The 60 seconds doesn’t apply until the DH is fully paired and working. There’s got to be a way to change the behavior with the DH, no? We’re not modifying the device, just receiving info from it.

Please refer to this: [OBSOLETE] Xiaomi Sensors and Button (beta) - #507 by rolled54.Why

And if you can read Chinese, here is the page:
http://www.lumiunited.com/nav/service/faq-mb.php6

If you cannot read Chinese, and you trust my translation:

2 Likes

Ok, this makes much more sense, thanks. Essentially, the device goes into a test mode for 2 hours after pairing (which is when the battery isn’t reported in the DH). After 2 hours, it exits the test mode and the DH fully pairs, but the reset interval goes from 5 seconds to 60 seconds.

If only we could figure out how to keep it in test mode. :slight_smile:

I let Google translate the FAQ. Here’s the description of the test mode:

Hey. I’m trying to find out the same information you are. If you have figured this out please pm me. But for the case you are asking about, I’m using the leeo smart alert. I made a ghetto dht for it using ifttt, but even without that, you can just make a virtual switch and have that turn on and off with routine changes. Have that send a command to the leeo. I’m using different colors designating the shm mode.

But. Does anyone have ANY idea about the gateway being able to pair? I know it is essentially another hub, but I think that it could be a very cool alternative to the aeotec doorbell.