Philio Door/Temp/Luinance Device Type


(Tim Slagle) #1

Hey all,

Can someone please provide a device type for the philio multi sensor from tiger direct? I found it on the old forums but the migration made it quite unusable lol. If any one has it it would be a big help to get that up and running. thanks!!!

@johnconstantelo @llcanada @coryds I saw the original thread with you three in it. Help please :smile:


Zipato Door Sensors with motion detect? Anyone try these yet?
Open/close sensor not identified as such
(Ben Edwards) #2

I did my best to clean up the code formatting. Here is a link to the post I think you are referring to. There is still some problem with the top of the code.


(Tim Slagle) #3

Thanks Ben. The biggest problem with the migration and code is all the special characters were replaced with something crazy. For example a " is replaced with “quot;” and if there is a ) after that I will replace it with “quotwink” lol. II have something that is kind of working but… The luminosity will only update when the door/window sensor is tripped either on open or close. Not sure how to fix that.

Do you guys have a way to go to the old site and pull the code that was originally posted in its original format and post it here? :slight_smile:


Philio PSP01-2 Motion Light Temperature Z Wave Sensor
(llcanada) #4

@tslagle13 below is the code that I’m using.

/**
 *  Philio PSM01 Z-Wave Multi-sensor. Detects door/window opening, ambient light, ambient temperature
 *
 *  Capabilities to enable: battery, contact, illuminace, temperature, poll, refresh, sensor
 *
 *  Author: SmartThings, jscgs350
 *  Date: 2013-11-3, 2014-3-12
 */

// for the UI
metadata {
	// Automatically generated. Make future change here.
	definition (name: "Door Sensor", author: "jsconst@gmail.com") {
		capability "Contact Sensor"
		capability "Temperature Measurement"
		capability "Sensor"
		capability "Illuminance Measurement"
		capability "Battery"
		capability "Refresh"
		capability "Polling"
	}

	simulator {

		status "open"	: "command: 3003, payload: FF"
		status "closed"	: "command: 3003, payload: 00"

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

		for (int i = 0; i <= 100; i += 20) {
			status "luminance ${i} lux": new physicalgraph.zwave.Zwave().sensorMultilevelV2.sensorMultilevelReport(
				scaledSensorValue: i, precision: 0, sensorType: 3).incomingMessage()
		}
		for (int i = 200; i <= 1000; i += 200) {
			status "luminance ${i} lux": new physicalgraph.zwave.Zwave().sensorMultilevelV2.sensorMultilevelReport(
				scaledSensorValue: i, precision: 0, sensorType: 3).incomingMessage()
		}

		for (int i = 0; i <= 100; i += 20) {
			status "battery ${i}%": new physicalgraph.zwave.Zwave().batteryV1.batteryReport(
				batteryLevel: i).incomingMessage()
		}
	}

	tiles {
		standardTile("contact", "device.contact", width: 2, height: 2) {
			state "open", label: 'Front Door\nDoor\n${name}', icon: "st.contact.contact.open", backgroundColor: "#ffa81e"
			state "closed", label: 'Front Door\nDoor\n${name}', icon: "st.contact.contact.closed", backgroundColor: "#79b821"
		}
		valueTile("temperature", "device.temperature", inactiveLabel: false) {
			state "temperature", label:'${currentValue}°',
			backgroundColors:[
				[value: 31, color: "#153591"],
				[value: 44, color: "#1e9cbb"],
				[value: 59, color: "#90d2a7"],
				[value: 74, color: "#44b621"],
				[value: 84, color: "#f1d801"],
				[value: 95, color: "#d04e00"],
				[value: 96, color: "#bc2323"]
			]
		}
		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:""
		}
		standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
			state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
		}        

		main(["contact", "temperature", "illuminance"])
		details(["contact", "temperature", "illuminance", "battery", "refresh"])
	}
}

// Parse incoming device messages to generate events
def parse(String description)
{
	def result = []
	def cmd = zwave.parse(description, [0x31: 2, 0x30: 1, 0x84: 1, 0x20: 1, 0x70: 1, 0x80: 1, 0x01: 1])
	if (cmd) {
		if( cmd.CMD == "8407" ) { result << new physicalgraph.device.HubAction(zwave.wakeUpV1.wakeUpNoMoreInformation().format()) }
		result << createEvent(zwaveEvent(cmd))
	}
	log.debug "Parse returned ${result}"
	return result
}

// Event Generation
def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd)
{
	[descriptionText: "${device.displayName} woke up", isStateChange: false]
}

def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv2.SensorMultilevelReport cmd)
{
	def map = [:]
	switch (cmd.sensorType) {
		case 1:
			// temperature
			def cmdScale = cmd.scale == 1 ? "F" : "C"
			map.value = convertTemperatureIfNeeded(cmd.scaledSensorValue, cmdScale, cmd.precision)
			map.unit = getTemperatureScale()
			map.name = "temperature"
			break;
		case 3:
			// luminance
			map.value = cmd.scaledSensorValue.toInteger().toString()
			map.unit = "lux"
			map.name = "illuminance"
			break;
		case 5:
			// humidity
			map.value = cmd.scaledSensorValue.toInteger().toString()
			map.unit = "%"
			map.name = "humidity"
			break;
	}
	map
}

def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
	def map = [:]
	map.name = "battery"
	map.value = cmd.batteryLevel > 0 ? cmd.batteryLevel.toString() : 1
	map.unit = "%"
	map.displayed = false
	map
}

def sensorValueEvent(Short value) {
	if (value) {
		createEvent(name: "contact", value: "open", descriptionText: "$device.displayName is open")
	} else {
		createEvent(name: "contact", value: "closed", descriptionText: "$device.displayName is closed")
	}
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd)
{
	sensorValueEvent(cmd.value)
}

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

def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd)
{
	sensorValueEvent(cmd.value)
}

def zwaveEvent(physicalgraph.zwave.commands.sensorbinaryv1.SensorBinaryReport cmd)
{
	sensorValueEvent(cmd.sensorValue)
}

def zwaveEvent(physicalgraph.zwave.Command cmd) {
	log.debug "Catchall reached for cmd: ${cmd.toString()}}"
	[:]
}

Don’t forget you have to create a new device in the IDE. Sorry I didn’t see this till today. Hope it helps.


(Tim Slagle) #5

Thanks @llcanada! Really appreciate this! I think i had something going but LUX was never reporting without another event. I am going to give this code a try incase mine was different slightly. Do you see that problem too?


(llcanada) #6

@tslagle13 is this working for you? I really don’t do anything with the LUX portion, so I rarely look at it but maybe I should as a example when front open if it dark then light comes on. Let me know how it is working for you or did you go back to your app? Thanks.


(Tim Slagle) #7

Do not get the updates on the LUX setting unless the door is opened and closed.
i just removed that from the device type so now it is just a open and close sensor to me :smile:


(Paul) #8

I am new to the SmartThing of Worlds (hmmm like two days) and I am already trying to go beyond my limited capabilities.

Here is what I found out so far:

Another post made a mention the Philio is recognized as a Aeon Labs Multi Sensor. I believe this is because the device code is wrong. In the sample source of the Aeon Labs multi sensor, the device code is set 0x2001, but I believe this should be 0x2101 (assuming it comes from the weak hash 04-21-01).

I can see the events in the Activity Feed so the device is working, but the contact is treated as a motion. I can confirm that I see temperature and luminance measurement events coming only when a “motion” event occurred. There seem to be auto report parameters for temperature and illumination which can be for increments of thirty minutes; default seams to be every six hours.

I started to implement the above code, piece by piece, so it is not all there yet, but contact should work and I ran into two issues for now.

  1. Icon background colors does not seem to work.

  2. It seems to work with the virtual device, but when I use the actual device PSM02, the only event I receive is a wake up event, but no other event. (With the Aeon Multi Sensor device I can see multiple events come in).

Any thoughts?


(Daniel Consuegra) #9

Hi all!

Another question to the mix…

I read somewhere that the Philio PSM01 Z-Wave Multi-sensor has a motion sensor… as well as the open/close sensor…

Anyone know how I can reach that sensor? I could really use the motion part…

Ideas for a non-programmer? :smiley:


(Paul) #10

@danielccm

The PSM01 is a contact, temperature, luminance multi-sensor, but it does not support motion. The PSM02 and PSP01 do support motion.


(Daniel Consuegra) #11

Ouch! Thanks for the info…lol!


(Ian D) #12

I’ve just installed my first Philio PSM01 with the Device Type in this thread. It works well, except that I don’t ever get luminosity and temperature updates unless the contact sensor gets turned on or off. Is there a way to fix this? I really would like the temperature to be updated.
Thanks


(Paul) #13

Looking at the manual for the PSM01 https://doc.eedomus.com/files/philio_psm01_manual-2013-12-04.pdf, the reporting of the temperature may be disabled by default.

Temperature Report
When the door/window state changed, the device will unsolicited to send the “Sensor Multilevel Report” to the nodes in the group 1. Sensor Type: Temperature (0x01) Note: To disable this functionality by setting the configuration setting N0.5, the bit5 of the value to 1.
Temperature differential report
This function default is disabled, to enable by setting the configuration setting NO.6 bit6 to 1. When the temperature plus or minus three degree Fahrenheit (1.67 degree Celsius), the device will report temperature information to the nodes in the group 1. The device will measure the temperature in every 64 seconds. And if the temperature is over 140 degree Fahrenheit (60 degree Celsius), the device also report in each measurement.


(Ian D) #14

ok… how can I change those settings?


(Paul) #15

You will have to change the device type handler to send the configuration parameters to the device. As this is a battery operated device, you can send the parameters after receiving a wake up notification.


(Ian D) #16

Paul, I’m afraid this is beyond my knowledge. I have played around smart apps, but not device types. Can you show me how to do that please?


(Paul) #17

I would use zwave.configurationV1.configurationSet with the parameters specified in the manual. The easiest place to put it, is here

if( cmd.CMD == "8407" ) { result << new physicalgraph.device.HubAction(zwave.wakeUpV1.wakeUpNoMoreInformation().format()) }

Not having the device, I don’t feel comfortable to write the actual code without the ability to test it.


#18

Hi Folks, ( @llcanada @tslagle13 @psfunatyo )

I’ve updated that device type not too long ago and added the config parameter changes. I think you need to tap the config tile as soon as the device is triggered by the open/close sensor and it lights up red (if I remember right):

(I do get temp and lux updates)

https://github.com/constjs/SmartThings-Devices/blob/master/philio_psm01.device.groovy


(Ian D) #19

Thanks john! Works nicely!


#20

Cool, glad that works for ya’!