Comments (16)
Currently, it's only possible to use the HTTP requests as an action.
If I understand you correctly you want to use the result of the request as a property?
from http-adapter.
So thanks for the work bow
I'm always happy if I can help :)
The latest idea I had in mind was my reMarkable
I wasn't aware that you can control it wirelessly.
Sounds pretty cool!
I believe JSON, string, float and int should cover most cases.
I added support for primitive types yesterday.
JSON needs some additional work as I need to extract the values somehow.
from http-adapter.
As soon as the PR is merged you can test the new update.
Which just happened 😬
from http-adapter.
Because a picture is worth 1000 words :D
from http-adapter.
Currently, it's only possible to use the HTTP requests as an action.
If I understand you correctly you want to use the result of the request as a property?
thanks for reply. yes I want to reading the result of the request.
from http-adapter.
Sorry, I missed your response.
I want to reading the result of the request
That's not possible with the current implementation.
Actions don't have a result.
I think I could expose an HTTP endpoint as a device property, but that would be limited to primitive types like string
or number
.
You would need to specify which value you would like to use.
Are you still interested in this?
from http-adapter.
Hi, I'm interested in this. I'd like to show the properties of a device in addition to actions.
It could be either as result of an action, e.g. read sensor value, but ideally would follow the Thing model and displayed without user input.
PS: Thanks for the plugin by the way, I was able to connect and control my Roomba with it, cf https://twitter.com/utopiah/status/1322236808600735744
from http-adapter.
Hi @Utopiah,
I already did some testing with simple types but I never pushed it.
What type of responses do you have?
Nice tweets btw 😬
from http-adapter.
Thanks @tim-hellhake, there would be no nice tweets without this amazing add-on! So thanks for the work 🙇
The latest idea I had in mind was my reMarkable for its battery level (since I stuck it on my fridge) in order to have rules related to notifications or my scale to... well maybe lock the fridge 😉
For those two I either rely on a REST API (e.g. koalazak/rest980) or I setup a small express server when there is nothing (e.g. reMarkable) so I usually have control but I believe JSON, string, float and int should cover most cases.
from http-adapter.
As soon as the PR is merged you can test the new update.
I'll add support for JSON soon.
from http-adapter.
I added an option to specify device capabilities (https://iot.mozilla.org/schemas).
If you add the MultiLevelSensor
capability to the device and the LevelProperty
type to the battery property, you should be able to see the battery level in the things view.
from http-adapter.
Super!
from http-adapter.
One thing is bothering me.
The battery should be read-only.
I need to add a new config option for that.
from http-adapter.
After the next update, the battery property should look a bit different.
You also set the unit
in the settings for %
now.
from http-adapter.
If you select the right capability for the device, you should see the value instead of THING
.
Just click on edit and select the Multi Level Sensor
.
from http-adapter.
@Utopiah I'm closing this now.
If you have any problems just open a new PR :)
from http-adapter.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-adapter.