All Projects → andersonshatch → soma-ctrl

andersonshatch / soma-ctrl

Licence: MIT License
Node util for controlling SOMA smart shade via MQTT or HTTP

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to soma-ctrl

Ha Bt Proximity
Distributed Bluetooth Room Presence Sensor for Home Assistant
Stars: ✭ 77 (+305.26%)
Mutual labels:  home-automation, bluetooth, home-assistant, bluetooth-le
Home Assistant Configuration
My Home Assistant Config. For more Information visit ->
Stars: ✭ 102 (+436.84%)
Mutual labels:  home-automation, mqtt, home-assistant
Frigate
NVR with realtime local object detection for IP cameras
Stars: ✭ 1,329 (+6894.74%)
Mutual labels:  home-automation, mqtt, home-assistant
Android Mqtt Alarm Panel
Android Alarm Panel for Home Assistant and Home Automation Platforms (http://thanksmister.com/android-mqtt-alarm-panel/)
Stars: ✭ 124 (+552.63%)
Mutual labels:  home-automation, mqtt, home-assistant
Wavin Ahc 9000 Mqtt
Esp8266 mqtt interface for Wavin AHC-9000/Jablotron AC-116
Stars: ✭ 47 (+147.37%)
Mutual labels:  home-automation, mqtt, home-assistant
Homeautomation.codesys3
Home Automation system build in CoDeSys 3 with MQTT communication to any third party Home Automation software
Stars: ✭ 55 (+189.47%)
Mutual labels:  home-automation, mqtt, home-assistant
Itead sonoff
Alternative firmware for Itead Sonoff switches, based on the MQTT protocol and a TLS connection
Stars: ✭ 115 (+505.26%)
Mutual labels:  home-automation, mqtt, home-assistant
Hassio Zigbee2mqtt
Hass.io add-on for zigbee2mqtt
Stars: ✭ 547 (+2778.95%)
Mutual labels:  home-automation, mqtt, home-assistant
Temper Esp8266
Temper is a compact temperature sensor based on ESP8266 and SHT30 with large 13x7 pixel led display.
Stars: ✭ 155 (+715.79%)
Mutual labels:  home-automation, mqtt, home-assistant
Home Assistant Config Fr
🏠Configuration de Home Assistant en français. 👨🏻‍💻 N'hésitez pas à ⭐ mon repo et à copier les bonnes idées ! 🇨🇵
Stars: ✭ 175 (+821.05%)
Mutual labels:  home-automation, mqtt, home-assistant
Openmqttgateway
MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility, SMS & LORA.
Stars: ✭ 2,413 (+12600%)
Mutual labels:  home-automation, mqtt, home-assistant
Open Home
Projeto de automação residencial usando softwares e hardwares open source.
Stars: ✭ 41 (+115.79%)
Mutual labels:  home-automation, mqtt, home-assistant
Open Home Automation
Open Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
Stars: ✭ 820 (+4215.79%)
Mutual labels:  home-automation, mqtt, home-assistant
Platypush
A versatile and extensible platform for home and life automation with hundreds of supported integrations
Stars: ✭ 192 (+910.53%)
Mutual labels:  home-automation, mqtt, bluetooth
Room Assistant
Presence tracking and more for automation on the room-level
Stars: ✭ 764 (+3921.05%)
Mutual labels:  home-automation, bluetooth, home-assistant
Loadcelloccupany
Home automation occupancy sensor using load cells
Stars: ✭ 103 (+442.11%)
Mutual labels:  home-automation, mqtt, home-assistant
Miflora Mqtt Daemon
Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼🥀🏡🌳
Stars: ✭ 409 (+2052.63%)
Mutual labels:  home-automation, mqtt, home-assistant
Smarthome
@skalavala 👍 Nothing But Smarthome Stuff! - By Mahasri Kalavala
Stars: ✭ 437 (+2200%)
Mutual labels:  home-automation, mqtt, home-assistant
Ha Tts Bluetooth Speaker
TTS Bluetooth Speaker for Home Assistant
Stars: ✭ 140 (+636.84%)
Mutual labels:  home-automation, bluetooth, home-assistant
Home Assistant
Home-Assistant-Config
Stars: ✭ 182 (+857.89%)
Mutual labels:  home-automation, mqtt, home-assistant

SOMA Blind Controller Util npm version

Util for controlling SOMA smart shade, either over MQTT or via a HTTP API

Requirements

  • SOMA smart shade device that has been configured with the SOMA app
  • Bluetooth 4.0 LE hardware
  • OS supported by noble (I've only tested on macOS and Raspbian)
  • Node 8.16.1 or higher (Tested on Node 12.10.0, 11.15.0, 10.15.2, 9.11.2, 8.16.1)
  • (Potentially a Bluetooth stick to itself, if you're using some other Bluetooth software, see #59)

Installation

Run npm install -g soma-ctrl

Usage

somactrl by itself will print usage information

By default, device scanning will be active for 30 seconds, and any supported ones will be connected to. You may optionally:

  • Alter the device scanning timeout, e.g. scan for 60 seconds: somactrl -t 60
  • Specify the number of devices you expect to connect to, e.g. 4 devices expected: somactrl -e 4
  • Manually specify a list of device IDs to connect to, e.g. connect to RISE108 and RISE117: somactrl RISE108 RISE117
  • Manually specify a list of MAC addresses to connect to, e.g.: somactrl f5:11:7b:ee:f3:43

You must then specify options to use either MQTT, HTTP or both

To use with HTTP

Specify a port for the API to listen on with -l: somactrl -l 3000

To use with MQTT

Specify a broker URL with --url option: somactrl --url mqtt://yourbroker (mqtt/mqtts/ws/wss accepted)

Username and password for MQTT may be specified with -u and -p option

If no password argument is supplied, you can enter it interactively

Base topic defaults to homeassistant, but may be configured with the -topic option

MQTT

For each device connected, data will be published to the following topics: <baseTopic>/cover/<deviceID>/position - position

<baseTopic>/cover/<deviceID>/connected - connected or disconnected

<baseTopic>/cover/<deviceID>/battery - battery level

To issue commands: Move: <baseTopic>/cover/<deviceID>/move - message: int position between 0 (closed) and 100 (open)

Stop: <baseTopic>/cover/<deviceID>/move - message: 'stop'

Identify (beep device): <baseTopic>/cover/<deviceID/identify - message is ignored

In addition, for use with Home Assistant MQTT Discovery:

To automatically setup the cover device: <baseTopic>/cover/<deviceID>/config will be set to, e.g.:

{
    "name": "Living Room1",
    "availability_topic": "homeassistant/cover/RISE148/connection",
    "payload_available": "connected",
    "payload_not_available": "disconnected",
    "position_topic": "homeassistant/cover/RISE148/position",
    "set_position_topic": "homeassistant/cover/RISE148/move",
    "command_topic": "homeassistant/cover/RISE148/move",
    "payload_open": 100,
    "payload_close": 0,
    "unique_id": "soma_RISE148_cover",
    "device": {
        "identifiers": "soma_RISE148",
        "name": "RISE148",
        "manufacturer": "Soma",
        "model": "Smart Shade"
    }
}

To automatically setup a battery sensor: <baseTopic>/sensor/cover_<deviceName|slugified>_battery/config will be set to, e.g.:

{
    "name": "Cover <deviceID> battery",
    "state_topic": "<baseTopic>/cover/<deviceID>/battery",
    "unit_of_measurement": "%",
    "device_class": "battery",
    "unique_id": "soma_<deviceID>_battery",
    "device": {
        "identifiers": "soma_RISE148",
        "name": "RISE148",
        "manufacturer": "Soma",
        "model": "Smart Shade"
    }
}

Parameters

<deviceID> has format RISEnnn or the device's MAC address in lowercase, with the colon's stripped out and cannot be changed

<deviceName|slugified> will be the device name (as configured in the app) with spaces replaced by underscores

HTTP Endpoints

GET /: list devices. Response type: [String : Device] - ID as String key, Device as value

{
    "RISE148": {
        "id": "RISE148",
        "battery": 29,
        "batteryLevelLastChanged": "2018-05-03T17:14:10.590Z",
        "position": 0,
        "positionLastChanged": "2018-05-03T17:14:10.320Z",
        "connectionState": "connected",
        "state": "closed",
        "group": "Living Room",
        "name": "Living Room1"
    },
    "RISE236": {
        "id": "RISE236",
        "battery": 28,
        "batteryLevelLastChanged": "2018-05-03T17:14:10.497Z",
        "position": 0,
        "positionLastChanged": "2018-05-03T17:14:10.198Z",
        "connectionState": "connected",
        "state": "closed",
        "group": "Living Room",
        "name": "Living Room2"
    }
}

GET /<deviceID>: Get individual device data (or 404 if no device by that ID).

Response type: Device example:

{
    "id": "RISE148",
    "battery": 29,
    "batteryLevelLastChanged": "2018-05-03T17:14:10.590Z",
    "position": 0,
    "positionLastChanged": "2018-05-03T17:14:10.320Z",
    "connectionState": "connected",
    "state": "closed",
    "group": "Living Room",
    "name": "Living Room1"
}

POST /<deviceID>/identify: Ask deviceID to identify itself (beep). Response type: 200 - OK or 404 - Not Found

POST /<deviceID>/move?position=<position>: Ask deviceID to move to <position>. Response type: Device or 404

POST /<deviceID>/stop: Ask deviceID to stop moving. Response type: 200 - OK or 404 - Not Found

POST /<deviceID>/calibrateModeStart: Enable calibrate mode on deviceID. Response type: 200 - OK or 404 - Not Found

POST /<deviceID>/moveUp: Request device to move up. Beware that if calibration mode is enabled, the defined top position is not honoured. Response type: 200 - OK or 404 - Not Found

POST /<deviceID>/stop: Request device to stop moving. Response type: 200 - OK or 404 - Not Found

POST /<deviceID>/moveDown: Request device to move down. Beware that if calibration mode is enabled, the defined bottom position is not honoured. Response type: 200 - OK or 404 - Not Found

POST /<deviceID>/calibrateTop: When in calibrate mode, set the current position as the top-most position. Response Type: 200 - OK or 404 - Not Found

POST /<deviceID>/calibrateBottom: When in calibrate mode, set the current position as the bottom-most position. Response Type: 200 - OK or 404 - Not Found

POST /<deviceID>/calibrateModeStop: Disable calibrate mode on deviceID. Response type; 200 - OK or 404 - Not Found

POST /exit: Quit somactrl (useful if you run with systemd and want to restart). Response type: 200 - OK

Parameters

<deviceID> has format RISEnnn or the device's MAC address in lowercase, with the colon's stripped out and cannot be changed

<position> should be an integer between 0 (closed) and 100 (open)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].