npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aframe-smart-home

v0.0.2

Published

Digital twin smart home proof of concept

Downloads

77

Readme

AFRAME-SMART-HOME

GitHub forks license GitHub version NPM

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).

Real

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:

Demo

USAGE:

SIMULATOR:

Default application is a simulator that mock sensor(s) values.

$ 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:

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:

curl http://artik1020.local:8888/properties
#| {"level":36.69597260346487}p

For convenience this can be enabled on boot:

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:

make start

GATEWAY:

Mozilla gateway could be also used with additional bearer token.

RESOURCES: