WebCore variable device name help

Hey all I am using this app and using the description field to specify a switch name. https://community.hubitat.com/t/release-google-calendar-task-and-gmail-search-and-gmail-notification-device/71397

How do I set a Variable and use that variable to have webcore toggle the switch defined in the variable?

Example: description = kitchen

I want webcore to do something like with {description} turn on ( or how ever it’s worded)

Under notes I have a switch name. I want to turn that switch on/off but I want to use it from a variable.

image

Instead of “Test Switch” I want that to be a variable ( which will be a switch device name KitchenBright )

I use this app often with webcore, but I'm not sure what you are asking. Can you give a little more detail and maybe some screen shots?

I updated my post with screen caps and more details. Hopefully they make sense.

You can define a global variable at the bottom of the edit page if you start it with a @.
For a local var you can use tick the box somewhere up top that shows variable, complex and extended statements etc.
That will give you a new area at the top to define local vars and assign them to a device, static, etc.

1 Like

Thank you. The issue I’m having is that I can not figure out how to use the variable as a switch once it’s defined.

I think I’ve figured it out. I didn’t realize there was a variable type of device.

@Keo if I am following your question correctly the app actually supports it under additional actions in your search trigger. It can parse fields within the Google items, like calendar events, and turn switches on/off based on text within the item. So webcore wouldn’t be needed.

Your description of the calendar event could be turn on kitchen, turn off dining room and it will math that against switches you define within the search trigger.

1 Like

I’ll take a look again. Thanks

1 Like

I agree. If you are just turning a variable on/off, then webcore would not be needed. I have several things that happen with specific Google calendar events, so I use webcore to make those things happen.

Well I am doing more of a regex match that allows me to make mistakes in the switch name. Like ignoring case and extra spaces.

I don’t want to have to trouble shoot things if I type the switch name differently.

@keo Would the ability to map GCal event attributes to Hub Variables be useful?
image

This would be added to the Additional Actions section of the GCal Search Triggers but idea is at the start of the event, the variables chosen would be updated with the value from the Google Item (calendar event in your case) and then at the scheduled end it will blank out the variable value. Above screenshot is just a quick example of what things could look like.

3 Likes

Sounds like it would work.

1 Like

@Keo a new version of GCal Search has been uploaded that adds the above functionality:

1 Like