[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)

Yes, enable restrictions, the filter icon

1 Like

How do i type in the times for a “between” restriction?

anyone? thanks!!

EDIT Once again I got it. More wine needed.

1 Like

what’s the equivalent of a OR-IF piston. at line 39 in this piston is where it was an OR-IF piston in regular core.

is there a special way to do it?

Drag it out of the THEN section for your first IF. Unless you only want it to run when the conditions up top are met.

like this?

Correct. Only other thing I might suggest is adding a subscription to at least one device each in the first two groups

thanks for that. the $previousDeviceState did show up in the drop down list, hence trying to use it.
But the previousAge function did the job in the end with a bit of trial & error e.g.
previousAge([Central Heating Control : thermostatMode]) /1000 /60

can you please explain what adding a subscription does? how would it be of benefit? thanks!!

EDIT: I just went into the piston and selected one of the conditions. Actually they all say “automatic” for event subscription. I read the wiki but I’m still unclear of what this feature does.

Thank you.

‘subscription’ refers to webCoRE ‘listening’ for events coming from individual devices, which could trigger the piston to fire. Right now, the only event that webCoRE is litening for, is Contact Sensor 6. I suggest changing the condition for that sensor to ‘is’ instead of ‘changes to’. Or change the subscription like @c1arkbar suggested, to ‘always subscribe’.

1 Like

So like @SBDOBRESCU mentioned it tells webcore what events you are listening for. If you do not have any subscriptions then your piston will never fire unless another piston executes it. (How a follow up piston worked in CoRE).

So in the top if you need to tell webcore what you want it to listen for. Otherwise it won’t execute based on anything up there. Conditions automatically subscribe until a trigger is introduced. Then conditions become more like restrictions. Since you have a trigger at the bottom you need to force a subscription (always subscribe) on one of the conditions in each group up top.

2 Likes

@anon36505037 Is this piston working for you to track lux changes? I have tried implementing this in a piston and even by itself and the lux isn’t being stored in the variable:

This is the piston I’m trying to add the code to:

Thanks

Playing music with webcore: I’ve recently gotten a Samsung WAM1500. I’ve figured out a good way to set up an automatic sleep timer as part of my bedtime routine, but I’m having trouble figuring out how to get webcore / ST to tell the speaker to play music / what music to play. I generally listen to either a TuneIn station or Artist Radio on Spotify with it. If I have to control it via an app, that’s not the worst thing in the world, just trying to streamline it a little since it’s a pretty standard thing.

Has anyone figured this out?

Thank for looking Robin.
My old Lux change was the following:

This worked all the time but I thought I would go with what you mentioned about bringing the variables inside the controlling piston.

Lol - I use lux changes throughout the house for in the day time - here in the UK the lux changes so frequently, especially when its raining out

@anon36505037 do you mean the following is how your lux changer is setup?

Thanks for the help

hmmm - when the conditions are set in their own piston (basically importing noz3), lux variable changes. However when I add the individual items to the other full piston, it doest report the new lux settings:

+1ms ╔Received event [Motion Sensor - Kitchen].motion = inactive with a delay of 121ms
+248ms ║Runtime (33609 bytes) successfully initialized in 108ms (v0.1.0ad.20170519) (246ms)
+249ms ║╔Execution stage started
+308ms ║║Executed virtual command [Kitchen Light].wait (2ms)
+310ms ║║Requesting a wake up for Sat, May 20 2017 @ 11:00:26 PM BST (in 45.0s)
+477ms ║╚Execution stage complete. (228ms)
+546ms ║Setting up scheduled job for Sat, May 20 2017 @ 11:00:26 PM BST (in 44.766s)
+569ms ╚Event processed successfully (569ms)
20/05/2017, 22:59:31 +924ms
+2ms ╔Received event [Motion Sensor - Kitchen].illuminance = 93 with a delay of 268ms
+1052ms ║Piston waited at a semaphore for 817ms
+1055ms ║Runtime (33675 bytes) successfully initialized in 898ms (v0.1.0ad.20170519) (1052ms)
+1056ms ║╔Execution stage started
+1143ms ║║Executed [Kitchen Light].on (41ms)
+1395ms ║╚Execution stage complete. (340ms)
+1474ms ╚Event processed successfully (1473ms)
20/05/2017, 22:59:31 +709ms
+2ms ╔Received event [Motion Sensor - Kitchen].motion = active with a delay of 106ms
+416ms ║Runtime (33609 bytes) successfully initialized in 282ms (v0.1.0ad.20170519) (414ms)
+418ms ║╔Execution stage started
+510ms ║║Executed [Kitchen Light].on (50ms)
+675ms ║╚Execution stage complete. (257ms)
+747ms ╚Event processed successfully (747ms)

Can I set a variable to the average of several devices inside an “every” loop? For example I’d like to get the average temp from several temp sensors every x minutes and save it for use elsewhere in a global var.

This type of calc seem like it was possible but I can’t find where it is.

I am trying to pull the URI of the currently playing track on a sonos speaker and then use that elsewhere. I am able to pull all of the track data and store that in a variable, but it is more text than just the URI itself. Is there a way to get a substring of the variable text I stored?

It ends up setting currentTrack to “{“station”:“RINCON_5CAAFDA596E801400”,“name”:null,“artist”:null,“album”:null,“trackNumber”:“1”,“status”:“playing”,“level”:”",“uri”:“x-sonos-htastream:RINCON_5CAAFDA596E801400:spdif”,“trackUri”:“x-sonos-htastream:RINCON_5CAAFDA596E801400:spdif”,“transportUri”:“x-sonos-htastream:RINCON_5CAAFDA596E801400:spdif”,“enqueuedUri”:"",“metaData”:“RINCON_5CAAFDA596E801400<\u002fdc:title>object.item.audioItem<\u002fupnp:class>x-sonos-htastream:RINCON_5CAAFDA596E801400:spdif<\u002fres><\u002fitem><\u002fDIDL-Lite>”,“trackMetaData”:“x-sonos-htastream:RINCON_5CAAFDA596E801400:spdif<\u002fres><\u002fr:audioInputIcon>21<\u002fr:streamInfo> <\u002fdc:title>object.item<\u002fupnp:class><\u002fitem><\u002fDIDL-Lite>”}"

1 Like

@anon36505037 - thank you Robin. That seems to work. Setting the wait ‘Else…With’ on the wait to async does seem to be populating the the variable now. Lol its dark here so Im testing but holding my phone torch to the sensor (making sure to not trigger the motion) and the value is now changing.

Thank you for the help

1 Like

@Michael_D I have the same issue. I can pull out the full data string to a variable but can’t find out a way to use the URI. CoRE handled this pretty well

I got it working, found the functions section of the wiki. maybe not the cleanest way to implement, but it works.

1 Like