https://github.com/rzr/aframe-smart-home
Web Of Twin Example
https://github.com/rzr/aframe-smart-home
aframe digitaltwin digitaltwins solar webthing webthings
Last synced: 17 days ago
JSON representation
Web Of Twin Example
- Host: GitHub
- URL: https://github.com/rzr/aframe-smart-home
- Owner: rzr
- License: mpl-2.0
- Created: 2019-08-13T17:19:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-28T17:39:55.000Z (about 1 year ago)
- Last Synced: 2025-04-14T18:05:44.635Z (22 days ago)
- Topics: aframe, digitaltwin, digitaltwins, solar, webthing, webthings
- Language: JavaScript
- Homepage: http://purl.org/aframe-smart-home
- Size: 229 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AFRAME-SMART-HOME #
[](
https://GitHub.com/rzr/aframe-smart-home/network/
)
[](LICENSE)
[](
http://badge.fury.io/gh/rzr%2Faframe-smart-home
)
[](
https://www.npmjs.com/package/aframe-smart-home
)Aframe-smart-home is a demo project illustrating digital twins, using different technologies:
* WoT/Mozilla's WebThing schema to describe resources
* webthing-iotjs to simulate some sensors (only one here)
* aframe for rendering to XR devices
* aframe-webthing to update XR view from webthing## EXPLANATION: ##
Today, the smart house is empty but has a solar pannel on the roof
and we are monitoring the voltage in real time.For demo purposes a real model of the house was used along
a tiny but real solar pannel (item found in garden lamp).[](
https://purl.org/aframe-smart-home#
"#aframe-smart-home")The output voltage of the solar panel is measured using on board analog input and value is shared to the web using WebThing API.
Then a model can be updated by reading the actual value, the device's color is updated according to an heatmap palette:
[](
https://rzr.github.io/aframe-smart-home/aframe
"#aframe-smart-home")## USAGE: ##
### SIMULATOR: ###
Default application is a simulator that mock sensor(s) values.
```sh
$ npm install aframe-smart-home
$ cd node_modules/aframe-smart-home/
$ npm install && npm start
$ curl http://localhost:8888/
{ "id": "urn:dev:ops:smarthome-1234", (...)
"properties": {
"level": {
"description": "Solar sensor level",
"links": [ {
"rel": "property",
"href": "/properties/level" (...)
$ curl http://localhost:8888/properties
{"level":42}
cd aframe
npm install && PORT=42080 npm start
x-www-browser http://localhost:42080/aframe/
```### CLOUD: ###
Glitch can run this previous simulator
*
### NODE TARGET: ###
Any board with ADC port could be used.
Here an example on ARTIK1020 using webthing-node:
```sh
git clone --depth=1 --recursive https://github.com/rzr/aframe-smart-home
cd aframe-smart-home
make -C example/artik1020/ start
#| Listening:
#| http://localhost:8888/
#| log: ADC: level: open: null (null expected)
#| log: ADC: level: update: 0x2a : 40
#| 0.03515625 V
#| log: ADC: level: change: 48%
#| (...)
```In other shell value can be queried:
```sh
curl http://artik1020.local:8888/properties
#| {"level":36.69597260346487}p
```For convenience this can be enabled on boot:
```sh
sudo ln -fs $PWD /usr/local/opt/aframe-smart-home
unit=aframe-smart-home
service=/usr/local/opt/aframe-smart-home/example/artik1020/aframe-smart-home.service
sudo ln -fs $service /usr/lib/systemd/system/
sudo systemctl restart $unit
sudo journalctl -xu $unit
```### IOTJS TARGET: ###
Any board with ADC port could be used.
It should be easy to adapt from supported boards of webthing-iotjs,
see STM32F7 platform example.Anyway it's possible to use it on Linux using the same simulator:
```sh
make start
```### GATEWAY: ###
Mozilla gateway could be also used with additional bearer token.
## RESOURCES: ##
*
*
*
*
*
*