Hoping it may be possible using the Device Extentions plugin to convert a device state like 100.00%, or less, to a simple integer, 100, 90, 5 etc? I'm trying to trigger from a luminance sensor value.
The state always includes the .00% at the end.
Thanks,
Carl
Help With Conversion
Re: Help With Conversion
Are you sure the value actually includes the %?
Indigo supports readings having two values. The raw value (eg 100) and the UI value (eg 100% or 100’c).
The figure you see will generally be the UI one, but try creating a trigger and you’ll often find it allows <100, >85 etc.
Sent from my iPhone using Tapatalk Pro
Indigo supports readings having two values. The raw value (eg 100) and the UI value (eg 100% or 100’c).
The figure you see will generally be the UI one, but try creating a trigger and you’ll often find it allows <100, >85 etc.
Sent from my iPhone using Tapatalk Pro
- Colorado4Wheeler
- Posts: 2794
- Joined: Mon Jul 20, 2009 10:48 am
- Location: Colorado
Re: Help With Conversion
As Howard says, the % is generally a UI value, but you can still do this with DE by using the 'Convert to String' option and chopping off the last character. You can also use the String to Number conversion to get what you are looking for - which could be better since it will allow you to convert to an integer (no decimals) or a float (decimals) and you can decide how many decimal places you want it to have.
My Modest Contributions to Indigo:
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
Re: Help With Conversion
The device state shows the % sign when using the sensorValue (UI Value), but not when just using sensorValue.
Seems to be working fine.
Thanks,
Carl
Seems to be working fine.
Thanks,
Carl
- Colorado4Wheeler
- Posts: 2794
- Joined: Mon Jul 20, 2009 10:48 am
- Location: Colorado
Re: Help With Conversion
Yup, that's exactly what you should be seeing.ckeyes888 wrote:The device state shows the % sign when using the sensorValue (UI Value), but not when just using sensorValue.
Seems to be working fine.
Thanks,
Carl
My Modest Contributions to Indigo:
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here