Virtual HTTP Light Devices, supporting RGB(WW), Dimmers, Switch and much more (Tasmota, ESP*, Shelly)

Is it possible to create a sensor in Vera that displays the power of a Shelly?

Yes. Which one? Door? Motion? Instructions in the read me. Then use a code similar to the previous, but updating tripped variable. I can help you with code, if you are able to create the virtual device.

Do you mean you want to display the wattage of the shelly 1 PM device?

Shelly 1 PM. A sensor to show the power in ,w" an a sensor for energy in ,kw/h".

It should be possible to use sitesensor plugin to poll the shelly device.

If you want power meter on the device itself (as it’s done on the native switch), this is doable with a simple script. I don’t have the JSON file, since I don’t have a 1PM. try to call /meters/ endpoint on you shelly and post the JSON here. Watts should be reported under power, while Kwh should be under counters.

SiteSensor as suggested by @ElCid is OK, but you’ll end up with a separated device.

Plugin suggestion -
I know you are busy looking into moving to openLuup but if you find any time.
The %s is replaced by on or off for a switch and 0 -100 for dimmer and 0 or1 for a sensor. Would it be possible to add user variable to define the %s replacement?

not really busy at the moment, except work.

can you be more specific? I already support specific endpoints for on/off, but I can’t think about a use case for dimmers. do you want true or false for sensors?

It would be nice to be able to send for example TurnOn/TurnOff. or power1/power0

So maybe two variables that by default are on/off, but the user cound define any replacements. This would make the plugin more configurable.

For sensors i was thinking that the sensor could send a http request to something other than the device, say a third party app/device

You can always set ON/OFF explicitly, in case you need more. So, it’s already there.

image

In the sample, I call two Vera’s endpoints with no replace and a custom url (like http://127.0.0.1:3480/data_request?id=lu_action&DeviceNum=321&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1)

I should have used the sensors as the example.
As that’s where I thought it would be helpfull, when i was tinkering with my shelly DIY sensors.
As it’s not possible there.

Ok, SetUnArmedURL and SetUnTrippedURL added. It will migrate on installation. It’s on GitHub, I’m not sure I will update the App Store.

1 Like

I go to GitHub anyway as its more reliable.
Keep it up , You are a a generous soul.

1 Like

Hello @therealdb,

I just stumbled over your app and it looks like it might support me in integrating my Daikin Altherma hybrid heating with vera. It uses a LAN adapter which supports websocket commands. For example:

ws.send(“{"m2m:rqp":{"op":2,"to":"/[0]/MNAE/1/Sensor/OutdoorTemperature/la","fr":"/TarmoTest","rqi":"yssyq"}}”);

And the reply would be:

{“m2m:rsp”:{“rsc”:2000,“rqi”:“yssyq”,“to”:“/TarmoTest”,“fr”:“/[0]/MNAE/1/Sensor/OutdoorTemperature/la”,“pc”:{“m2m:cin”:{“rn”:“000011b2”,“ri”:“0009_000011b2”,“pi”:“0009”,“ty”:4,“ct”:“20200511T175402Z”,“lt”:“20200511T175402Z”,“st”:4530,“con”:13.0000000000000000}}}}

Where the value behind “con”: would be the Temperature, i.e. 13.0.

Am I right in my assumption that I could use your app and if so, how would I implement the above in the app?

Thanks in advance for your reply!

HansW

This seems to be a websocket communication and this is not supported by an http call. You’ll need to keep the channel open and the code it’s different. The only possible way is to write a plugin, or bridge some like home assistant or node red that maybe already have it supported, to have an http endpoint.

@therealdb Dude Thereal Db I have been looking for an option to add a virtual device by http. The device is an iotty dual switch, also a smartlife plug. However I have not been successful. Could you tell me what are the http links that I should put in the app, for the setpowerurl and the setpoweroffurl? Thank you so much.

https://www.amazon.es/gp/product/B07PMWYNSW/ref=ppx_yo_dt_b_asin_title_o01_s02?ie=UTF8&psc=1
https://iottysmarthome.com/pages/iotty-tech-specs

Both have no local API, so it’s not possible. One route is to integrate them in IFFT and call them from Vera, using a webhook, or via Alexa, if you have it.

@therealdb I have is google home. Do you have a channel or way to do it to call them from Vera with ifttt? I appreciate your support.

I’m no expert on Google home, but I think node red is the best solution.

You can join the IFTTT beta for Vera to make Vera objects the target of “That” receipies in IFTTT. Support listed the link recentently on how to enable it.