Passing integers and text to webCORE

Newbie here but not illiterate with programming (just illiterate with groovy). I’ve created a webCORE piston to control my evaporative cooler and conventional A/C based on outdoor temperature and humidity. The piston is working great (I’m quite proud of it) so no issue there, but I’d like to have a ST device (not smartapp) that represents as a physical device in webCoRE with a combination of integers and strings. I’ve spent 2 days trying to use ST device handler templates and virtual devices without any luck. I don’t need webCORE to pass anything back to ST (a bonus, but not needed). I need 6 integers and 3 strings in my custom device to be recognized as a physical device in webCORE. I wouldn’t think it’s very difficult but I’m ready to give up. I have a master switch created to start and stop the Piston, but adding integers as a variable seems to be my hang-up. I’ve tried the virtual alarm, button, thermostat,… and no help to use any of these as a template. Maybe I’ve been using the wrong search terms. Any help would be appreciated.

Can you share a link to your device handler?
I know I tried sending a value with this handler but if I recall, you need to stay within the guides of known names? IOW, I dont think you can just send arbitrary named values, but I could totally be wrong

I don’t have one to share. I am wanting to create a device handler using another as a template. I’ve not found one with both integers and strings.

If you want to pass integers to Webcore from ST you can do it, as long as the numbers are between 0 and 100, by creating a Virtual Dimmer. Just set the value you want as a % in the dimmer in ST, then extract that value into a variable in your piston. You can pass values back using the same method.

I’m not really sure that I understand want you want. A DTH with six integers and three strings that can be read and set by webCoRE would have a structure a bit like this:

metadata
{
	definition( name: 'Strings and Integers', namespace: 'whatever', author: 'Me' )
    {
    	capability 'Actuator'
		capability 'Sensor'
        
        attribute 'integer1', 'number'
        attribute 'integer2', 'number'
        attribute 'integer3', 'number'
        attribute 'integer4', 'number'
        attribute 'integer5', 'number'
        attribute 'integer6', 'number'
        attribute 'string1',  'string'
        attribute 'string2',  'string'
        attribute 'string3',  'string'
        
        command 'setinteger1'
        command 'setinteger2'
        command 'setinteger3'
        command 'setinteger4'
        command 'setinteger5'
        command 'setinteger6'
        command 'setstring1'
        command 'setstring2'
        command 'setstring3'
	}
}


def installed()
{	
    sendEvent( name: 'integer1', value: 1 )
    sendEvent( name: 'integer2', value: 2 )
    sendEvent( name: 'integer3', value: 3 )
    sendEvent( name: 'integer4', value: 4 )
    sendEvent( name: 'integer5', value: 5 )
    sendEvent( name: 'integer6', value: 6 )
    sendEvent( name: 'string1',  value: 'one' )
    sendEvent( name: 'string2',  value: 'two' )
    sendEvent( name: 'string3',  value: 'three' )
}

def updated()
{
}

def parse( String description )
{
}

def setter( name, value )
{
	sendEvent( name: name, value: value )
}

def setinteger1( value )
{
	setter( 'integer1', value )
}

def setinteger2( value )
{
	setter( 'integer2', value )
}

def setinteger3( value )
{
	setter( 'integer3', value )
}

def setinteger4( value )
{
	setter( 'integer4', value )
}

def setinteger5( value )
{
	setter( 'integer5', value )
}

def setinteger6( value )
{
	setter( 'integer6', value )
}

def setstring1( value )
{
	setter( 'string1', value )
}

def setstring2( value )
{
	setter( 'string2', value )
}

def setstring3( value )
{
	setter( 'string3', value )
}

Thanks. I get empty devices when I install it and create a device. It’s the same for both the new and classic ST.

I didn’t include any tiles for the ‘Classic’ app. I don’t bother with that any more.

I wouldn’t expect to see anything in the new app as there aren’t any standard capabilities for it to display. If you look at it in the IDE you’ll see the attributes populated and webCoRE will be able to set and read the attributes.

I haven’t quite worked out what you are trying to achieve. You said you “don’t need webCoRE to pass anything back to ST”, so how were you intending the integers and strings to be set?

I’m wanting the ST device to give me a way to input the integers and strings so webCORE can read them as a physical device - like a thermostat would do. Otherwise I’m having to edit in webCORE. The slider example for an integer input isn’t good and a pain in the ass to adjust the temperature by one degree. I’d prefer just data entry boxes in ST.

Oh right. That could be lashed up via the device prefs temporarily, or otherwise it would require textFields or numberFields in custom capabilities and as they are only in alpha test you might find yourself a bit ahead of the curve at the moment.

I decided I could get by with only passing integers and found a solution in this post.

This gives me a device in ST classic where I can enter my variables to my webCORE piston. It doesn’t work in the new ST so I need to find out if I can get the same device for entering variables in the new ST app.