https://github.com/iodar/shelly-button-test
Application to test the configuration and functionality of the Shelly Button1.
https://github.com/iodar/shelly-button-test
button1 http-server iot shelly shelly-button1 typescript
Last synced: 23 days ago
JSON representation
Application to test the configuration and functionality of the Shelly Button1.
- Host: GitHub
- URL: https://github.com/iodar/shelly-button-test
- Owner: iodar
- Created: 2021-02-05T19:57:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-07T01:46:13.000Z (over 5 years ago)
- Last Synced: 2025-01-11T10:16:12.806Z (over 1 year ago)
- Topics: button1, http-server, iot, shelly, shelly-button1, typescript
- Language: TypeScript
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shelly Button1 Test
This project provides an easy to setup simple webserver that can
be used to try out the `Shelly Button1`. It supports web handlers
and resources for each short and long push url action that the
`Shelly Button1` has.
# Prerequisites
- nodejs >= 12
- yarn / npm
# Build and Start
- Build with `yarn install` oder `npm install`
- Start server with `yarn start` or `npm start`
# Features
The server starts on `http://localhost`. The following urls have handlers
attached and can therefore be called by the `Shelly Button1`:
- `/button/short/1`
- `/button/short/2`
- `/button/short/3`
- `/button/long/1`
These urls must be configured as the actions url in the configuration
of the `Shelly Button1`:
| ACTION URL | URL TO SET TO |
| ---- | ---- |
| Short url 1 | `http:///button/short/1` |
| Short url 2 | `http:///button/short/2` |
| Short url 3 | `http:///button/short/3` |
| Long url 1 | `http:///button/long/1` |
When an url is called the server will respond with `HTTP/1.1 200 OK` and a small message.
It will also log the following information:
- Url which was called (short, long, which one)
- Ip address of the caller
- Battery status of the button (is retrieved in a separate call to the button)
The log will look like this:
```bash
2021-02-07T09:13:28.533Z SERVER: 'short url 1' was called from 101.10.23.7
2021-02-07T09:13:28.533Z SERVER: Shelly status (101.10.23.7) => Battery 100% and 4.19 Volts
```