webCoRE for Hubitat Updates

I look at it a different way.
It's not just me then!!! :slight_smile: :smiley:

I have been moving pistons from smartthings to HE.
This one is quite simple...but it doesn't work and it says Device not found
any suggestions ?

ignore my question....i had to go back into devices and recheck the den button.... although usually it shows the cryptic 30-40 char device name...but in the case above the piston seemed happy...anyways fixed

Hi guys, looking for some help with the below piston. This seems to have something to do with the interaction between a Hubitat virtual switch that triggers the piston and the task cancellation policies in the piston.

The Hubitat virtual switch is set to auto turn off after 1 second. I want the piston to continue executing when the switch turns itself off, but it doesn't. I cannot figure out why. I have the task cancellation policy on the whole piston set to 'never', but it still seems that the piston stops executing when the switch turns itself off. Can anyone help please?

@eibyer sorry to bother you but you helped me last time, any chance you can help with this one please?

Thanks.

10/9/2020, 12:44:33 PM +657ms
+3ms ╔Received event [VSW: Good morning].switch = off with a delay of 51ms, canQueue: true, calledMyself: false
+28ms ║RunTime initialize > 27 LockT > 1ms > rtDT > 2ms > pistonT > 0ms (first state access 24 4 23)
+32ms ║Runtime (10825 bytes) successfully initialized in 2ms (v0.3.110.20200916_HE)
+33ms ║╔Execution stage started
+43ms ║║Condition #4 evaluated false (6ms)
+45ms ║║Condition group #19 evaluated false (state did not change) (8ms)
+47ms ║║Condition group #31 evaluated false (state did not change) (10ms)
+51ms ║║Comparison (enum) off changes_to (string) on = false (0ms)
+53ms ║║Cancelling condition #35's schedules...
+54ms ║║Condition #35 evaluated false (7ms)
+56ms ║║Cancelling condition #1's schedules...
+57ms ║║Condition group #1 evaluated false (state changed) (21ms)
+62ms ║╚Execution stage complete. (29ms)
+65ms ╚Event processed successfully (63ms)

|10/9/2020, 12:44:32 PM +569ms||
|+3ms|╔Received event [VSW: Good morning].switch = on with a delay of 44ms, canQueue: true, calledMyself: false|
|+60ms|║RunTime initialize > 59 LockT > 1ms > rtDT > 43ms > pistonT > 42ms (first state access 15 4 55)|
|+68ms|║Runtime (10776 bytes) successfully initialized in 43ms (v0.3.110.20200916_HE)|
|+69ms|║╔Execution stage started|
|+81ms|║║Condition #4 evaluated false (7ms)|
|+82ms|║║Condition group #19 evaluated false (state did not change) (9ms)|
|+84ms|║║Condition group #31 evaluated false (state did not change) (10ms)|
|+88ms|║║Comparison (enum) on changes_to (string) on = true (0ms)|
|+90ms|║║Cancelling condition #35's schedules...|
|+91ms|║║Condition #35 evaluated true (6ms)|
|+93ms|║║Cancelling condition #1's schedules...|
|+94ms|║║Condition group #1 evaluated true (state changed) (21ms)|
|+100ms|║║Comparison (decimal) 74.0 is_greater_than (integer) 70 = true (1ms)|
|+101ms|║║Condition #64 evaluated true (6ms)|
|+103ms|║║Condition group #59 evaluated true (state did not change) (7ms)|
|+105ms|║║Cancelling statement #60's schedules...|
|+109ms|║║Skipped execution of physical command [Downstairs thermostat ST].cool([]) because it would make no change to the device. (1ms)|
|+110ms|║║Executed [Downstairs thermostat ST].cool (3ms)|
|+138ms|║║Executed physical command [Downstairs thermostat ST].setCoolingSetpoint([74.0], ) (23ms)|
|+139ms|║║Executed [Downstairs thermostat ST].setCoolingSetpoint (26ms)|
|+143ms|║║Cancelling statement #7's schedules...|
|+161ms|║║Executed physical command [Cabinet lights].setLevel([100], ) (15ms)|
|+162ms|║║Executed [Cabinet lights].setLevel (16ms)|
|+184ms|║║Executed physical command [Island lights].setLevel([100], ) (20ms)|
|+185ms|║║Executed [Island lights].setLevel (21ms)|
|+191ms|║║Executed virtual command [Cabinet lights, Island lights].setLocationMode (1ms)|
|+196ms|║║Comparison (time) 45872000 is_any = true (0ms)|
|+197ms|║║Time restriction check passed|
|+199ms|║║Condition #96 evaluated true (6ms)|
|+201ms|║║Cancelling condition #87's schedules...|
|+203ms|║║Condition group #87 evaluated true (state changed) (9ms)|
|+208ms|║║Comparison (enum) off is (string) heat = false (1ms)|
|+210ms|║║Condition #88 evaluated false (6ms)|
|+211ms|║║Cancelling condition #87's schedules...|
|+212ms|║║Condition group #87 evaluated false (state changed) (9ms)|

First thing I'd do is adjust that auto-off to longer than 1 sec. Then you want the TCP to Never on the with block of any tasks that has a wait timer because those are the ones that will get canceled when the auto-off kicks in.

Thanks @eibyer that fixed it. The TCP settings can be very confusing. It wasn't clear to me at which level to put them. Putting it on the 'wait' task fixed it.

1 Like

Hi

Is it possible to run a webCoRE piston from Rule machine using the Local Execute point?
I have tried both a GET & POST request from RM without any success:

Needless to say the exact same HTTP request from a web browser (Chrome) works just fine!!
There are no errors reported in HE logs, and needless to say, nothing in WC as it never executes...

BOTH the GET & POST Cloud Execute points DO WORK however:

https://cloud.hubitat.com/api/XXXABCXXX/apps/11/execute/:XXXABCXXXX:?access_token=XXXABCXXX

For obvious reasons I would prefer local to work...

TIA
J

If you go to

HE console -> select a piston under the webcore app

There is a link "Test run this piston"

This link will run the piston (and it shows you both local and cloud endpoints).

You can throw that endpoint into a browser to see it execute also. (GET)

Do be sure you are running the latest webcore. There was a bug a couple versions back that the endpoint did not execute properly.

Hi

Thanks for the reply.
As I said, the LOCAL endpoint runs fine from a browser. They do not run from RM, or I cannot get them to run from RM.
The CLOUD endpoints also run fine from a browser, as well as from within RM, but it doesn't make sense to use the CLOUD endpoints from RM.

I did not explicitly state the "Test run this piston" works (it does), but that is where I retrieved the endpoints from to begin with.

There is an additional issue with the CLOUD endpoint from RM, but I thought I would confirm & address the basics first. [I am comparing HE(RM)-> ST(WC) vs HE(RM)-> HE(WC) behavior]

J

A workaround would be to create a virtual switch and trigger it on when you want the rule to run and then in webcore use the virtual switch as the trigger.

I cannot use a virtual switch. My end goal is to pass parameters to the piston. WebCore can properly escape something like this "This is a sentence" into this "This%20is%20a%20sentence". RM fails because it uses the % character as part of the variable structure itself. I believe somebody else has already mentioned this limitation in this forum topic.

Just to put this into perspective... The same RM action to WC on ST works fine.

updated the local endpoint to use "http://127.0.0.1:8080/apps/..." and use the POST command. Seems to work with url encoded values. Didn't try with JSON.

image

I'm having a problem with a webcore piston that stopped working for no apparent reason and I just cannot get it working again.
The piston itself runs when it should but the action it performs isn't getting activated on the device.
All I want to do is turn on a particular z-wave device. If I just use the hubitat app and go to the device and turn it it on it all works fine and I can see the details in the z-wave logs.
However when the webcore piston runs the device doesn't get turned on even though according to the webcore logs it is doing. Also there is nothing in the z-wave logs when the piston is run.
It must be something like webcore has lost permission to the device or something.
I've tried removing the device from webcore and re-adding it but that didn't help.
Has anyone any idea how I might resolve this?

Thanks in advance

UPDATE:
It seems that there is a problem possibly with the device driver. The switch is a momentary switch which should turn itself off after 2 seconds but it seems it isn't doing this 90% of the time at least.
I have now disabled the auto turn off and have modified my piston to perform this action after the required delay. All seems good now.

1 Like

You don't have to actually install the storage app.
When you save your weather settings it automatically generates a webCoRE app (in the webCoRE apps list) called webCoRE storage.
Click on that.

New owner to Hubitat, used ST before with webcore and have now portet over all my pistons.
Allmost everything works but struggle with some issues I hope someone can pin pinpoint howto solve these issue.

I have a webrequest "GET" to a external API where where I send Custom Headers

'{
"X-Api-Key": "{apiKey}",
"Authorization": "{token}",
"Authorization-Provider": "{provider}"
}'

And parsing
Parse Json Data {$response}

And setting some variables from json.data

This works wonderful in ST but in HE the $response is somewhow {token} in debug to console and not the actual response from server. Weird..

I have from CURL, ST and Postman and all these returns correct response.

Do use weather in HE with webcore, is the only option to use an external weather service ? I saw that they mentation to use $eweather if I use the patched webcore.storage. How do I install this ? version.

Thanks in advanced..

I got the weather part to work :slight_smile: google and ctrl F is your best friend :slight_smile: the only part now is the webrequest thingie.

Is it possible to get TEMP in C, Now everything is fetched in F.

I haven't looked but you could do a calculation on it and copy to a variable.
Then set a virtual thermostat to that variable.
Bit of faffing about but it would work.

Thank you very much, there is a function called celsius and maybe use it together with floor. I'm still in newbie fase into this.

floor(celsius($weather.current.temp)) will convert to nearest "xx" ? maybe there are better way todo this ?

Maybe this is a better approach format('%.1f’,celsius($weather.current.temp)) todo it.