ALTUI & DataStorage Providers

[quote=“dmckenna, post:40, topic:190668”]AMG0,

Do you have any ideas on how to configure ALTUI to pass the value of a switch position/variable through to Webhooks ?

I’ve got a very clonky and non-elegant work around using PLEG but thought I’d ask if there’s a more direct/seamless way with ALTUI that you’ve discovered…

Purpose - Virtual Switch (VS) device on Vera to control an IFTTT device.

Method - Create a Virtual Switch, configure ALTUI/Webhooks/IFTTT as detailed in this thread

Result - The iFTTT device responds to every state change of the Virtual Switch as opposed to On for On and Off for Off. e.g If the device is turned off manually and the VS is still in the On Position, then by clicking the VS to Off this actually then turns the state of the device to On - states become out of sync.

Workaround - Configure IFTTT recipes for both On AND OFF states. Use PLEG to detect a trigger on the VS, use 2 actions in LUUP to send the native IFTTT maker and trigger keys for either ON or OFF. Use Vera IFTTT integration to detect when the IFTTT device state is changed locally and send that state back to Vera so devices are in sync. It works but it’s not elegant and needs a lot of configuration for one device.

So…could ALTUI do a better job ?

Thanks

David[/quote]

did you go through the doc in this post ?[url=http://forum.micasaverde.com/index.php/topic,35860.msg335963.html#msg335963]http://forum.micasaverde.com/index.php/topic,35860.msg335963.html#msg335963[/url]

this is exactly what ALTUI’s IFTTT data provider implementation does. on a device’s variable value change , the value is pushed to IFTTT with a web service ( http GET to a target url). You do not have to use IFTTT, you can accomplish this with other type of destinations (other than IFTTT) thanks to the open ALTUI data provider architecture which lets you dynamically add other data providers to ALTUI. a few forum members did this already ( akbooer ,etc. )

I may not answer well your out of sync problem but it sounds to me it is something to be addressed somewhere else in VERA. the VS and the device should be kept in sync by other mean ( lua polling ? )

Unselect it from the menu list ( Ctrl click for multiple selection ), then close to save[/quote]

Am having trouble unselecting from the menu list. If I click ‘away’ from the menu it goes grey but closing or resaving does not seem to work. If I click on the menu list the service remains highlighted in blue.

It is as @amg0 said below: ctrl-click (or cmd-click, depending on your OS preference.)

However, the trick is to save the change properly. You HAVE to remember to click on the red ‘Graph’ icon to close the sub-window. If you have deselected the last (or only) storage provider for that variable, then the icon will revert to its normal background colour.

Ty ak

Good Evening.
I have been posting data (W) to emoncms, and I realized that there was a discrepancy between the measured kwh in the device and the accumulated Kwh provided by emoncms (feed is , PHPTimeSeries).

I explored a little, and I think the problem might be that ALTUI is not triggering whenever the data goes from xx Watt to 0 Watt.
Emoncms holds the previous value and therefore keeps accumulating.

I had made a workaround using the KWh directly from the device, but nevertheless I just want to let you know.
The example below is a towel heater that goes offline @08:00, and as you see the new value was not catched by emoncms (i double checked, and the towel heater is actually off 0.00watt in ALTUI).

I have the same behavior with FIBARO switches, plugs, and several other device brands (everspring, aeotec).

Thank you in advance.
Germano

2018-11-05 05:53:29, 0
2018-11-05 06:13:08, 0
2018-11-05 06:29:11, 187
2018-11-05 06:33:23, 64
2018-11-05 06:54:11, 0
2018-11-05 07:14:04, 188
2018-11-05 07:15:17, 0
2018-11-05 07:36:33, 0
2018-11-05 07:54:04, 192

I’m having some difficulty with this again. I’m trying to deselect the data storage provider on 2 variables because I don’t need them anymore. When I click the graph icon, the background turns red but the form (list) doesn’t appear.

I do see an error in the console

J_ALTUI_uimgr.js:2074 Uncaught TypeError: Cannot read property 'parameters' of undefined
at Object.<anonymous> (J_ALTUI_uimgr.js:2074)
at Function.each (jquery.min.js:2)
at buildPushForm (J_ALTUI_uimgr.js:2073)
at J_ALTUI_uimgr.js:2160
at J_ALTUI_verabox.js:2666
at J_ALTUI_verabox.js:1137
at Object._unproxifyResult [as unproxifyResult] (J_ALTUI_upnp.js:40)
at Object.<anonymous> (J_ALTUI_verabox.js:1135)
at c (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)

I looked at the code and it appears the error happens inside a loop that is trying to build the form.

ALTUI version v2.46.2533
openLuup version 19.11.8
on Alpine Linux 3.10

Thanks!! -D

can you run this code in misc/debug tool/javascript code

MultiBox.getDataProviders(function(pro) { alert(JSON.stringify(pro) ) } )

Also can you give the content of the VariableToSend variable of the incriminated device.

Did you remove a data provider recently ?

This is the output, though I wrote it out to the console log instead of to an alert.

{"emoncms":{"url":"","callback":"sendValueToStorage_emoncms","parameters":[{"default":1,"type":"number","key":"nodeid","label":"Node ID"},{"type":"number","key":"feedid","label":"Feed ID"},{"type":"text","key":"inputkey","label":"Input Key name"},{"type":"text","key":"readwritekey","label":"Read/Write API Key"},{"type":"url","key":"graphicurl","label":"Graphic Url","ifheight":460,"default":"https://emoncms.org/vis/realtime?feedid={1}&embed=1&apikey={3}"}]},"IFTTT":{"url":"","callback":"sendValueToStorage_ifttt","parameters":[{"type":"text","key":"webhookkey","label":"Web Hook Key"},{"default":"vera_data_published","type":"text","key":"eventname","label":"Hook Event Name"}]},"thingspeak":{"url":"","callback":"sendValueToStorage_thingspeak","parameters":[{"type":"number","key":"channelid","label":"Channel ID"},{"type":"text","key":"readkey","label":"Read API Key"},{"type":"text","key":"writekey","label":"Write API Key"},{"default":1,"type":"number","key":"fieldnum","label":"Field Number"},{"default":"//api.thingspeak.com/channels/{0}/charts/{3}?key={1}&width=450&height=260&results=60&dynamic=true","type":"url","key":"graphicurl","label":"Graphic Url"}]},"Vera@192.168.1.31":{"url":"http://127.0.0.1:3480/data_request?id=lr_HTTP_VeraBridgeMirror_192.168.1.31","callback":"","parameters":[{"key":"mirror","type":"text","default":"device.serviceId.name","label":"Mirror"}]}}

I think I see where you are going with this. I don’t think I removed any providers. The DataYour plugin still shows as installed on the plugins page, and the DataYours files are still in /etc/cmh-ludl. But DataYours as a provider does not show up in the JSON output.

Do you think it would help if I removed and reinstalled the DataYours plugin? My plan is to get rid of it entirely at some point, since I can how use the data historian in openLuup. Or maybe I can hack the user data somehow to remove the reference to the provider.

Thanks! -D

Oh, and the VariableToSend variable does not seem to exist on the problem device. The device is a virtual humidity sensor fed via Mqtt.

my bad, it is VariablesToSend. variable on the ALTUI device
also need to know the deviceid of the device you are trying to edit

no prob. here’s the VariablesToSend from the AltUI device:

urn:micasaverde-com:serviceId:HumiditySensor1#CurrentLevel#0-38#datayours#Vera-88800000.038.urn^micasaverde-com^serviceId^HumiditySensor1.CurrentLevel#/data_request?id=lr_render&target={0}&hideLegend=true&height=250&from=-y;urn:upnp-org:serviceId:TemperatureSensor1#CurrentTemperature#0-37#datayours#Vera-88800000.037.urn^upnp-org^serviceId^TemperatureSensor1.CurrentTemperature#/data_request?id=lr_render&target={0}&hideLegend=true&height=250&from=-y;

There are two devices from which I am trying to remove the datastorage provider. They were the only two set up on DataYours:

#0-38 Is the virtual humidity sensor, and
#0-37 Is the virtual temperature sensor

Thanks!! --D

the problem is that the data provider is not anymore declared in ALTUI.

can you try v2535 on GitHub - amg0/ALTUI: Enhancement Interface for VERA home automation system

it should not crash and after you edit / close the push configuration for a variable, it should remove the VariablesToSend which correspond to a data provider which is not anymore declared in ALTUI

Worked like a charm.

I guess I’m still curious about what happened to the data provider. The plugin is still there, the files are there, and the DataYours device is there. Probably something that I did. But I want to get rid of it all anyway so I guess I shouldn’t care. And in fact I’ve already deleted it. :slight_smile:

Thanks for the help!!! --D