[NO LONGER SUPPORTED] Ask Alexa

hmmm…send me a screen shot of your app…specifically WHAT it is supposed to be reporting on.

Sent you a possible fix which I will publish if it works…for those that are interested, he is using a DTH that registers ‘Closed’ as a state instead of ‘closed’ (first letter capitalized)…this is non-standard and I had put in a fix before which didn’t make it to the Rooms extension…just fixed that.

Hello @MichaelS , Can you tell me if Ask Alexa is able to change the status of a presence sensor (virtual or not)? Like for example, Alexa, tell Smartthings Heather is IN, or Alexa, tell Smartthings Heather is Leaving.

I run routines based on presence, and since I had tried the pod, Life 360, phone, etc. and nothing is reliable enough. So if you are leaving the house you just say that to Alexa when leaving and it will always be consistent.

I guess if it is not possible just to ask to change the status of a presence sensor, what do you think about the option of adding a virtual switch and name it Heather, then ask, Alexa tell Smatthings to turn Heather off and a webCore with a piston that if heather changed to off then change presence Heather Presence to not present, and so on.

Please let me know. Thanks,

Physical presense sensors can not be changed programically; however, Ask Alexa DOES support virtual presence sensors (http://thingsthataresmart.wiki/index.php?title=Virtual_Presence_Sensor)

When you add the virtual sensor to Ask Alexa, you will have to enable the ‘check in/check out’ commands. After that, be sure to update your developer slots, but that should do it! I use this daily and it works great.

Let me know if you get it all working for you…sounds like you have a good use case for them.

You are a Genius! I just made those changes and everything is working!!
Thanks so much!!!

1 Like

I have been having a great time with Ask Alexa. I just changed the invoke name to house, so it is more natural to say “Alexa tell the house to turn on Bla, Bla, Bla.”

I also made a group called “Security” when I tell Alexa to turn on Security it turns on every light in the house. (Now I just wonder if it will turn on the Aeon Siren) I am hesitant to try when my wife is home.

Now another thing I wish could be done is to use the “Run” command for this type of group. This way I can say in my phrase “Run Security” even more natural.

I know I am being a pain. But I have time to think, and I become dangerous.

Run can actually be used by default. Make sure all of your slots are updated and it should work(with the invocation word of course)

That won’t work as it is the logic I would like to use. Example my Rooms are what I want to use the ON/OFF word, but for security which will turn on all lights in and outside and the siren, I would like to say run, just for macro types not rooms. I know they are the same but not in my flow.

Maybe I am not understanding, but “run” does work with Macros…I use it everyday in my home. I guess I am not clear on what you are saying…Can you give real world names and examples. For example, if you have a macro called security, I would simply say “Alexa, tell SmartThings to run Security”.

Sorry if I am being dense.

You’re not being dense, but I will try again. I said run and it said something about no reports to run. So I tried turn on and it worked. On another thing.

I am trying to implement the UV settings on my Aeon Multisensor. I have it in a report for temperature, but when I try to add it for the UV by checking it in the UV sensors I get that redundancy error. Do I have to set up a report called UV?

Well I setup a report called UV and checked the office multisensor, but when I ask for the report it says can’t find it. I updated the slot for macros.

Ok…So macros,voice reports and weather reports can be RUN…Rooms/Groups can have normal switch functions. So if the functionality is in a ROOM, you are correct you need to turn it on. But more than likely if you simply need to RUN something, a control macro can do the same thing with one command (including turning things on and off).

As for the UV thing, I haven’t played with those. Are you using a standard DTH with the Aeon? How are they implementing the UV functionality (you may need to send me a screenshot of the device DTH).

Here are two screenshots of the device in the IOS app and the Device type

OK then take it out of room and make a macro. Not a problem.

I need the whole IDE DTH page to see how it is implemented. Is it a non-standard DTH?

It is a standard DTH and called as shown above in devices config.

Again, I will need a screenshot of the actual DTH IDE page in order to determine the next steps to take.

/**

  • Copyright 2015 SmartThings
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/

metadata {
definition (name: “Aeon Multisensor 6”, namespace: “smartthings”, author: “SmartThings”) {
capability “Motion Sensor”
capability “Temperature Measurement”
capability “Relative Humidity Measurement”
capability “Illuminance Measurement”
capability “Ultraviolet Index”
capability “Configuration”
capability “Sensor”
capability “Battery”

	attribute "tamper", "enum", ["detected", "clear"]

	fingerprint deviceId: "0x2101", inClusters: "0x5E,0x86,0x72,0x59,0x85,0x73,0x71,0x84,0x80,0x30,0x31,0x70,0x7A", outClusters: "0x5A"
}

simulator {
	status "no motion" : "command: 9881, payload: 00300300"
	status "motion"    : "command: 9881, payload: 003003FF"

	for (int i = 0; i <= 100; i += 20) {
		status "temperature ${i}F": new physicalgraph.zwave.Zwave().securityV1.securityMessageEncapsulation().encapsulate(
			new physicalgraph.zwave.Zwave().sensorMultilevelV2.sensorMultilevelReport(
				scaledSensorValue: i, precision: 1, sensorType: 1, scale: 1)
			).incomingMessage()
	}

	for (int i = 0; i <= 100; i += 20) {
		status "humidity ${i}%":  new physicalgraph.zwave.Zwave().securityV1.securityMessageEncapsulation().encapsulate(
			new physicalgraph.zwave.Zwave().sensorMultilevelV2.sensorMultilevelReport(scaledSensorValue: i, sensorType: 5)
		).incomingMessage()
	}

	for (int i in [0, 20, 89, 100, 200, 500, 1000]) {
		status "illuminance ${i} lux":  new physicalgraph.zwave.Zwave().securityV1.securityMessageEncapsulation().encapsulate(
			new physicalgraph.zwave.Zwave().sensorMultilevelV2.sensorMultilevelReport(scaledSensorValue: i, sensorType: 3)
		).incomingMessage()
	}

	for (int i in [0, 5, 10, 15, 50, 99, 100]) {
		status "battery ${i}%":  new physicalgraph.zwave.Zwave().securityV1.securityMessageEncapsulation().encapsulate(
			new physicalgraph.zwave.Zwave().batteryV1.batteryReport(batteryLevel: i)
		).incomingMessage()
	}
	status "low battery alert":  new physicalgraph.zwave.Zwave().securityV1.securityMessageEncapsulation().encapsulate(
		new physicalgraph.zwave.Zwave().batteryV1.batteryReport(batteryLevel: 255)
	).incomingMessage()

	status "wake up" : "command: 8407, payload: "
}

tiles {
	standardTile("motion", "device.motion", width: 2, height: 2) {
		state "active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0"
		state "inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff"
	}
	valueTile("temperature", "device.temperature", inactiveLabel: false) {
		state "temperature", label:'${currentValue}°',
		backgroundColors:[
			[value: 32, color: "#153591"],
			[value: 44, color: "#1e9cbb"],
			[value: 59, color: "#90d2a7"],
			[value: 74, color: "#44b621"],
			[value: 84, color: "#f1d801"],
			[value: 92, color: "#d04e00"],
			[value: 98, color: "#bc2323"]
		]
	}
	valueTile("humidity", "device.humidity", inactiveLabel: false) {
		state "humidity", label:'${currentValue}% humidity', unit:""
	}
	valueTile("illuminance", "device.illuminance", inactiveLabel: false) {
		state "luminosity", label:'${currentValue} ${unit}', unit:"lux"
	}
	valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat") {
		state "battery", label:'${currentValue}% battery', unit:""
	}

	main(["motion", "temperature", "humidity", "illuminance"])
	details(["motion", "temperature", "humidity", "illuminance", "battery"])
}

}

def updated()
{
if (state.sec && !isConfigured()) {
// in case we miss the SCSR
response(configure())
}
}

def parse(String description)
{
def result = null
if (description.startsWith(“Err 106”)) {
state.sec = 0
result = createEvent( name: “secureInclusion”, value: “failed”, isStateChange: true,
descriptionText: “This sensor failed to complete the network security key exchange. If you are unable to control it via SmartThings, you must remove it from your network and add it again.”)
} else if (description != “updated”) {
def cmd = zwave.parse(description, [0x31: 5, 0x30: 2, 0x84: 1])
if (cmd) {
result = zwaveEvent(cmd)
}
}
log.debug “Parsed ‘${description}’ to ${result.inspect()}”
return result
}

def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd)
{
def result = [createEvent(descriptionText: “${device.displayName} woke up”, isStateChange: false)]

if (!isConfigured()) {
	// we're still in the process of configuring a newly joined device
	log.debug("late configure")
	result += response(configure())
} else {
	result += response(zwave.wakeUpV1.wakeUpNoMoreInformation())
}
result

}

def zwaveEvent(physicalgraph.zwave.commands.securityv1.SecurityMessageEncapsulation cmd) {
def encapsulatedCommand = cmd.encapsulatedCommand([0x31: 5, 0x30: 2, 0x84: 1])
state.sec = 1
log.debug “encapsulated: ${encapsulatedCommand}”
if (encapsulatedCommand) {
zwaveEvent(encapsulatedCommand)
} else {
log.warn “Unable to extract encapsulated cmd from $cmd”
createEvent(descriptionText: cmd.toString())
}
}

def zwaveEvent(physicalgraph.zwave.commands.securityv1.SecurityCommandsSupportedReport cmd) {
response(configure())
}

def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
def map = [ name: “battery”, unit: “%” ]
if (cmd.batteryLevel == 0xFF) {
map.value = 1
map.descriptionText = “${device.displayName} battery is low”
map.isStateChange = true
} else {
map.value = cmd.batteryLevel
}
state.lastbatt = now()
createEvent(map)
}

def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv5.SensorMultilevelReport cmd)
{
def map = [:]
switch (cmd.sensorType) {
case 1:
map.name = “temperature”
def cmdScale = cmd.scale == 1 ? “F” : “C”
map.value = convertTemperatureIfNeeded(cmd.scaledSensorValue, cmdScale, cmd.precision)
map.unit = getTemperatureScale()
break
case 3:
map.name = “illuminance”
map.value = cmd.scaledSensorValue.toInteger()
map.unit = “lux”
break
case 5:
map.name = “humidity”
map.value = cmd.scaledSensorValue.toInteger()
map.unit = “%”
break
case 0x1B:
map.name = “ultravioletIndex”
map.value = cmd.scaledSensorValue.toInteger()
break
default:
map.descriptionText = cmd.toString()
}
createEvent(map)
}

def motionEvent(value) {
def map = [name: “motion”]
if (value) {
map.value = “active”
map.descriptionText = “$device.displayName detected motion”
} else {
map.value = “inactive”
map.descriptionText = “$device.displayName motion has stopped”
}
createEvent(map)
}

def zwaveEvent(physicalgraph.zwave.commands.sensorbinaryv2.SensorBinaryReport cmd) {
setConfigured()
motionEvent(cmd.sensorValue)
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
motionEvent(cmd.value)
}

def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cmd) {
def result =
if (cmd.notificationType == 7) {
switch (cmd.event) {
case 0:
result << motionEvent(0)
result << createEvent(name: “tamper”, value: “clear”, displayed: false)
break
case 3:
result << createEvent(name: “tamper”, value: “detected”, descriptionText: “$device.displayName was moved”)
break
case 7:
result << motionEvent(1)
break
}
} else {
result << createEvent(descriptionText: cmd.toString(), isStateChange: false)
}
result
}

def zwaveEvent(physicalgraph.zwave.Command cmd) {
createEvent(descriptionText: cmd.toString(), isStateChange: false)
}

def configure() {
// This sensor joins as a secure device if you double-click the button to include it
if (device.device.rawDescription =~ /98/ && !state.sec) {
log.debug “Multi 6 not sending configure until secure”
return
}
log.debug “Multi 6 configure()”
def request = [
// send no-motion report 20 seconds after motion stops
zwave.configurationV1.configurationSet(parameterNumber: 3, size: 2, scaledConfigurationValue: 20),

	// report every 8 minutes (threshold reports don't work on battery power)
	zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 8*60),

	// report automatically on threshold change
	zwave.configurationV1.configurationSet(parameterNumber: 40, size: 1, scaledConfigurationValue: 1),

	zwave.batteryV1.batteryGet(),
	zwave.sensorBinaryV2.sensorBinaryGet(sensorType: 0x0C),
]
commands(request) + ["delay 20000", zwave.wakeUpV1.wakeUpNoMoreInformation().format()]

}

private setConfigured() {
updateDataValue(“configured”, “true”)
}

private isConfigured() {
getDataValue(“configured”) == “true”
}

private command(physicalgraph.zwave.Command cmd) {
if (state.sec) {
zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
} else {
cmd.format()
}
}

private commands(commands, delay=200) {
delayBetween(commands.collect{ command(it) }, delay)
}

Can you actually take a screenshot instead of just copying the information? It will make it much easier.

Something like this:

I posted the code above your post, but here is the screenshot.

I just updated the voice report to 1.0.6a to fix the issue Joel (@joelw135) pointed out…thanks Joel…

This ONLY affects UV in the voice reports…no need to update if everything is working well for you.

I am getting the below error when trying to save the Sample Uttarances. Can you please let me know how to fix it? or its ok to delete this line?

Error: There was a problem with your request: Unknown slot name ‘{xParam}’.This error occurred in sample ‘MacroOperation {Macro} {xParam}’ on line 448.