Thank you for your reply. The attribute is defined as an enum and provides an array with the five arrows supported as strings. The device page shows the arrow alright, but the device code itself, upon trying to check if the value changed, always gets null as the currentValue. The event log also shows the attribute always changing to the same value.
nvm... found my issue
@Field TREND_ARROWS = ["↑", "↘", "→", "↗", "↑"]
@Field TREND_MESSAGES = ["Rising rapidly", "Rising", "Steady", "Dropping", "Dropping rapidly"]
metadata {
definition(name: "Freestyle Libre User", namespace: "ady624", author: "Adrian Caramaliu") {
capability "Refresh"
attribute "firstName", "string"
attribute "lastName", "string"
attribute "country", "string"
attribute "sensorSerialNumber", "string"
attribute "sensorActivated", "long"
attribute "glucoseTargetLow", "int"
attribute "glucoseTargetHigh", "int"
attribute "glucoseTimestamp", "long"
attribute "glucose", "int"
attribute "glucoseTrend", "int"
attribute "glucoseTrentArrow", "enum", TREND_ARROWS <<< MISSPELLED Trend as Trent GRRR
attribute "glucoseTrendMessage", "enum", TREND_MESSAGES
}
preferences {
}
}
void update(user) {
updateAttribute("firstName", user.firstName as String)
updateAttribute("lastName", user.lastName as String)
updateAttribute("country", user.country as String)
updateAttribute("sensorSerialNumber", user.sensorSerialNumber as String)
updateAttribute("sensorActivated", user.sensorActivated as long)
updateAttribute("glucoseTargetLow", user.glucoseTargetLow as int)
updateAttribute("glucoseTargetHigh", user.glucoseTargetHigh as int)
updateAttribute("glucoseTimestamp", user.glucoseTimestamp as long)
updateAttribute("glucose", user.glucose as int, "mg/dL")
updateAttribute("glucoseTrend", user.glucoseTrend as int)
updateAttribute("glucoseTrendArrow", getTrendArrow(user.glucoseTrend) as String)
updateAttribute("glucoseTrendMessage", getTrendMessage(user.glucoseTrend) as String)
}
Thank you so much for your time!
Adrian